geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
422 stars 489 forks source link

suggestions to extend the editor-config xsd/functionality #1405

Open pvgenuchten opened 8 years ago

pvgenuchten commented 8 years ago

On the section level, can we add (or is it already possible) to introduce an attribute collapsed="(expr)", so this section is collapsed if a certain expresion evaluates to false.

Does it make sense to add a required=true/false on field level, so a cross is displayed independent if the field is required in the xsd.

I noticed some javascript warnings like "email not in proper format" are only logged to console, but i would expect it would result in a notification and a cancelation of the save action (same for non filled fields that are required).

Is it possible to set or introduce a mechanism so it is configurable that certain form fields are always shown, even when they are not available in the xml?

josegar74 commented 8 years ago

About the collapsed attribute sounds good to me.

About the cross available even if required in xsd, I don't see the case for this. This can produce invalid xml. Can you be more explicit about this requirement?

For the validation, would be good to use an inline validation, displaying the messages next to the fields. Something similar to jQuery validator. I guess AngularJS should allow similar stuff.

Delawen commented 8 years ago

On the section level, can we add (or is it already possible) to introduce an attribute collapsed="(expr)", so this section is collapsed if a certain expresion evaluates to false.

I like it.Where expression is an xpath expression, right?

Does it make sense to add a required=true/false on field level, so a cross is displayed independent if the field is required in the xsd.

The validation will be done against the XSD. So I am not sure why you want to separate it, unless you want to run two validations: one on the xsd and another based on the editor config. I don't like that idea... The XSD should show what you want to be optional and what you want to be mandatory.

I noticed some javascript warnings like "email not in proper format" are only logged to console, but i would expect it would result in a notification and a cancelation of the save action (same for non filled fields that are required).

Sure, it should be blocking the saving.

Is it possible to set or introduce a mechanism so it is configurable that certain form fields are always shown, even when they are not available in the xml?

With update-fixed-info we can add them even if they are empty. If it is shown on the editor, even if it is empty, it will be saved on the xml. Or you want that they are not in the xml but on the editor? Wouldn't that be confusing?

pvgenuchten commented 8 years ago

Does it make sense to add a required=true/false on field level, so a cross is displayed independent if the field is required in the xsd.

This relates to schematron validation, seems that when a field is required by schematron only, no cross is added, to add it using the form-config would be a workaround.

Is it possible to set or introduce a mechanism so it is configurable that certain form fields are always shown, even when they are not available in the xml? With update-fixed-info we can add them even if they are empty. If it is shown on the editor, even if it is empty, it will be saved on the xml.

Indeed we can add them in update-fixed-info, but that would be too late, it means the field is added, after the form is saved. I would want to have them at opening of the form

fxprunayre commented 8 years ago

On the section level, can we add (or is it already possible) to introduce an attribute collapsed="(expr)", so this section is collapsed if a certain expresion evaluates to false.

Related question:

Does it make sense to add a required=true/false on field level, so a cross is displayed independent if the field is required in the xsd.

I don't think we should go that way and mixing validation results. You could use CSS to highlight some fields or use text input to warn user that this field is really important.

At some point, we should maybe try to consolidate all levels of validation (XSD, SCH and form validation).

Other example: https://github.com/geonetwork/doc/blob/develop/en/customizing-application/editor-ui/img/example-metawal.png

I noticed some javascript warnings like "email not in proper format"

This is related to input with email type. Not sure if the logging is made by Angular.

Is it possible to set or introduce a mechanism so it is configurable that certain form fields are always shown, even when they are not available in the xml?

No but you could at least add button to easily add element if they are not in the record. See https://github.com/geonetwork/core-geonetwork/issues/1329

pvgenuchten commented 8 years ago

@fxprunayre thanx for the input

about storing state of the panel, a form of that is what i want to achieve with the xpath expression, the inspire panel would be collapsed if a user has indicated the resource is evaluated against the inspire conformance.

starring of elements as mandatory has additional benefits, such as, the remove button is hidden, javascript could check if the element is filled before submitting etc. How do you apply css on a certain field to stress it's importance? For me this could be the point in time to: "consolidate all levels of validation (XSD, SCH and form validation)". Please share your ideas on how to manage it.

I like the suggestions in #1329

fxprunayre commented 8 years ago

How do you apply css on a certain field to stress

Probably not all perfect but could help in some situation, examples:

form.gn-tab-characteristics {
form.gn-tab-overview {
  fieldset:nth-of-type(1) > legend.descriptiveKeywords::after {
    content: "*";
  }
}
form.gn-tab-timeCoverage div[data-tooltip='iso19139|gmd:resolution||/gmd:MD_Metadata/gmd:spatialRepresentationInfo/gmd:MD_Georectified/gmd:axisDimensionProperties/gmd:MD_Dimension/gmd:resolution']