-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add colours and icons for job statuses to Lookout UI (#4095)
* ARMADA-3015 add colours and icons to Lookout UI for displaying job statuses (#307) * Add coloured icons to display of job statuses in Jobs view * Add job status colours to job sets page * Fix lint (#308) * Fix TypeScript with casting The TypeScript type checker sometimes fails when the development server is run because it does not correctly infer this type. This seems to be inconsistent and so was not caught in the previous commit which introduced this change. --------- Co-authored-by: Maurice Yap <[email protected]>
- Loading branch information
1 parent
81c2942
commit 0d3e5bc
Showing
24 changed files
with
437 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { forwardRef } from "react" | ||
|
||
import { IconDefinition } from "@fortawesome/fontawesome-common-types" | ||
import { | ||
faBan, | ||
faCheckCircle, | ||
faExchangeAlt, | ||
faFileContract, | ||
faHand, | ||
faHourglassHalf, | ||
faPlayCircle, | ||
faSpinner, | ||
faTimesCircle, | ||
} from "@fortawesome/free-solid-svg-icons" | ||
import { SvgIcon, SvgIconProps } from "@mui/material" | ||
|
||
import "@fortawesome/fontawesome-svg-core/styles.css" | ||
|
||
export interface FontAwesomeSvgIconProps extends SvgIconProps { | ||
icon: IconDefinition | ||
} | ||
|
||
export const FontAwesomeSvgIcon = forwardRef<SVGSVGElement, FontAwesomeSvgIconProps>( | ||
({ icon, ...svgIconProps }, ref) => { | ||
const { | ||
icon: [width, height, , , svgPathData], | ||
} = icon | ||
|
||
return ( | ||
<SvgIcon ref={ref} viewBox={`0 0 ${width} ${height}`} {...svgIconProps}> | ||
{typeof svgPathData === "string" ? ( | ||
<path d={svgPathData} /> | ||
) : ( | ||
/** | ||
* A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to | ||
* be the faded element (referred to as the "secondary" path in the Font Awesome docs) | ||
* of a duotone icon. 40% is the default opacity. | ||
* | ||
* @see https://fontawesome.com/how-to-use/on-the-web/styling/duotone-icons#changing-opacity | ||
*/ | ||
svgPathData.map((d: string, i: number) => <path style={{ opacity: i === 0 ? 0.4 : 1 }} d={d} />) | ||
)} | ||
</SvgIcon> | ||
) | ||
}, | ||
) | ||
|
||
export const FaHourglassHalf = (svgIconProps: SvgIconProps) => ( | ||
<FontAwesomeSvgIcon icon={faHourglassHalf} {...svgIconProps} /> | ||
) | ||
export const FaSpinner = (svgIconProps: SvgIconProps) => <FontAwesomeSvgIcon icon={faSpinner} {...svgIconProps} /> | ||
export const FaPlayCircle = (svgIconProps: SvgIconProps) => <FontAwesomeSvgIcon icon={faPlayCircle} {...svgIconProps} /> | ||
export const FaCheckCircle = (svgIconProps: SvgIconProps) => ( | ||
<FontAwesomeSvgIcon icon={faCheckCircle} {...svgIconProps} /> | ||
) | ||
export const FaTimesCircle = (svgIconProps: SvgIconProps) => ( | ||
<FontAwesomeSvgIcon icon={faTimesCircle} {...svgIconProps} /> | ||
) | ||
export const FaBan = (svgIconProps: SvgIconProps) => <FontAwesomeSvgIcon icon={faBan} {...svgIconProps} /> | ||
export const FaExcahngeAlt = (svgIconProps: SvgIconProps) => ( | ||
<FontAwesomeSvgIcon icon={faExchangeAlt} {...svgIconProps} /> | ||
) | ||
export const FaFileContract = (svgIconProps: SvgIconProps) => ( | ||
<FontAwesomeSvgIcon icon={faFileContract} {...svgIconProps} /> | ||
) | ||
export const FaHand = (svgIconProps: SvgIconProps) => <FontAwesomeSvgIcon icon={faHand} {...svgIconProps} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
internal/lookout/ui/src/components/lookoutV2/JobGroupStateCounts.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.