Appearance
Merge entities
How people fold a duplicate record into the one that remains.
bulkoperations-mergemodal--defaultOpen in Storybook ↗When it applies
- Two selected records in a list whose entity type offers Merge in its selection action bar.
- The action is configured to need exactly two records of the same type. Otherwise it stays disabled and its tooltip says why: Select exactly 2 items to use this action. or The selected items are of a different type and cannot be merged.
- Not for changing many records: see bulk edit.
How it works
- First choose the record that remains. Everything else follows from it. Under Which record should remain? each record is a radio button with its title; the first selected record is chosen by default. The other record is deleted after the merge.
- A suggestion can point at the right record. Picking the wrong survivor can bring the duplicate back on the next import. When the entity type configures a survivor suggestion, each record gets a hint: Recommended in green, or a neutral reason such as Identifier should be OST-1950-014. The configuration can also select the recommended record by itself, and can require it: choosing the other record then disables Merge and says why under the button.
- Only fields that differ are shown. Equal values need no decision. The table lists the editable fields of the surviving record whose values differ between the two; two empty values count as equal. The
idfield and relation fields are not in the table. When nothing differs it reads These records have no differing values. - Each row keeps one value. The table has a column per record, the survivor on the left, and a radio button on each value. The survivor's value is chosen until another is picked. Each column header links to that record's detail page in a new tab. Choosing another survivor swaps the columns and resets every choice, so no pick silently flips sides.
- Fields that identify a record are locked. Two different identities cannot become one. When both records carry a different identity in such a field, its row is shaded, its radio buttons are disabled and a lock explains: This field cannot be changed, so the surviving record keeps its own value.
- Relations are carried over, not chosen. Nothing links to a deleted record. The merge moves the other record's relations to the survivor, and points records that link to the deleted one at the survivor. When there are such records, a line counts them: 3 linked record(s) will be moved to the surviving record.
- The loss is stated before the button. The modal ends with The other record will be permanently deleted. in the danger colour, right above Merge and Cancel; there is no extra confirm dialog.
- The result lands on the survivor. While the merge runs, a spinner and Merging the records, this may take a while... block the modal. On success Records merged shows, the modal closes, the selection is cleared and the surviving record's detail page opens. On failure Merge failed shows and the modal stays open.
bulkoperations-mergemodal--values-chosenOpen in Storybook ↗Above: the survivor's title and creator replaced by the other record's.
bulkoperations-mergemodal--recommendedOpen in Storybook ↗Above: a suggestion selected the recommended record; the inventory number is locked.
bulkoperations-mergemodal--blockedOpen in Storybook ↗Above: the other record chosen while the recommended one is required.
States
| State | What you see | Trigger |
|---|---|---|
| Loading | the title and a spinner | both records are fetched |
| Ready | survivor choice, the table of differences, the notes and the buttons | records loaded |
| No differences | These records have no differing values. instead of the table | all compared values are equal |
| Blocked | Merge disabled, the reason under it in the danger colour | a required recommendation is not chosen |
| Merging | spinner and message over the modal | Merge pressed |
If the records cannot be loaded, the modal closes with Merge failed.
Components
| Component | Role in this pattern |
|---|---|
| Selection action bar | holds Merge and its disabled reason |
| Modal | the wide modal around the choice and the table |
| History diff | the same two-column comparison idea, for versions of one record |
| Tooltip | explains the lock on a locked field |
| Button | Merge (commit) and Cancel (secondary) |
| Feedback | the blocking overlay and the result notifications |
Keyboard & accessibility
| Key | Effect |
|---|---|
| Tab | moves to the survivor choice, each row's choice, the record links and the buttons |
| Arrow keys | change the chosen record, or the chosen value within a row |
| Escape | closes the modal; nothing is merged |
- The survivor choice is a
fieldsetwhose legend is Which record should remain?. - Every choice is a native radio button with its value as its label.
- The blocking overlay is a
role="alert"region, so its message is announced.
Content
- Title Merge records; intro Choose which value to keep for each field. Fields with the same value are not shown.
- An empty value reads (empty).
- Translation keys:
bulk-operations.merge-modal.*,notifications.success.merge-entities.*,notifications.errors.merge-entities.*,modals.mergingEntities,tooltip.bulkOperations.*.
Related
Selection action bar · Bulk edit · History diff · Modal · Feedback