Skip to content
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

Improve and correct the document editor #230

Closed
10 tasks done
pronguen opened this issue May 25, 2020 · 2 comments · Fixed by #281
Closed
10 tasks done

Improve and correct the document editor #230

pronguen opened this issue May 25, 2020 · 2 comments · Fixed by #281

Comments

@pronguen
Copy link
Contributor

pronguen commented May 25, 2020

  • title.type could be hidden because there is only one possible value
  • we could put English as default language (of subjects, title, abstract, etc.)
  • in contribution, there is a type bf:Local that belongs to field identifiedBy (must be removed)
  • in classification, the type must be entered twice, which is not correct
  • when adding a subtitle, the field value should be displayed automatically
  • language should be required. The language type can be hidden (one value possible only)
  • add field degree to deposit form (not mandatory) for all thesis. This fields contains subfields: grantingInstitution and date (type string)
  • all types "contribution to journal" must have the partOf field required.
  • organisation should be required
  • Instead of hiding provisionActivity depending on document type, the field have to be displayed, but required or not depending on the case.
@sebdeleze
Copy link
Contributor

Due to some limitations in the editor, some points cannot be covered. Particularly the handling of default values for properties. To summarize the behavior of setting a default value for a field, when we set a default value, the field has to be displayed in the form (required). Otherwise some data are arbitrarily posted and validation may fail.

Hide title type
It's not possible because if this field is hidden, we have to put a default value and when we do this, the field becomes visible... We just can disable this field and put it after other fields.

English by default for language
I cannot do that, because language is a property of several fields and if a default value is set, data for these fields are posted even if they are hidden. The best I can do is to put the preferred languages at the top of the list. This was the case, but an issue has been introduced in recent's ng-core PRs. I will try to correct that in another PR.

Classification
OK, but not possible to hide type for the same reason as title type.

Language is required
OK, but not possible to hide type for the same reason as title type.

Add field degree to deposit form
I will do that in another PR as this issue is about document editor only.

ProvisionActivity
Ok, but if we save a document with a PA required and after we change the document type and the PA becomes not required, it's impossible to save the document after removing PA, as some data are remaining in posted data. I opened an issue in ng-core for @jma rero/ng-core#242.

@pronguen
Copy link
Contributor Author

It's not possible because if this field is hidden, we have to put a default value and when we do this, the field becomes visible... We just can disable this field and put it after other fields.

I think we can put a default value bf:Title and hide it. The enum has anyway only one possible value. This applies also to bf:ClassificationUdc and bf:Language.

sebdeleze pushed a commit that referenced this issue Sep 7, 2020
Improve document editor by making some changes on fields, listed below.

* Adds CSS class `editor-title` to display a block for each main fields.
* Makes field `title.type` not editable and place it after the value.
* Removes type `bf:Local` for `contribution` field.
* Makes field `classification.type` not editable and place it after the value.
* Shows value when a `subtitle` field is added.
* Makes `language` field required and `language.type` readonly.
* Makes `partof` field required when document type is a contribution to journal.
* Makes `organisation` field required.
* Makes `provisionActivity` field required depending on document type, instead of hiding it.
* Closes #230.

Co-Authored-by: Sébastien Délèze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants