From 8decb0a243144b3a9bcdec365bf2c5ab04c4c9c3 Mon Sep 17 00:00:00 2001 From: phvm Date: Mon, 28 Oct 2024 11:31:08 -0300 Subject: [PATCH] fix: no fix status for ki cards --- src/components/known-issue-card/index.tsx | 4 +++- src/components/tag/styles.ts | 2 +- src/pages/known-issues/index.tsx | 8 ++++++-- src/utils/constants.ts | 2 +- src/utils/typings/types.ts | 3 ++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/known-issue-card/index.tsx b/src/components/known-issue-card/index.tsx index 2e2726f3..4866b0f2 100644 --- a/src/components/known-issue-card/index.tsx +++ b/src/components/known-issue-card/index.tsx @@ -26,7 +26,9 @@ const KnownIssueCard = ({ {intl.formatMessage({ - id: `known_issues_filter_status.${status.toLowerCase()}`, + id: `known_issues_filter_status.${status + .toLowerCase() + .replace(' ', '_')}`, })} diff --git a/src/components/tag/styles.ts b/src/components/tag/styles.ts index 4fec9751..ef5d3e21 100644 --- a/src/components/tag/styles.ts +++ b/src/components/tag/styles.ts @@ -40,7 +40,7 @@ const statusColors: { color: '#D77809', background: '#FFF3DA', }, - 'No fix': { + No_Fix: { border: '1px solid #FAA397', color: '#CB2610', background: '#FFDFDB', diff --git a/src/pages/known-issues/index.tsx b/src/pages/known-issues/index.tsx index 20d814d0..bdfcef6a 100644 --- a/src/pages/known-issues/index.tsx +++ b/src/pages/known-issues/index.tsx @@ -43,6 +43,7 @@ interface Props { const KnownIssuesPage: NextPage = ({ knownIssuesData, branch }) => { const intl = useIntl() + const { setBranchPreview } = useContext(PreviewContext) setBranchPreview(branch) const itemsPerPage = 8 @@ -51,9 +52,9 @@ const KnownIssuesPage: NextPage = ({ knownIssuesData, branch }) => { status: string[] modules: string[] }>({ status: [], modules: [] }) + const [search, setSearch] = useState('') const [sortByValue, setSortByValue] = useState('newest') - const filteredResult = useMemo(() => { const data = knownIssuesData.filter((knownIssue) => { const hasFilter: boolean = @@ -242,7 +243,10 @@ export const getStaticProps: GetStaticProps = async ({ title: frontmatter.title, module: frontmatter.tag, slug: data.slug, - status: frontmatter.kiStatus as KnownIssueStatus, + status: frontmatter.kiStatus.replace( + ' ', + '_' + ) as KnownIssueStatus, createdAt: String(frontmatter.createdAt), updatedAt: String(frontmatter.updatedAt), }) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index bfc1b66c..837fcdeb 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -456,7 +456,7 @@ export const knownIssuesStatusFilter = (intl: IntlShape) => { }), }, { - id: 'No fix', + id: 'No_Fix', name: intl.formatMessage({ id: 'known_issues_filter_status.no_fix' }), }, ], diff --git a/src/utils/typings/types.ts b/src/utils/typings/types.ts index 94939989..a4919fef 100644 --- a/src/utils/typings/types.ts +++ b/src/utils/typings/types.ts @@ -18,6 +18,7 @@ export type DataElement = { Icon: IconComponent description: string } + export interface DocDataElement extends DataElement { id: string title: string @@ -64,7 +65,7 @@ export type KnownIssueStatus = | 'Closed' | 'Backlog' | 'Scheduled' - | 'No fix' + | 'No_Fix' export type KnownIssueDataElement = { title: string