Skip to content

Commit

Permalink
Display initial message parsed through route query in grid list compo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
guerler committed Dec 7, 2023
1 parent b4cc8ce commit 35bcefa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
13 changes: 13 additions & 0 deletions client/src/components/Grid/GridList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -164,6 +176,7 @@ function onFilter(filter?: string) {
onMounted(() => {
getGridData();
eventBus.on(onRouterPush);
displayInitialMessage();
});
onUnmounted(() => {
Expand Down
15 changes: 9 additions & 6 deletions client/src/entry/analysis/routes/admin-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ export default [
{
path: "groups",
component: GridList,
props: {
props: (route) => ({
gridConfig: adminGroupsGridConfig,
},
gridMessage: route.query.message,
}),
},
{
path: "quotas",
Expand All @@ -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",
Expand Down

0 comments on commit 35bcefa

Please sign in to comment.