-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
documents: improve editor #206
Conversation
"propertiesOrder": [ | ||
"documentType", | ||
"title", | ||
"organisation", | ||
"classification", | ||
"language", | ||
"abstracts", | ||
"subjects", | ||
"identifiedBy", | ||
"contribution", | ||
"dissertation", | ||
"editionStatement", | ||
"otherEdition", | ||
"provisionActivity", | ||
"partOf", | ||
"specificCollections", | ||
"extent", | ||
"formats", | ||
"notes", | ||
"series", | ||
"additionalMaterials", | ||
"contentNote", | ||
"otherMaterialCharacteristics", | ||
"usageAndAccessPolicy" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better to place propertiesOrder
tag just next to required field ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose this order:
- properties
- propertiesOrder
- required
The same should be applied for all the properties. What is you opinion about that?
If you agree, I will propose that in https://github.com/rero/developer-resources/blob/master/guidelines/json-schemas.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a problem for me if all project schemas follow the same pattern.
I think it's more easy to find "required" and "propertiesOrder" at the top of the file (easier to find). That's my personal opinion, not a guideline :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accordingly to the freshly approved section https://github.com/rero/developer-resources/blob/master/guidelines/json-schemas.md#order, I did the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK for me. Just some not blocking comments
I encountered some potential issues within the editor:
@jma Could we take a look and determine if these points are due to misconfiguration or editor issue. |
@pronguen In CDU.xlsx file on switch drive, two fields contains the same ID 61: Medicine and Health. Medicine is the parent of Health. Is this a mistake? |
@sebastiendeleze I think it is not a mistake. We should just take these ID as they are... |
@zannkukai Sorry I had to do some changes, could you take a look again, please? |
for option in value['form']['options']: | ||
if option.get('level'): | ||
option['label'] = "{spaces} {label}".format( | ||
spaces='-' * 2 * option['level'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you tried " " instead of a dash ? If it works it should be more readable (my opinion)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely agree, but spaces are trimmed somewhere in ngx-formly..
* Configures JSON schema for improving document editor. * Adds constraints and validations for certain fields. * Adds translations for bibframe types. * Adds a schema for files in marshmallow. * Renames from "restricted" to "restriction" the object giving the restriction information of a file. * Removes "restriction" object when a file is loaded in marshmallow. * Fixes issue on file restriction when organisation is not resolved. * Completes document types items list. * Hierarchize form options based on a `level` property. * Re-organize items for Classification field. * Closes rero/sonar-ui#63. Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
documents: improve editor
level
property.Co-Authored-by: Sébastien Délèze sebastien.deleze@rero.ch
How to test
NOTE: The aim of this PR is to confirm that documents can be created or updated with the form. Maybe some placeholders or validations are missing, we can add them later.