You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Copied from cedar-user mailing list; reported by [email protected]]
There's a strange behviour when using Elements in Templates. This may be the intended way to work, but nevertheless confusing. I try to describe it, but if it is not fully understandable I could also explain it in a short call if you are available.
I have an Element called "person", which consists of say a "name" and "email".
Use case one: I want to add this "person" element to the template but want to call it "author".
After I add the element and rename it in "Enter Element Name" the name is only aliased in _ui.propertyLabels like this:
while under properties it remains with the same name, ie.
"properties": {
"person": {
...
}
}
This seems to be inconsistent with how renaming the label of a normal field works. In that case when I rename eg. "name" to "personName" both the
"propertyLabels" and the "properties" key is updated to personName. Ie.:
Use case two: I want to add this "person" element to the template once as "author" and once as "editor".
In this case renaming the first instance of the Element to "author" results in the same behaviour as above. When adding the second instance and renaming it to "editor" I get these values:
To avoid name clashes a new "person1" field is introduced with an "editor" alias.
The first problem I see is that while working on the template this "person1" is not known by the user, this is not displayed anywhere, the user is only aware of the "editor" label he added. In this specific case it could have been even named "editor" just as the user entered. When the user then populates metadata with this template he would be surprised that the metadata field will be "person1" and not "editor".
So, overall the problem I am facing is that renaming field labels and element instance labels is somehow not consistent and the editor of the template is not aware of new names introduced by the system (ie. person1).
Would there be any problem to use the same keys in "properties" that the user enters as a field/element name? For example, for the second use case I would expect to have this in the template:
[Copied from cedar-user mailing list; reported by [email protected]]
There's a strange behviour when using Elements in Templates. This may be the intended way to work, but nevertheless confusing. I try to describe it, but if it is not fully understandable I could also explain it in a short call if you are available.
I have an Element called "person", which consists of say a "name" and "email".
Use case one: I want to add this "person" element to the template but want to call it "author".
After I add the element and rename it in "Enter Element Name" the name is only aliased in _ui.propertyLabels like this:
while under properties it remains with the same name, ie.
This seems to be inconsistent with how renaming the label of a normal field works. In that case when I rename eg. "name" to "personName" both the
"propertyLabels" and the "properties" key is updated to personName. Ie.:
Use case two: I want to add this "person" element to the template once as "author" and once as "editor".
In this case renaming the first instance of the Element to "author" results in the same behaviour as above. When adding the second instance and renaming it to "editor" I get these values:
To avoid name clashes a new "person1" field is introduced with an "editor" alias.
The first problem I see is that while working on the template this "person1" is not known by the user, this is not displayed anywhere, the user is only aware of the "editor" label he added. In this specific case it could have been even named "editor" just as the user entered. When the user then populates metadata with this template he would be surprised that the metadata field will be "person1" and not "editor".
So, overall the problem I am facing is that renaming field labels and element instance labels is somehow not consistent and the editor of the template is not aware of new names introduced by the system (ie. person1).
Would there be any problem to use the same keys in "properties" that the user enters as a field/element name? For example, for the second use case I would expect to have this in the template:
The text was updated successfully, but these errors were encountered: