Rename NONCONFORMITY to MINOR_NONCONFORMITY and add MAJOR_NONCONFORMITY
Support distinguishing between minor and major non-conformities in findings. Rename the existing NONCONFORMITY enum value to MINOR_NONCONFORMITY and add a new MAJOR_NONCONFORMITY value across all API layers (GraphQL, MCP, CLI) and the database. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -131,8 +131,10 @@ type Props = {
|
||||
|
||||
function getKindLabel(kind: string, __: (s: string) => string): string {
|
||||
switch (kind) {
|
||||
case "NONCONFORMITY":
|
||||
return __("Nonconformity");
|
||||
case "MINOR_NONCONFORMITY":
|
||||
return __("Minor nonconformity");
|
||||
case "MAJOR_NONCONFORMITY":
|
||||
return __("Major nonconformity");
|
||||
case "OBSERVATION":
|
||||
return __("Observation");
|
||||
case "EXCEPTION":
|
||||
|
||||
@@ -271,7 +271,8 @@ export default function FindingsPage({ queryRef }: FindingsPageProps) {
|
||||
onValueChange={handleKindFilterChange}
|
||||
>
|
||||
<Option value="ALL">{__("All kinds")}</Option>
|
||||
<Option value="NONCONFORMITY">{__("Nonconformity")}</Option>
|
||||
<Option value="MINOR_NONCONFORMITY">{__("Minor nonconformity")}</Option>
|
||||
<Option value="MAJOR_NONCONFORMITY">{__("Major nonconformity")}</Option>
|
||||
<Option value="OBSERVATION">{__("Observation")}</Option>
|
||||
<Option value="EXCEPTION">{__("Exception")}</Option>
|
||||
</Select>
|
||||
@@ -366,8 +367,10 @@ export default function FindingsPage({ queryRef }: FindingsPageProps) {
|
||||
|
||||
function getKindLabel(kind: string, __: (s: string) => string): string {
|
||||
switch (kind) {
|
||||
case "NONCONFORMITY":
|
||||
return __("Nonconformity");
|
||||
case "MINOR_NONCONFORMITY":
|
||||
return __("Minor nonconformity");
|
||||
case "MAJOR_NONCONFORMITY":
|
||||
return __("Major nonconformity");
|
||||
case "OBSERVATION":
|
||||
return __("Observation");
|
||||
case "EXCEPTION":
|
||||
|
||||
@@ -63,7 +63,7 @@ const createFindingMutation = graphql`
|
||||
`;
|
||||
|
||||
const schema = z.object({
|
||||
kind: z.enum(["NONCONFORMITY", "OBSERVATION", "EXCEPTION"]),
|
||||
kind: z.enum(["MINOR_NONCONFORMITY", "MAJOR_NONCONFORMITY", "OBSERVATION", "EXCEPTION"]),
|
||||
description: z.string().optional(),
|
||||
source: z.string().optional(),
|
||||
identifiedOn: z.string().optional(),
|
||||
@@ -98,7 +98,8 @@ export function CreateFindingDialog({
|
||||
);
|
||||
|
||||
const kindOptions = [
|
||||
{ value: "NONCONFORMITY", label: __("Nonconformity") },
|
||||
{ value: "MINOR_NONCONFORMITY", label: __("Minor nonconformity") },
|
||||
{ value: "MAJOR_NONCONFORMITY", label: __("Major nonconformity") },
|
||||
{ value: "OBSERVATION", label: __("Observation") },
|
||||
{ value: "EXCEPTION", label: __("Exception") },
|
||||
];
|
||||
@@ -111,7 +112,7 @@ export function CreateFindingDialog({
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
kind: "NONCONFORMITY" as const,
|
||||
kind: "MINOR_NONCONFORMITY" as const,
|
||||
description: "",
|
||||
source: "",
|
||||
identifiedOn: "",
|
||||
|
||||
Reference in New Issue
Block a user