From 35bcefadc62e281f3ee68e2327fee75a573abd19 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 7 Dec 2023 13:37:41 +0300 Subject: [PATCH] Display initial message parsed through route query in grid list component --- client/src/components/Grid/GridList.vue | 13 +++++++++++++ client/src/entry/analysis/routes/admin-routes.js | 15 +++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/client/src/components/Grid/GridList.vue b/client/src/components/Grid/GridList.vue index 357b728ca65b..c5de3f921608 100644 --- a/client/src/components/Grid/GridList.vue +++ b/client/src/components/Grid/GridList.vue @@ -27,6 +27,8 @@ library.add(faCaretDown, faCaretUp, faShieldAlt); interface Props { // provide a grid configuration gridConfig: GridConfig; + // incoming initial message + gridMessage?: string; // debounce delay delay?: number; // rows per page to be shown @@ -81,6 +83,16 @@ function applyFilter(filter: string, value: string | boolean, quoted = false) { } } +/** + * Display initial message parsed through route query + */ +function displayInitialMessage() { + if (props.gridMessage) { + operationMessage.value = props.gridMessage; + operationStatus.value = "success"; + } +} + /** * Request grid data */ @@ -164,6 +176,7 @@ function onFilter(filter?: string) { onMounted(() => { getGridData(); eventBus.on(onRouterPush); + displayInitialMessage(); }); onUnmounted(() => { diff --git a/client/src/entry/analysis/routes/admin-routes.js b/client/src/entry/analysis/routes/admin-routes.js index ac96c2ef4965..ad2e3437f9ca 100644 --- a/client/src/entry/analysis/routes/admin-routes.js +++ b/client/src/entry/analysis/routes/admin-routes.js @@ -137,9 +137,10 @@ export default [ { path: "groups", component: GridList, - props: { + props: (route) => ({ gridConfig: adminGroupsGridConfig, - }, + gridMessage: route.query.message, + }), }, { path: "quotas", @@ -151,16 +152,18 @@ export default [ { path: "roles", component: GridList, - props: { + props: (route) => ({ gridConfig: adminRolesGridConfig, - }, + gridMessage: route.query.message, + }), }, { path: "users", component: GridList, - props: { + props: (route) => ({ gridConfig: adminUsersGridConfig, - }, + gridMessage: route.query.message, + }), }, { path: "tool_versions",