From dabd7dda23fe21945771c4a6326120002d6052cf Mon Sep 17 00:00:00 2001 From: minnakt Date: Sun, 28 Jan 2024 21:24:33 -0500 Subject: [PATCH] Disable file name check for schema file --- src/gql/generated/types.ts | 2 +- .../projectSettings/CopyProjectModal.test.tsx | 4 ++-- .../projectSettings/CopyProjectModal.tsx | 16 ++++---------- .../CreateProjectModal.test.tsx | 4 ++-- .../projectSettings/CreateProjectModal.tsx | 16 ++++---------- ...ema.tsx => createDuplicateModalSchema.tsx} | 21 +++++++++++++++++-- 6 files changed, 32 insertions(+), 31 deletions(-) rename src/pages/projectSettings/{CreateDuplicateSchema.tsx => createDuplicateModalSchema.tsx} (65%) diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 2408730e57..16abd89ca4 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -436,7 +436,7 @@ export type DistroInput = { arch: Arch; authorizedKeysFile: Scalars["String"]["input"]; bootstrapSettings: BootstrapSettingsInput; - cloneMethod: CloneMethod; + cloneMethod?: InputMaybe; containerPool: Scalars["String"]["input"]; disableShallowClone: Scalars["Boolean"]["input"]; disabled: Scalars["Boolean"]["input"]; diff --git a/src/pages/projectSettings/CopyProjectModal.test.tsx b/src/pages/projectSettings/CopyProjectModal.test.tsx index 8df5adf5f3..431a2038c4 100644 --- a/src/pages/projectSettings/CopyProjectModal.test.tsx +++ b/src/pages/projectSettings/CopyProjectModal.test.tsx @@ -79,7 +79,7 @@ describe("copyProjectField", () => { newProjectIdentifier, ); - // Turn on request for S3 creds. + // Check S3 creds checkbox. const requestS3Creds = screen.getByDataCy("request-s3-creds"); const requestS3CredLabel = screen.getByText( "Open a JIRA ticket to request an S3 Bucket from the Build team", @@ -136,7 +136,7 @@ describe("copyProjectField", () => { newProjectIdentifier, ); - // Turn on performance tooling. + // Check performance tooling checkbox. const enablePerformanceTooling = screen.getByDataCy( "enable-performance-tooling", ); diff --git a/src/pages/projectSettings/CopyProjectModal.tsx b/src/pages/projectSettings/CopyProjectModal.tsx index 85f8408a13..482751d5b1 100644 --- a/src/pages/projectSettings/CopyProjectModal.tsx +++ b/src/pages/projectSettings/CopyProjectModal.tsx @@ -12,11 +12,10 @@ import { } from "gql/generated/types"; import { COPY_PROJECT } from "gql/mutations"; import { - PerformanceToolingBanner, - enablePerformanceTooling, + performanceTooling, projectName, requestS3Creds, -} from "./CreateDuplicateSchema"; +} from "./createDuplicateModalSchema"; interface Props { handleClose: () => void; @@ -127,20 +126,13 @@ const modalFormDefinition = { type: "object" as "object", properties: { projectName: projectName.schema, - enablePerformanceTooling: enablePerformanceTooling.schema, - performanceToolingBanner: { - type: "null" as "null", - }, + ...performanceTooling.schema, requestS3Creds: requestS3Creds.schema, }, }, uiSchema: { projectName: projectName.uiSchema, - enablePerformanceTooling: enablePerformanceTooling.uiSchema, - performanceToolingBanner: { - "ui:field": PerformanceToolingBanner, - "ui:showLabel": false, - }, + ...performanceTooling.uiSchema, requestS3Creds: requestS3Creds.uiSchema, }, }; diff --git a/src/pages/projectSettings/CreateProjectModal.test.tsx b/src/pages/projectSettings/CreateProjectModal.test.tsx index 8247d99fc0..958de7c897 100644 --- a/src/pages/projectSettings/CreateProjectModal.test.tsx +++ b/src/pages/projectSettings/CreateProjectModal.test.tsx @@ -192,7 +192,7 @@ describe("createProjectField", () => { }); expect(confirmButton).toBeEnabled(); - // Turn on performance tooling. + // Check performance tooling checkbox. const enablePerformanceTooling = screen.getByDataCy( "enable-performance-tooling", ); @@ -203,7 +203,7 @@ describe("createProjectField", () => { await user.click(enablePerformanceToolingLabel); // LeafyGreen checkbox has pointer-events: none so click on the label instead. expect(enablePerformanceTooling).toBeChecked(); - // Turn on request for S3 creds. + // Check S3 creds checkbox. const requestS3Creds = screen.getByDataCy("request-s3-creds"); const requestS3CredLabel = screen.getByText( "Open a JIRA ticket to request an S3 Bucket from the Build team", diff --git a/src/pages/projectSettings/CreateProjectModal.tsx b/src/pages/projectSettings/CreateProjectModal.tsx index e935cfd05f..dd3134c99e 100644 --- a/src/pages/projectSettings/CreateProjectModal.tsx +++ b/src/pages/projectSettings/CreateProjectModal.tsx @@ -15,11 +15,10 @@ import { import { CREATE_PROJECT } from "gql/mutations"; import { GITHUB_ORGS } from "gql/queries"; import { - PerformanceToolingBanner, - enablePerformanceTooling, + performanceTooling, projectName, requestS3Creds, -} from "./CreateDuplicateSchema"; +} from "./createDuplicateModalSchema"; interface Props { handleClose: () => void; @@ -160,10 +159,7 @@ const modalFormDefinition = (githubOrgs: string[]) => ({ minLength: 1, format: "noSpaces", }, - enablePerformanceTooling: enablePerformanceTooling.schema, - performanceToolingBanner: { - type: "null" as "null", - }, + ...performanceTooling.schema, requestS3Creds: requestS3Creds.schema, }, }, @@ -176,11 +172,7 @@ const modalFormDefinition = (githubOrgs: string[]) => ({ repo: { "ui:data-cy": "new-repo-input", }, - enablePerformanceTooling: enablePerformanceTooling.uiSchema, - performanceToolingBanner: { - "ui:field": PerformanceToolingBanner, - "ui:showLabel": false, - }, + ...performanceTooling.uiSchema, requestS3Creds: requestS3Creds.uiSchema, }, }); diff --git a/src/pages/projectSettings/CreateDuplicateSchema.tsx b/src/pages/projectSettings/createDuplicateModalSchema.tsx similarity index 65% rename from src/pages/projectSettings/CreateDuplicateSchema.tsx rename to src/pages/projectSettings/createDuplicateModalSchema.tsx index 7165714a72..b9a4a97a6f 100644 --- a/src/pages/projectSettings/CreateDuplicateSchema.tsx +++ b/src/pages/projectSettings/createDuplicateModalSchema.tsx @@ -1,3 +1,4 @@ +/* eslint-disable check-file/filename-naming-convention */ import Banner from "@leafygreen-ui/banner"; import { Field } from "@rjsf/core"; @@ -13,7 +14,7 @@ export const projectName = { }, }; -export const enablePerformanceTooling = { +const enablePerformanceTooling = { schema: { type: "boolean" as "boolean", title: "Enable performance tooling", @@ -24,7 +25,7 @@ export const enablePerformanceTooling = { }, }; -export const PerformanceToolingBanner: Field = () => ( +const PerformanceToolingBanner: Field = () => ( ( ); +export const performanceTooling = { + schema: { + enablePerformanceTooling: enablePerformanceTooling.schema, + performanceToolingBanner: { + type: "null" as "null", + }, + }, + uiSchema: { + enablePerformanceTooling: enablePerformanceTooling.uiSchema, + performanceToolingBanner: { + "ui:field": PerformanceToolingBanner, + "ui:showLabel": false, + }, + }, +}; + export const requestS3Creds = { schema: { type: "boolean" as "boolean",