fix: use slug in options (#7523)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
This commit is contained in:
Udit Takkar
2023-03-06 10:47:57 +00:00
committed by GitHub
parent c2668acd33
commit c8956680ad
5 changed files with 16 additions and 3 deletions
+6 -1
View File
@@ -637,7 +637,12 @@ const CTA = () => {
const profileOptions = query.data.profiles
.filter((profile) => !profile.readOnly)
.map((profile) => {
return { teamId: profile.teamId, label: profile.name || profile.slug, image: profile.image };
return {
teamId: profile.teamId,
label: profile.name || profile.slug,
image: profile.image,
slug: profile.slug,
};
});
return (
@@ -38,6 +38,7 @@ export default function EmptyScreen(props: {
label: string | null;
image?: string | null;
teamId: number | null | undefined;
slug: string | null;
}[];
isFilteredView: boolean;
}) {
@@ -46,6 +46,7 @@ interface Props {
image?: string | null;
label: string | null;
teamId: number | null | undefined;
slug: string | null;
}[];
hasNoWorkflows?: boolean;
}
@@ -83,7 +83,12 @@ function WorkflowsPage() {
const profileOptions = query.data.profiles
.filter((profile) => !profile.readOnly)
.map((profile) => {
return { teamId: profile.teamId, label: profile.name || profile.slug, image: profile.image };
return {
teamId: profile.teamId,
label: profile.name || profile.slug,
image: profile.image,
slug: profile.slug,
};
});
return (
@@ -18,6 +18,7 @@ export interface Option {
teamId: number | null | undefined; // if undefined, then it's a profile
label: string | null;
image?: string | null;
slug: string | null;
}
interface CreateBtnProps {
@@ -43,7 +44,7 @@ export function CreateButton(props: CreateBtnProps) {
const query = {
...router.query,
dialog: "new",
eventPage: option.label,
eventPage: option.slug,
teamId: option.teamId,
};
if (!option.teamId) {