Skip to content

Commit

Permalink
Merge branch 'feat/duplicate-item-alert' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Sep 4, 2024
2 parents 5ada0ec + 0cbbfc2 commit 841d0d4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/actionbar/FormActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
}
}

function tryDuplicate() {
showConfirmDialog({
confirmMessage: t("confirmDuplicate"),
t,
onOk: () => {
duplicate();
},
});
}

function tryDelete() {
showConfirmDialog({
confirmMessage: t("confirmRemoveItem"),
Expand Down Expand Up @@ -297,7 +307,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
formIsLoading
}
loading={duplicatingItem}
onClick={duplicate}
onClick={tryDuplicate}
/>
<ActionButton
icon={<DeleteOutlined />}
Expand Down
12 changes: 11 additions & 1 deletion src/actionbar/TreeActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ function TreeActionBar(props: Props) {
searchTreeNameSearch !== undefined &&
searchTreeNameSearch.trim().length > 0;

function tryDuplicate() {
showConfirmDialog({
confirmMessage: t("confirmDuplicate"),
t,
onOk: () => {
duplicate();
},
});
}

function tryDelete() {
showConfirmDialog({
confirmMessage: t("confirmRemove"),
Expand Down Expand Up @@ -231,7 +241,7 @@ function TreeActionBar(props: Props) {
treeIsLoading
}
loading={duplicatingItem}
onClick={duplicate}
onClick={tryDuplicate}
/>
<ActionButton
icon={<DeleteOutlined />}
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ca_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ export default {
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
openInSameWindow: "Obrir en la pestanya actual",
openInNewTab: "Obrir en una nova pestanya",
confirmDuplicate:
"Estàs segur de volguer duplicar els registre/s seleccionats?",
};
1 change: 1 addition & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@ export default {
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
openInSameWindow: "Open in the current tab",
openInNewTab: "Open in a new tab",
confirmDuplicate: "Are you sure you want to duplicate the selected item/s?",
};
2 changes: 2 additions & 0 deletions src/locales/es_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,6 @@ export default {
allRecordsSelected: "Hay {totalRecords} registros seleccionados.",
openInSameWindow: "Abrir en la pestaña actual",
openInNewTab: "Abrir en una nueva pestaña",
confirmDuplicate:
"Estás seguro de querer duplicar el registro/s seleccionado/s?",
};

0 comments on commit 841d0d4

Please sign in to comment.