Identifiers: a kind you already have cannot be chosen again #307

Closed
opened 2026-09-29 11:26:39 +00:00 by tiagoagueda · 0 comments
Owner

From the interface review of 2026-09-29: identifiers are unique, so when a new identifier is added, a kind already recorded is disabled in the choice. The kind is chosen in Basecoat's select with its icon (#301), and Remove becomes an icon that asks for confirmation in a dialog (#303).

What is there today

  • The database already holds the rule. accounts.PersonIdentifier has one_identifier_per_scheme_per_person, one identifier per scheme per person, Other excepted, and jobs.CompanyIdentifier has one_identifier_per_scheme_per_company. A second ORCID is refused when the form is saved, with an error on the row.
  • The rows on Your details and on a company's form (cotton/identifier_row.html) offer every scheme on every row, including the ones already taken.

What to do

  • On the empty row, disable the schemes this person or company already has. <option disabled> works without a script and is announced as unavailable.
  • On a filled row, disable the schemes the other rows hold, so a row can still keep its own.
  • Other is never disabled.
  • The server keeps refusing duplicates, because two new rows typed in one go can pick the same scheme before either is saved.

Done when

  • Tests: the empty row's select has the used schemes disabled; a filled row's own scheme is not disabled; two new rows with the same scheme still fail, with a message. Both Your details and a company's form are covered.
From the interface review of 2026-09-29: identifiers are unique, so when a new identifier is added, a kind already recorded is disabled in the choice. The kind is chosen in Basecoat's select with its icon (#301), and *Remove* becomes an icon that asks for confirmation in a dialog (#303). ## What is there today - The database already holds the rule. `accounts.PersonIdentifier` has `one_identifier_per_scheme_per_person`, one identifier per scheme per person, *Other* excepted, and `jobs.CompanyIdentifier` has `one_identifier_per_scheme_per_company`. A second ORCID is refused when the form is saved, with an error on the row. - The rows on *Your details* and on a company's form (`cotton/identifier_row.html`) offer every scheme on every row, including the ones already taken. ## What to do - On the empty row, disable the schemes this person or company already has. `<option disabled>` works without a script and is announced as unavailable. - On a filled row, disable the schemes the *other* rows hold, so a row can still keep its own. - *Other* is never disabled. - The server keeps refusing duplicates, because two new rows typed in one go can pick the same scheme before either is saved. ## Done when - Tests: the empty row's select has the used schemes disabled; a filled row's own scheme is not disabled; two new rows with the same scheme still fail, with a message. Both *Your details* and a company's form are covered.
tiagoagueda added this to the 0.5.0 milestone 2026-09-29 11:26:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#307
No description provided.