Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no fix status for ki cards #133

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/known-issue-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const KnownIssueCard = ({
<Flex sx={styles.topContainer}>
<Tag color={status}>
{intl.formatMessage({
id: `known_issues_filter_status.${status.toLowerCase()}`,
id: `known_issues_filter_status.${status
.toLowerCase()
.replace(' ', '_')}`,
})}
</Tag>
<Text sx={styles.knownIssueModule} className="module">
Expand Down
2 changes: 1 addition & 1 deletion src/components/tag/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const statusColors: {
color: '#D77809',
background: '#FFF3DA',
},
'No fix': {
No_Fix: {
border: '1px solid #FAA397',
color: '#CB2610',
background: '#FFDFDB',
Expand Down
8 changes: 6 additions & 2 deletions src/pages/known-issues/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface Props {

const KnownIssuesPage: NextPage<Props> = ({ knownIssuesData, branch }) => {
const intl = useIntl()

const { setBranchPreview } = useContext(PreviewContext)
setBranchPreview(branch)
const itemsPerPage = 8
Expand All @@ -51,9 +52,9 @@ const KnownIssuesPage: NextPage<Props> = ({ knownIssuesData, branch }) => {
status: string[]
modules: string[]
}>({ status: [], modules: [] })

const [search, setSearch] = useState<string>('')
const [sortByValue, setSortByValue] = useState<SortByType>('newest')

const filteredResult = useMemo(() => {
const data = knownIssuesData.filter((knownIssue) => {
const hasFilter: boolean =
Expand Down Expand Up @@ -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),
})
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }),
},
],
Expand Down
3 changes: 2 additions & 1 deletion src/utils/typings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type DataElement = {
Icon: IconComponent
description: string
}

export interface DocDataElement extends DataElement {
id: string
title: string
Expand Down Expand Up @@ -64,7 +65,7 @@ export type KnownIssueStatus =
| 'Closed'
| 'Backlog'
| 'Scheduled'
| 'No fix'
| 'No_Fix'

export type KnownIssueDataElement = {
title: string
Expand Down
Loading