Commit 3b50f046 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

feat: 1302 allow to see custom button on snackbar

parent 9f64813f
......@@ -14150,9 +14150,9 @@
}
},
"solidify-frontend": {
"version": "0.4.13",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-0.4.13.tgz",
"integrity": "sha512-kzG7Iap2oKo7awI/OadiQWsGTQezmosl1tG5eJ1mDXpNSVkvoDMjeb4UxkeobWzsBswDdLvr7ECjC7/m1OKlcw=="
"version": "0.5.0",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-0.5.0.tgz",
"integrity": "sha512-bXYs+EM7p2hJzl4BJ5YFCp93av8gZUE1JVZBKYROI8v+m1L5D4HC9MnA8ode48hF4KSzFYmnV8I7JnL4vIETeA=="
},
"sort-keys": {
"version": "1.1.2",
......
......@@ -21,6 +21,14 @@
</ng-template>
</span>
</div>
<button *ngIf="data.action"
mat-button
(click)="actionButton($event)"
>
{{data.action.text | translate}}
</button>
<button mat-icon-button
matSuffix
(click)="close($event)"
......
......@@ -59,6 +59,11 @@ export class SharedSnackbarPresentational extends AbstractSnackbarPresentational
close($event: MouseEvent): void {
this._ngZone.run(() => this.snackbarRef.dismiss());
}
actionButton($event: MouseEvent): void {
this.close($event);
this.data?.action.callback();
}
}
export interface SharedSnackbarOption extends SnackbarData {
......
......@@ -373,10 +373,14 @@ export class AppState extends BasicState<AppStateModel> {
if (!isNullOrUndefined(order) && (order.status === Order.StatusEnum.READY || order.status === Order.StatusEnum.INERROR)) {
SessionStorageHelper.removeItemInList(SessionStorageEnum.orderPending, orderId);
SessionStorageHelper.addItemInList(SessionStorageEnum.newOrderAvailable, orderId);
const actionNotification = {
text: TRANSLATE("app.notification.action.see"),
callback: () => this.store.dispatch(new Navigate([RoutesEnum.orderMyOrderDetail, orderId])),
};
if (order.status === Order.StatusEnum.READY) {
this.notificationService.showSuccess(TRANSLATE("app.notification.order.ready"));
this.notificationService.showSuccess(TRANSLATE("app.notification.order.ready"), undefined, actionNotification);
} else {
this.notificationService.showError(TRANSLATE("app.notification.order.inError"));
this.notificationService.showError(TRANSLATE("app.notification.order.inError"), undefined, actionNotification);
}
} else {
ctx.dispatch(new AppCartOrderAction.AddInListById(orderId, true, true));
......@@ -414,7 +418,11 @@ export class AppState extends BasicState<AppStateModel> {
}
});
if (counterNewNotification > 0) {
this.notificationService.showSuccess(TRANSLATE("app.notification.notificationInbox.newIncoming"), {"number": counterNewNotification});
const actionNotification = {
text: TRANSLATE("app.notification.action.see"),
callback: () => this.store.dispatch(new Navigate([RoutesEnum.preservationSpaceNotificationInbox])),
};
this.notificationService.showSuccess(TRANSLATE("app.notification.notificationInbox.newIncoming"), {"number": counterNewNotification}, actionNotification);
}
SessionStorageHelper.initItemInList(SessionStorageEnum.notificationInboxPending, listNewNotificationInboxPending);
}),
......
......@@ -163,9 +163,6 @@
}
}
},
"home": {
"title": "Administration"
},
"institution": {
"button": {
"new": "Create new institution",
......@@ -963,6 +960,9 @@
"title": "The requested resource does not exist or no longer exists..."
},
"notification": {
"action": {
"see": "See"
},
"checksumCopy": "Checksum value copied to clipboard",
"extraInfoCopyToClipboard": "Value copied to clipboard",
"idCopyToClipboard": "ID copied to clipboard",
......@@ -1138,7 +1138,6 @@
"edit": "Edit",
"root": "Roles"
},
"root": "Admin",
"submissionPolicy": {
"create": "Create",
"edit": "Edit",
......@@ -1158,8 +1157,7 @@
},
"deposit": {
"create": "Create",
"edit": "Edit",
"root": "Deposits"
"edit": "Edit"
},
"home": "Home",
"myOrder": {
......@@ -1178,16 +1176,12 @@
},
"myOrder": {
"edit": "Edit"
},
"root": "Orders"
}
},
"organizationalUnit": {
"edit": "Edit",
"root": "Organizational Units"
},
"preservation-space": {
"root": "Preservation Space"
},
"preservation": {
"aip-downloaded": {
"root": "Aip downloaded"
......@@ -1219,7 +1213,6 @@
"monitoring": {
"root": "Monitoring"
},
"root": "Preservation",
"sip": {
"file": "Data files",
"metadata": "Metadata",
......@@ -1512,7 +1505,7 @@
"success": "The deposit may now be modified"
},
"download": {
"fail": "Something went wrong during the visualization process, the file can't be read"
"fail": "Something went wrong during the visualization process, the file can't be open"
},
"reject": {
"fail": "There was an error when rejecting the deposit",
......@@ -1942,7 +1935,7 @@
"status": "Status"
},
"home": {
"subtitle": "All orders requests",
"subtitle": " ",
"title": "All orders"
},
"notification": {
......@@ -1984,9 +1977,6 @@
"submitted": "Submitted"
}
},
"home": {
"title": "Orders"
},
"myOrder": {
"accessLevel": "Access level",
"back": "Back",
......@@ -2186,9 +2176,6 @@
}
}
},
"home": {
"title": "Preservation"
},
"job": {
"button": {
"back": "Back",
......@@ -2438,28 +2425,23 @@
"title": "Title"
}
}
},
"space": {
"home": {
"title": "Preservation Space"
}
}
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributor"
},
"button": {
"refresh": "Refresh"
},
"deposit": {
"title": "Associated deposits"
},
"form": {
"person": {
"navigateLinkPlaceholder": "See person detail"
}
},
"deposit": {
"title": "Associated deposits"
"home": {
"title": "Contributor"
}
},
"notificationInbox": {
......@@ -2649,4 +2631,4 @@
}
}
}
}
}
\ No newline at end of file
......@@ -163,9 +163,6 @@
}
}
},
"home": {
"title": "Administration"
},
"institution": {
"button": {
"new": "Create new institution",
......@@ -963,6 +960,9 @@
"title": "The requested resource does not exist or no longer exists..."
},
"notification": {
"action": {
"see": "See"
},
"checksumCopy": "Checksum value copied to clipboard",
"extraInfoCopyToClipboard": "Value copied to clipboard",
"idCopyToClipboard": "ID copied to clipboard",
......@@ -1138,7 +1138,6 @@
"edit": "Edit",
"root": "Roles"
},
"root": "Admin",
"submissionPolicy": {
"create": "Create",
"edit": "Edit",
......@@ -1158,8 +1157,7 @@
},
"deposit": {
"create": "Create",
"edit": "Edit",
"root": "Deposits"
"edit": "Edit"
},
"home": "Home",
"myOrder": {
......@@ -1178,16 +1176,12 @@
},
"myOrder": {
"edit": "Edit"
},
"root": "Orders"
}
},
"organizationalUnit": {
"edit": "Edit",
"root": "Organizational Units"
},
"preservation-space": {
"root": "Preservation Space"
},
"preservation": {
"aip-downloaded": {
"root": "Aip downloaded"
......@@ -1219,7 +1213,6 @@
"monitoring": {
"root": "Monitoring"
},
"root": "Preservation",
"sip": {
"file": "Data files",
"metadata": "Metadata",
......@@ -1984,10 +1977,6 @@
"submitted": "Submitted"
}
},
"home": {
"title": "Orders",
"subtitle": "All order requests"
},
"myOrder": {
"accessLevel": "Access level",
"back": "Back",
......@@ -2187,9 +2176,6 @@
}
}
},
"home": {
"title": "Preservation"
},
"job": {
"button": {
"back": "Back",
......@@ -2439,28 +2425,23 @@
"title": "Title"
}
}
},
"space": {
"home": {
"title": "Preservation Space"
}
}
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributor"
},
"button": {
"refresh": "Refresh"
},
"deposit": {
"title": "Associated deposits"
},
"form": {
"person": {
"navigateLinkPlaceholder": "See person detail"
}
},
"deposit": {
"title": "Associated deposits"
"home": {
"title": "Contributor"
}
},
"notificationInbox": {
......@@ -2650,4 +2631,4 @@
}
}
}
}
}
\ No newline at end of file
......@@ -163,9 +163,6 @@
}
}
},
"home": {
"title": "Administration"
},
"institution": {
"button": {
"new": "Nouvelle institution",
......@@ -963,6 +960,9 @@
"title": "La resource demandée n'existe pas ou plus..."
},
"notification": {
"action": {
"see": "Voir"
},
"checksumCopy": "Valeur du checksum copié dans le presse-papiers",
"extraInfoCopyToClipboard": "Valeur copié dans le presse-papiers",
"idCopyToClipboard": "Identifiant copié dans le presse-papiers",
......@@ -1138,7 +1138,6 @@
"edit": "Modifier",
"root": "Rôles"
},
"root": "Administration",
"submissionPolicy": {
"create": "Créer",
"edit": "Modifier",
......@@ -1158,8 +1157,7 @@
},
"deposit": {
"create": "Créer",
"edit": "Modifier",
"root": "Dépôts"
"edit": "Modifier"
},
"home": "Accueil",
"myOrder": {
......@@ -1178,16 +1176,12 @@
},
"myOrder": {
"edit": "Modifier"
},
"root": "Demandes"
}
},
"organizationalUnit": {
"edit": "Modifier",
"root": "Unités organisationnelles"
},
"preservation-space": {
"root": "Espace de préservation"
},
"preservation": {
"aip-downloaded": {
"root": "Aip téléchargé"
......@@ -1219,7 +1213,6 @@
"monitoring": {
"root": "Surveillance"
},
"root": "Préservation",
"sip": {
"file": "Fichiers",
"metadata": "Métadonnées",
......@@ -1984,9 +1977,6 @@
"submitted": "Soumis"
}
},
"home": {
"title": "Demandes"
},
"myOrder": {
"accessLevel": "Niveau d'accès",
"back": "Retour",
......@@ -2186,9 +2176,6 @@
}
}
},
"home": {
"title": "Préservation"
},
"job": {
"button": {
"back": "Retour",
......@@ -2438,28 +2425,23 @@
"title": "Titre"
}
}
},
"space": {
"home": {
"title": "Espace de préservation"
}
}
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributeur-rice"
},
"button": {
"refresh": "Rafraichir"
},
"deposit": {
"title": "Dépôts associés"
},
"form": {
"person": {
"navigateLinkPlaceholder": "Voir le détail de la personne"
}
},
"deposit": {
"title": "Dépôts associés"
"home": {
"title": "Contributeur-rice"
}
},
"notificationInbox": {
......@@ -2649,4 +2631,4 @@
}
}
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment