Skip to content

Commit

Permalink
Migrate SUIR components to MUI. (#10575)
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink authored Dec 24, 2024
1 parent 3daa2ab commit 7f52974
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/frontend/src/dashboard/IssuesCard.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Chip } from "@mui/material"
import { bool, func } from "prop-types"

import { Label, Table } from "../semantic_ui_react_wrappers"
import { Table } from "../semantic_ui_react_wrappers"
import { reportPropType } from "../sharedPropTypes"
import { capitalize, ISSUE_STATUS_COLORS } from "../utils"
import { capitalize, ISSUE_STATUS_THEME_COLORS } from "../utils"
import { FilterCardWithTable } from "./FilterCardWithTable"

function issueStatuses(report) {
Expand Down Expand Up @@ -35,9 +36,13 @@ function tableRows(report) {
<Table.Row key={status}>
<Table.Cell>{capitalize(status)}</Table.Cell>
<Table.Cell textAlign="right">
<Label size="small" color={ISSUE_STATUS_COLORS[status]}>
{statuses[status]}
</Label>
<Chip
color={ISSUE_STATUS_THEME_COLORS[status]}
label={`${statuses[status]}`}
size="small"
sx={{ borderRadius: 1 }}
variant={ISSUE_STATUS_THEME_COLORS[status] ? "" : "outlined"}
/>
</Table.Cell>
</Table.Row>
))
Expand Down
1 change: 1 addition & 0 deletions components/frontend/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const MILLISECONDS_PER_HOUR = 60 * 60 * 1000
const MILLISECONDS_PER_DAY = 24 * MILLISECONDS_PER_HOUR

export const ISSUE_STATUS_COLORS = { todo: "grey", doing: "blue", done: "green", unknown: null }
export const ISSUE_STATUS_THEME_COLORS = { todo: "grey", doing: "info", done: "success", unknown: "" }

export function getMetricDirection(metric, dataModel) {
// Old versions of the data model may contain the unicode version of the direction, be prepared:
Expand Down

0 comments on commit 7f52974

Please sign in to comment.