Skip to content

[New Instrument Name] reassign umil_label after instrument name is (soft) deleted #350

@mailynmailyn

Description

@mailynmailyn

feat: assignment, unassignment and reassignment of umil_label

umil_label defines what is displayed as the main instrument name title on the instrument detail page.
[picture]
For example, in English, we know that "trumpet" is the main label of a trumpet, but there also exists names such as "natural trumpet" and "slide trumpet" (alias).

The use of umil_label is still important to determine what name on UMIL is the main label of an instrument (whether it aligns with Wikidata or not). It's assignment is made more complicated with the possibility of deletion.

RULES

  1. A name can only have umil_label = True when:
    • verification_status = "verified"
    • deleted = "false"
  2. There can only be one name where umil_label = true per instrument in a language.
  3. There should only be no umil_label for an instrument in a language when there are no verified names for that instrument in that language.
  4. If an instrument name umil_label is deleted, umil_label should be assigned to the next earliest added verified, non-deleted instrument name in that language.

CASES

FRONTEND ACTIONS

Action umil_label Verified? deleted Behavior
Delete Name True True SET to False - This is seemingly an impossible case, however this will only happen when a contributor has deleted the umil_label name from the frontend.
- If there is a replacement umil_label option, reassign.
- Otherwise, no replacement will be assigned, meaning there are no verified, non-deleted names available for umil_label.
Add Name False False False - Interpreted as umil_label SET TO False
- See Backend Add Name

BACKEND ACTIONS

Action umil_label Verified? deleted Behavior
Set umil_label=true True True False - Reassign umil_label to the current name
- Set umil_label=false for all other names for instrument language
Add Name False False False - Interpreted as umil_label SET TO False
- See Backend Set umil_label=true: [choose appropriate state]
Set umil_label=false: with existing (other) umil_label False - set umil_label = false
Set umil_label=false: with replacement umil_label False - set umi_label=true for the replacement name
Set umil_label=false: with no other verified, non-deleted names False True False - This name is the only verified name for the instrument language, and will appear as it is not deleted. It MUST be assigned as the umil_label
Set umil_label=false: with no other verified, non-deleted names False False - There are no available verified names to be assigned umil_label. Indicate that there is No verified name in [language]
Delete Name True True True - Constraint will prevent backend user from saving this state. umil_label must be set to false
UNVerify True False False - Constraint will prevent backend user from saving this state. umil_label must be set to false

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions