-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Feature catalogue / Add table of content of feature types #8041
Conversation
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.
Tested locally and seems to work fine. The only thing that is confusing for users now is that when starting with an empty set of featureTypes, the dropdown is populated with an empty string when adding a featureType. This occurs as well when adding more afterwards (below are three featureTypes, the third one is empty and displayed as a collapsed).
d250d68
to
6331bfb
Compare
6331bfb
to
e6eac01
Compare
Quality Gate failedFailed conditions |
Quality Gate failedFailed conditions |
Retested latest changes - still working fine on my end! @fxprunayre |
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to #7998 (ie. timeout, number of form fields). To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <!--tabs|pills|dropdown--> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl` and `evaluate.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * Dropdown (default) * Tabs * Pills * Avoid JS error on large forms by using JQuery `empty()` instead of find and remove: ``` RangeError: Maximum call stack size exceeded at Sizzle.select (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2592:12) at Function.Sizzle [as find] (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:869:9) at jQuery.fn.init.find (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2792:11) at refreshForm (EditorService.js:324:42) ``` * ISO19110 to ISO19115-3 conversion / Convert cardinality to CharacterString
209a4f9
to
3af8717
Compare
Quality Gate failedFailed conditions |
Some comments:
<views>
<view name="default" default="true"
class="gn-label-above-input gn-indent-bluescale">
...
<tab id="default" default="true" mode="flat">
<section name="gfc:featureType">
<select name="Select a feature type"
xpath="/gfc:FC_FeatureCatalogue/gfc:featureType"
parameter="featureType"
value="*/gfc:typeName/gco:LocalName/text()"
layout="dropdown"/>
<!--tabs|pills|dropdown-->
<section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[
*/gfc:typeName/gco:LocalName = $p2/featureType
or (not($p2/featureType) and position() = 1)
or ($p3 = 'md.format.html')]"
or="featureType"
in="/gfc:FC_FeatureCatalogue"/>
</section>
</tab>
...
I think this is not related to the pull request, but more to the backend. Not very ready to manage huge metadata records.
|
No need to customize the editor, the default editor will display the selector and allows to switch from one table to another. |
Quality Gate failedFailed conditions |
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.
With the metadata provided, it works, but it is really slow. Loading the form / selecting a feature type or saving it, takes about 35 seconds on my computer.
I don't know if it's a problem with my computer or it's just that slow, but I guess without the changes it would be worse.
Yes on some cases we are producing huge forms and at some point it can be slow or fails to save (eg. #7998). So it is not your computer! |
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields)
A good example https://metadata.vlaanderen.be/srv/dut/catalog.search#/metadata/8d457643-38ce-4df7-8dd2-414902862a0e
The problem is quite similar to #7998 (ie. timeout, number of form fields).
To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time.
Configuration
This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default.
A selector could also be manually configured using the following:
$p2
correspond to the variablerequest
and$p3
to theservice
in the XSL template (seebase-variables.xsl
andevaluate.xsl
). So if there is nofeatureType
parameter, the first feature type will be displayed. If the view mode ismd.format.html
, all feature types will be displayed.It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity
Layout
Other changes
empty()
instead of find and remove:Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentationFunded by Vlaanderen