Skip to content

Commit

Permalink
Update logic for special default not started states
Browse files Browse the repository at this point in the history
  • Loading branch information
nealfennimore committed Dec 7, 2024
1 parent 7fd3fcc commit b6fa4e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/src/app/components/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum Status {
PARTIALLY_IMPLEMENTED = "partially-implemented",
NOT_STARTED = "not-started",
NEEDS_WORK = "needs-work",
_NOT_STARTED_DEFAULT = "", // Special default value for empty form fields
}

const StatusSpan = ({ status }: { status?: Status }) => {
Expand Down Expand Up @@ -92,6 +93,12 @@ export const StatusState = ({ statuses, status }: StatusStateProps) => {
statuses.some((s) => s === Status.IMPLEMENTED) &&
statuses.some((s) => s === Status.NOT_IMPLEMENTED)
) {
if (
statuses.includes(Status.NOT_STARTED) ||
statuses.includes(Status._NOT_STARTED_DEFAULT)
) {
return <StatusSpan status={Status.NEEDS_WORK} />;
}
return <StatusSpan status={Status.PARTIALLY_IMPLEMENTED} />;
}

Expand Down

0 comments on commit b6fa4e9

Please sign in to comment.