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

Commit

Permalink
DEVPROD-806: Remove references to CloneMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
minnakt committed Jan 25, 2024
1 parent 11d84a3 commit abe8728
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 39 deletions.
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -2515,6 +2515,7 @@ export type Task = {
generateTask?: Maybe<Scalars["Boolean"]["output"]>;
generatedBy?: Maybe<Scalars["String"]["output"]>;
generatedByName?: Maybe<Scalars["String"]["output"]>;
hasCedarResults: Scalars["Boolean"]["output"];
hostId?: Maybe<Scalars["String"]["output"]>;
id: Scalars["String"]["output"];
ingestTime?: Maybe<Scalars["Time"]["output"]>;
Expand Down Expand Up @@ -5733,7 +5734,6 @@ export type DistroQuery = {
aliases: Array<string>;
arch: Arch;
authorizedKeysFile: string;
cloneMethod: CloneMethod;
containerPool: string;
disabled: boolean;
disableShallowClone: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/gql/queries/distro.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ query Distro($distroId: String!) {
serviceUser
shellPath
}
cloneMethod
containerPool
disabled
disableShallowClone
Expand Down
21 changes: 0 additions & 21 deletions src/pages/distroSettings/tabs/ProjectTab/getFormSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,12 @@ import {
CardFieldTemplate,
FieldRow,
} from "components/SpruceForm/FieldTemplates";
import { CloneMethod } from "gql/generated/types";

export const getFormSchema = (): ReturnType<GetFormSchema> => ({
fields: {},
schema: {
type: "object" as "object",
properties: {
cloneMethod: {
type: "string" as "string",
title: "Project Cloning Method",
oneOf: [
{
type: "string" as "string",
title: "Legacy SSH",
enum: [CloneMethod.LegacySsh],
},
{
type: "string" as "string",
title: "OAuth",
enum: [CloneMethod.Oauth],
},
],
},
expansions: {
type: "array" as "array",
title: "Expansions",
Expand Down Expand Up @@ -61,10 +44,6 @@ export const getFormSchema = (): ReturnType<GetFormSchema> => ({
},
uiSchema: {
"ui:ObjectFieldTemplate": CardFieldTemplate,
cloneMethod: {
"ui:allowDeselect": false,
"ui:data-cy": "clone-method-select",
},
expansions: {
"ui:addButtonText": "Add expansion",
"ui:orderable": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CloneMethod, DistroInput } from "gql/generated/types";
import { DistroInput } from "gql/generated/types";
import { distroData } from "../testData";
import { formToGql, gqlToForm } from "./transformers";
import { ProjectFormState } from "./types";
Expand All @@ -14,7 +14,6 @@ describe("project tab", () => {
});

const form: ProjectFormState = {
cloneMethod: CloneMethod.LegacySsh,
expansions: [
{
key: "decompress",
Expand All @@ -34,7 +33,6 @@ const form: ProjectFormState = {

const gql: DistroInput = {
...distroData,
cloneMethod: CloneMethod.LegacySsh,
expansions: [
{
key: "decompress",
Expand Down
9 changes: 2 additions & 7 deletions src/pages/distroSettings/tabs/ProjectTab/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ type Tab = DistroSettingsTabRoutes.Project;
export const gqlToForm = ((data) => {
if (!data) return null;

const { cloneMethod, expansions, validProjects } = data;
const { expansions, validProjects } = data;

return {
cloneMethod,
expansions,
validProjects,
};
}) satisfies GqlToFormFunction<Tab>;

export const formToGql = ((
{ cloneMethod, expansions, validProjects },
distro,
) => ({
export const formToGql = (({ expansions, validProjects }, distro) => ({
...distro,
cloneMethod,
expansions,
validProjects,
})) satisfies FormToGqlFunction<Tab>;
3 changes: 0 additions & 3 deletions src/pages/distroSettings/tabs/ProjectTab/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { CloneMethod } from "gql/generated/types";

export interface ProjectFormState {
cloneMethod: CloneMethod;
expansions: Array<{
key: string;
value: string;
Expand Down
2 changes: 0 additions & 2 deletions src/pages/distroSettings/tabs/testData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
Arch,
BootstrapMethod,
CloneMethod,
CommunicationMethod,
DispatcherVersion,
DistroQuery,
Expand Down Expand Up @@ -43,7 +42,6 @@ const distroData: DistroQuery["distro"] = {
serviceUser: "",
shellPath: "/bin/bash",
},
cloneMethod: CloneMethod.LegacySsh,
containerPool: "",
disabled: false,
disableShallowClone: true,
Expand Down

0 comments on commit abe8728

Please sign in to comment.