mirror of
https://github.com/fleetdm/fleet
synced 2026-05-18 22:49:19 +00:00
# Details This PR merges the feature branch for the scheduled scripts UI into main. This includes the following previously-approved PRs: * https://github.com/fleetdm/fleet/pull/31750 * https://github.com/fleetdm/fleet/pull/31604 * https://github.com/fleetdm/fleet/pull/31797 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [X] Added/updated automated tests - [X] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [X] QA'd all new/changed functionality manually --------- Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com> Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
41 lines
923 B
TypeScript
41 lines
923 B
TypeScript
import React from "react";
|
|
import { COLORS } from "styles/var/colors";
|
|
|
|
const baseClass = "progress-bar";
|
|
|
|
export interface IProgressBarSection {
|
|
color: string;
|
|
portion: number; // Value between 0 and 1
|
|
}
|
|
|
|
export interface IProgressBar {
|
|
sections: IProgressBarSection[];
|
|
backgroundColor?: string;
|
|
}
|
|
|
|
const ProgressBar = ({
|
|
sections,
|
|
backgroundColor = COLORS["ui-fleet-black-10"],
|
|
}: IProgressBar) => {
|
|
return (
|
|
<div
|
|
className={`${baseClass}`}
|
|
style={{ backgroundColor }}
|
|
role="progressbar"
|
|
>
|
|
{sections.map((section, index) => (
|
|
<div
|
|
key={`${section.color}-${section.portion}`}
|
|
data-testid={`section-${index}`}
|
|
className={`${baseClass}__section`}
|
|
style={{
|
|
backgroundColor: section.color,
|
|
width: `${section.portion * 100}%`,
|
|
}}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ProgressBar;
|