diff --git a/packages/helpers/src/measure.ts b/packages/helpers/src/measure.ts index 26b68a925..f9ac93443 100644 --- a/packages/helpers/src/measure.ts +++ b/packages/helpers/src/measure.ts @@ -19,6 +19,8 @@ export const measureStates = [ "IN_PROGRESS", "NOT_APPLICABLE", "NOT_STARTED", + "UNKNOWN", + "NOT_IMPLEMENTED", ] as const; export function getMeasureStateLabel(__: Translator, state: string) { @@ -31,6 +33,10 @@ export function getMeasureStateLabel(__: Translator, state: string) { return __("Not Applicable"); case "NOT_STARTED": return __("Not Started"); + case "UNKNOWN": + return __("Unknown"); + case "NOT_IMPLEMENTED": + return __("Not Implemented"); default: return __("Unknown"); } diff --git a/packages/ui/src/Molecules/Badge/MeasureBadge.tsx b/packages/ui/src/Molecules/Badge/MeasureBadge.tsx index 1995fa8f4..38242807e 100644 --- a/packages/ui/src/Molecules/Badge/MeasureBadge.tsx +++ b/packages/ui/src/Molecules/Badge/MeasureBadge.tsx @@ -31,6 +31,8 @@ const stateToVariant: Record< IN_PROGRESS: "info", NOT_APPLICABLE: "neutral", NOT_STARTED: "neutral", + UNKNOWN: "neutral", + NOT_IMPLEMENTED: "danger", }; export function MeasureBadge({ state }: Props) { diff --git a/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.stories.tsx b/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.stories.tsx index 45146dde6..8e7f86f03 100644 --- a/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.stories.tsx +++ b/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.stories.tsx @@ -25,7 +25,7 @@ export default { type Story = StoryObj; -type MeasureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; +type MeasureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED" | "UNKNOWN" | "NOT_IMPLEMENTED"; export const Default: Story = { args: { diff --git a/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.tsx b/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.tsx index dc1b22cb3..3dbe6d5ba 100644 --- a/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.tsx +++ b/packages/ui/src/Molecules/MeasureImplementation/MeasureImplementation.tsx @@ -31,6 +31,8 @@ const stateToColor: Record = { IN_PROGRESS: "bg-border-warning", NOT_APPLICABLE: "bg-border-info", NOT_STARTED: "bg-highlight", + UNKNOWN: "bg-highlight", + NOT_IMPLEMENTED: "bg-border-danger", }; export function MeasureImplementation({ measures, className }: Props) { diff --git a/pkg/coredata/mesure_state.go b/pkg/coredata/mesure_state.go index 5912bfd27..bae236e5e 100644 --- a/pkg/coredata/mesure_state.go +++ b/pkg/coredata/mesure_state.go @@ -28,6 +28,8 @@ const ( MeasureStateInProgress MeasureStateNotApplicable MeasureStateImplemented + MeasureStateUnknown + MeasureStateNotImplemented ) func MeasureStates() []MeasureState { @@ -36,6 +38,8 @@ func MeasureStates() []MeasureState { MeasureStateInProgress, MeasureStateNotApplicable, MeasureStateImplemented, + MeasureStateUnknown, + MeasureStateNotImplemented, } } @@ -55,6 +59,10 @@ func (ms *MeasureState) UnmarshalText(data []byte) error { *ms = MeasureStateNotApplicable case MeasureStateImplemented.String(): *ms = MeasureStateImplemented + case MeasureStateUnknown.String(): + *ms = MeasureStateUnknown + case MeasureStateNotImplemented.String(): + *ms = MeasureStateNotImplemented default: return fmt.Errorf("invalid MeasureState value: %q", val) } @@ -74,6 +82,10 @@ func (ms MeasureState) String() string { val = "NOT_APPLICABLE" case MeasureStateImplemented: val = "IMPLEMENTED" + case MeasureStateUnknown: + val = "UNKNOWN" + case MeasureStateNotImplemented: + val = "NOT_IMPLEMENTED" } return val diff --git a/pkg/coredata/migrations/20260401T120000Z.sql b/pkg/coredata/migrations/20260401T120000Z.sql new file mode 100644 index 000000000..b900f8b76 --- /dev/null +++ b/pkg/coredata/migrations/20260401T120000Z.sql @@ -0,0 +1,16 @@ +-- Copyright (c) 2025-2026 Probo Inc . +-- +-- Permission to use, copy, modify, and/or distribute this software for any +-- purpose with or without fee is hereby granted, provided that the above +-- copyright notice and this permission notice appear in all copies. +-- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +-- PERFORMANCE OF THIS SOFTWARE. + +ALTER TYPE mitigation_state ADD VALUE IF NOT EXISTS 'UNKNOWN'; +ALTER TYPE mitigation_state ADD VALUE IF NOT EXISTS 'NOT_IMPLEMENTED'; diff --git a/pkg/server/api/console/v1/schema.graphql b/pkg/server/api/console/v1/schema.graphql index 59342eb49..db05229c8 100644 --- a/pkg/server/api/console/v1/schema.graphql +++ b/pkg/server/api/console/v1/schema.graphql @@ -54,6 +54,14 @@ enum MeasureState @goEnum( value: "go.probo.inc/probo/pkg/coredata.MeasureStateImplemented" ) + UNKNOWN + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MeasureStateUnknown" + ) + NOT_IMPLEMENTED + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MeasureStateNotImplemented" + ) } enum TaskState @goModel(model: "go.probo.inc/probo/pkg/coredata.TaskState") { diff --git a/pkg/server/api/mcp/v1/specification.yaml b/pkg/server/api/mcp/v1/specification.yaml index 8fe07d97c..3bb5aa685 100644 --- a/pkg/server/api/mcp/v1/specification.yaml +++ b/pkg/server/api/mcp/v1/specification.yaml @@ -1350,6 +1350,8 @@ components: - IN_PROGRESS - NOT_APPLICABLE - IMPLEMENTED + - UNKNOWN + - NOT_IMPLEMENTED go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.MeasureState MeasureOrderField: