-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingtaska task that a dev team member needs to addressa task that a dev team member needs to address
Description
Describe the bug
When editing a Metadata Record's "Assets Used" field- a Metadata Record field which can point to other Metadata Records to indicate that one data asset uses another one(s)- currently,
- a Metadata Record can point to itself, but this should not be allowed (see "Data sets used" exclusion needed #205. It seems like this regressed at some point?)
- a Metadata Record can have multiple "assets used" which point to the same other metadata record, but this is not meaningful, and probably should not be allowed. This is similar to Prevent tagging the same series multiple times to a single MR #549, and perhaps a similar solution can be used.
(see screenshot below)
To reproduce
Steps to reproduce the behaviour:
- Go to a Metadata Record's edit page, like https://dev.cat.data.fin.gov.bc.ca/node/27/build
- Find the "Assets Used" field (currenlty under the "Section 3: Origin and classification" section)
- In an input box for a new "asset used" entry, type the name of the Metadata Record being edited and observe that it shows up and can be selected. Select it.
- Add two more "assets used", both referring to the same other Metadata Record. Observe that the action is allowed (despite duplicate "assets used" not being meaningful).
- Save the changes and observe that there are neither automatic removals of the self-reference or duplicate references, nor validation warnings.
Expected behaviour
I think it would be beneficial to user experience if we don't show self-references and duplicate references in the autocomplete UI that shows up once the user starts typing in the field.
On top of that, I think it would be beneficial to either
- Not show self-references and duplicate references in the autocomplete UI that shows up once the user starts typing in the field, and automatically remove self-references or duplicate references as an automatic pre-step of the change-saving process
- Or raise a validation warning/error if the user tries to save changes with a self-reference or duplicate reference.
(I think automatic removal is preferable in this case)
Screenshots

Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtaska task that a dev team member needs to addressa task that a dev team member needs to address