Skip to content

Commit 8693934

Browse files
authored
Merge pull request #20703 from ahmedhamidawan/fix_all_pages_by_user_link
[25.0] Add username filter to published pages grid
2 parents 7769f63 + b002f32 commit 8693934

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

client/src/components/Grid/GridVisualization.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ library.add(faPlus);
1818
1919
interface Props {
2020
activeList?: "my" | "shared" | "published";
21+
username?: string;
2122
}
2223
23-
withDefaults(defineProps<Props>(), {
24+
const props = withDefaults(defineProps<Props>(), {
2425
activeList: "my",
26+
username: undefined,
2527
});
2628
</script>
2729

@@ -59,6 +61,6 @@ withDefaults(defineProps<Props>(), {
5961
</BNav>
6062
<GridList v-if="activeList === 'my'" :grid-config="visualizationsGridConfig" embedded />
6163
<GridList v-else-if="activeList === 'shared'" :grid-config="visualizationsSharedGridConfig" embedded />
62-
<GridList v-else :grid-config="visualizationsPublishedGridConfig" embedded />
64+
<GridList v-else :grid-config="visualizationsPublishedGridConfig" embedded :username-search="props.username" />
6365
</div>
6466
</template>

client/src/components/Grid/configs/historiesPublished.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ const fields: FieldArray = [
8888
{
8989
key: "username",
9090
title: "Username",
91-
type: "text",
91+
type: "link",
92+
handler: (data: HistoryEntry) => {
93+
emit(`/histories/list_published?f-username=${data.username}`);
94+
},
9295
},
9396
];
9497

client/src/components/Grid/configs/pagesPublished.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ const fields: FieldArray = [
8787
{
8888
key: "username",
8989
title: "Owner",
90-
type: "text",
90+
type: "link",
91+
handler: (data: PageEntry) => {
92+
emit(`/pages/list_published?f-username=${data.username}`);
93+
},
9194
},
9295
];
9396

@@ -97,6 +100,7 @@ const fields: FieldArray = [
97100
const validFilters: Record<string, ValidFilter<string | boolean | undefined>> = {
98101
title: { placeholder: "title", type: String, handler: contains("title"), menuItem: true },
99102
slug: { handler: contains("slug"), menuItem: false },
103+
user: { placeholder: "user", type: String, handler: contains("username"), menuItem: true },
100104
};
101105

102106
/**

client/src/components/Grid/configs/visualizationsPublished.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ const fields: FieldArray = [
7676
{
7777
key: "username",
7878
title: "Owner",
79-
type: "text",
79+
type: "link",
80+
handler: (data: VisualizationEntry) => {
81+
emit(`/visualizations/list_published?f-username=${data.username}`);
82+
},
8083
},
8184
{
8285
key: "tags",
@@ -103,6 +106,7 @@ const validFilters: Record<string, ValidFilter<string | boolean | undefined>> =
103106
handler: contains("tag", "tag", expandNameTag),
104107
menuItem: true,
105108
},
109+
user: { placeholder: "user", type: String, handler: contains("username"), menuItem: true },
106110
};
107111

108112
/**

client/src/entry/analysis/router.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,10 @@ export function getRouter(Galaxy) {
662662
{
663663
path: "visualizations/list_published",
664664
component: GridVisualization,
665-
props: {
665+
props: (route) => ({
666666
activeList: "published",
667-
},
667+
username: route.query["f-username"],
668+
}),
668669
},
669670
{
670671
path: "visualizations/list_shared",

0 commit comments

Comments
 (0)