Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Disable file name check for schema file
Browse files Browse the repository at this point in the history
  • Loading branch information
minnakt committed Jan 29, 2024
1 parent 21e506f commit dabd7dd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export type DistroInput = {
arch: Arch;
authorizedKeysFile: Scalars["String"]["input"];
bootstrapSettings: BootstrapSettingsInput;
cloneMethod: CloneMethod;
cloneMethod?: InputMaybe<CloneMethod>;
containerPool: Scalars["String"]["input"];
disableShallowClone: Scalars["Boolean"]["input"];
disabled: Scalars["Boolean"]["input"];
Expand Down
4 changes: 2 additions & 2 deletions src/pages/projectSettings/CopyProjectModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -136,7 +136,7 @@ describe("copyProjectField", () => {
newProjectIdentifier,
);

// Turn on performance tooling.
// Check performance tooling checkbox.
const enablePerformanceTooling = screen.getByDataCy(
"enable-performance-tooling",
);
Expand Down
16 changes: 4 additions & 12 deletions src/pages/projectSettings/CopyProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
},
};
4 changes: 2 additions & 2 deletions src/pages/projectSettings/CreateProjectModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe("createProjectField", () => {
});
expect(confirmButton).toBeEnabled();

// Turn on performance tooling.
// Check performance tooling checkbox.
const enablePerformanceTooling = screen.getByDataCy(
"enable-performance-tooling",
);
Expand All @@ -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",
Expand Down
16 changes: 4 additions & 12 deletions src/pages/projectSettings/CreateProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
},
},
Expand All @@ -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,
},
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable check-file/filename-naming-convention */
import Banner from "@leafygreen-ui/banner";
import { Field } from "@rjsf/core";

Expand All @@ -13,7 +14,7 @@ export const projectName = {
},
};

export const enablePerformanceTooling = {
const enablePerformanceTooling = {
schema: {
type: "boolean" as "boolean",
title: "Enable performance tooling",
Expand All @@ -24,7 +25,7 @@ export const enablePerformanceTooling = {
},
};

export const PerformanceToolingBanner: Field = () => (
const PerformanceToolingBanner: Field = () => (
<Banner
variant="warning"
data-cy="performance-tooling-banner"
Expand All @@ -35,6 +36,22 @@ export const PerformanceToolingBanner: Field = () => (
</Banner>
);

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",
Expand Down

0 comments on commit dabd7dd

Please sign in to comment.