Unverified Commit 86939344 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #20703 from ahmedhamidawan/fix_all_pages_by_user_link

[25.0] Add username filter to published pages grid
parents 7769f637 b002f326
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -18,10 +18,12 @@ library.add(faPlus);

interface Props {
    activeList?: "my" | "shared" | "published";
    username?: string;
}

withDefaults(defineProps<Props>(), {
const props = withDefaults(defineProps<Props>(), {
    activeList: "my",
    username: undefined,
});
</script>

@@ -59,6 +61,6 @@ withDefaults(defineProps<Props>(), {
        </BNav>
        <GridList v-if="activeList === 'my'" :grid-config="visualizationsGridConfig" embedded />
        <GridList v-else-if="activeList === 'shared'" :grid-config="visualizationsSharedGridConfig" embedded />
        <GridList v-else :grid-config="visualizationsPublishedGridConfig" embedded />
        <GridList v-else :grid-config="visualizationsPublishedGridConfig" embedded :username-search="props.username" />
    </div>
</template>
+4 −1
Original line number Diff line number Diff line
@@ -88,7 +88,10 @@ const fields: FieldArray = [
    {
        key: "username",
        title: "Username",
        type: "text",
        type: "link",
        handler: (data: HistoryEntry) => {
            emit(`/histories/list_published?f-username=${data.username}`);
        },
    },
];

+5 −1
Original line number Diff line number Diff line
@@ -87,7 +87,10 @@ const fields: FieldArray = [
    {
        key: "username",
        title: "Owner",
        type: "text",
        type: "link",
        handler: (data: PageEntry) => {
            emit(`/pages/list_published?f-username=${data.username}`);
        },
    },
];

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

/**
+5 −1
Original line number Diff line number Diff line
@@ -76,7 +76,10 @@ const fields: FieldArray = [
    {
        key: "username",
        title: "Owner",
        type: "text",
        type: "link",
        handler: (data: VisualizationEntry) => {
            emit(`/visualizations/list_published?f-username=${data.username}`);
        },
    },
    {
        key: "tags",
@@ -103,6 +106,7 @@ const validFilters: Record<string, ValidFilter<string | boolean | undefined>> =
        handler: contains("tag", "tag", expandNameTag),
        menuItem: true,
    },
    user: { placeholder: "user", type: String, handler: contains("username"), menuItem: true },
};

/**
+3 −2
Original line number Diff line number Diff line
@@ -662,9 +662,10 @@ export function getRouter(Galaxy) {
                    {
                        path: "visualizations/list_published",
                        component: GridVisualization,
                        props: {
                        props: (route) => ({
                            activeList: "published",
                        },
                            username: route.query["f-username"],
                        }),
                    },
                    {
                        path: "visualizations/list_shared",