Skip to content

Commit

Permalink
Merge pull request #133 from vtexdocs/fix/KI-no-fix-status-display
Browse files Browse the repository at this point in the history
fix: no fix status for ki cards
  • Loading branch information
julia-rabello authored Nov 12, 2024
2 parents a65d40f + 8decb0a commit bd516e2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
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

0 comments on commit bd516e2

Please sign in to comment.