Skip to content

Commit 6773ad9

Browse files
93747: Feedback 2022-12-21 - fixing move patch
1 parent d4c3004 commit 6773ad9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-form.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,12 @@ export class DsoEditMetadataForm {
440440
const valuesWithoutRemoved = values.filter((value: DsoEditMetadataValue) => value.change !== DsoEditMetadataChangeType.REMOVE);
441441
const moveOperations = moveAnalyser
442442
.diff(
443-
valuesWithoutRemoved
444-
.map((value: DsoEditMetadataValue) => value.newValue.place),
445443
[...valuesWithoutRemoved]
446444
.sort((a: DsoEditMetadataValue, b: DsoEditMetadataValue) => a.originalValue.place - b.originalValue.place)
447-
.map((value: DsoEditMetadataValue) => value.newValue.place))
445+
.map((value: DsoEditMetadataValue) => value.originalValue.place),
446+
[...valuesWithoutRemoved]
447+
.sort((a: DsoEditMetadataValue, b: DsoEditMetadataValue) => a.newValue.place - b.newValue.place)
448+
.map((value: DsoEditMetadataValue) => value.originalValue.place))
448449
.map((operation: MoveOperation) => new MetadataPatchMoveOperation(field, +operation.from.substr(1), +operation.path.substr(1)).toOperation());
449450
operations.push(...moveOperations);
450451
});

src/assets/i18n/en.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@
18371837

18381838
"item.edit.metadata.reinstate-button": "Undo",
18391839

1840-
"item.edit.metadata.reset-order-button": "Reset value order",
1840+
"item.edit.metadata.reset-order-button": "Undo reorder",
18411841

18421842
"item.edit.metadata.save-button": "Save",
18431843

0 commit comments

Comments
 (0)