Skip to content

Commit

Permalink
Fix upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed May 21, 2024
1 parent e6ca398 commit 3bdd275
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 182 deletions.
105 changes: 69 additions & 36 deletions apps/parsley/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,22 @@ export enum AccessLevel {
View = "VIEW",
}

export type AddFavoriteProjectInput = {
projectIdentifier: Scalars["String"]["input"];
};

/**
* Annotation models the metadata that a user can add to a task.
* It is used as a field within the Task type.
*/
export type Annotation = {
__typename?: "Annotation";
createdIssues?: Maybe<Array<Maybe<IssueLink>>>;
createdIssues?: Maybe<Array<IssueLink>>;
id: Scalars["String"]["output"];
issues?: Maybe<Array<Maybe<IssueLink>>>;
metadataLinks?: Maybe<Array<Maybe<MetadataLink>>>;
issues?: Maybe<Array<IssueLink>>;
metadataLinks?: Maybe<Array<MetadataLink>>;
note?: Maybe<Note>;
suspectedIssues?: Maybe<Array<Maybe<IssueLink>>>;
suspectedIssues?: Maybe<Array<IssueLink>>;
taskExecution: Scalars["Int"]["output"];
taskId: Scalars["String"]["output"];
webhookConfigured: Scalars["Boolean"]["output"];
Expand Down Expand Up @@ -323,6 +327,19 @@ export type CreateProjectInput = {
repoRefId?: InputMaybe<Scalars["String"]["input"]>;
};

/** DeactivateStepbackTaskInput is the input to the deactivateStepbackTask mutation. */
export type DeactivateStepbackTaskInput = {
buildVariantName: Scalars["String"]["input"];
projectId: Scalars["String"]["input"];
taskName: Scalars["String"]["input"];
};

/** DefaultSectionToRepoInput is the input to the defaultSectionToRepo mutation. */
export type DefaultSectionToRepoInput = {
projectId: Scalars["String"]["input"];
section: ProjectSettingsSection;
};

/** DeleteDistroInput is the input to the deleteDistro mutation. */
export type DeleteDistroInput = {
distroId: Scalars["String"]["input"];
Expand Down Expand Up @@ -381,7 +398,7 @@ export type Distro = {
imageId?: Maybe<Scalars["String"]["output"]>;
isCluster: Scalars["Boolean"]["output"];
isVirtualWorkStation: Scalars["Boolean"]["output"];
mountpoints?: Maybe<Array<Maybe<Scalars["String"]["output"]>>>;
mountpoints?: Maybe<Array<Scalars["String"]["output"]>>;
name: Scalars["String"]["output"];
note: Scalars["String"]["output"];
plannerSettings: PlannerSettings;
Expand All @@ -392,7 +409,7 @@ export type Distro = {
sshOptions: Array<Scalars["String"]["output"]>;
user: Scalars["String"]["output"];
userSpawnAllowed: Scalars["Boolean"]["output"];
validProjects: Array<Maybe<Scalars["String"]["output"]>>;
validProjects: Array<Scalars["String"]["output"]>;
warningNote: Scalars["String"]["output"];
workDir: Scalars["String"]["output"];
};
Expand Down Expand Up @@ -447,7 +464,7 @@ export type DistroInput = {
imageId?: InputMaybe<Scalars["String"]["input"]>;
isCluster: Scalars["Boolean"]["input"];
isVirtualWorkStation: Scalars["Boolean"]["input"];
mountpoints?: InputMaybe<Array<InputMaybe<Scalars["String"]["input"]>>>;
mountpoints?: InputMaybe<Array<Scalars["String"]["input"]>>;
name: Scalars["String"]["input"];
note: Scalars["String"]["input"];
plannerSettings: PlannerSettingsInput;
Expand Down Expand Up @@ -650,7 +667,7 @@ export type GithubUserInput = {
export type GroupedBuildVariant = {
__typename?: "GroupedBuildVariant";
displayName: Scalars["String"]["output"];
tasks?: Maybe<Array<Maybe<Task>>>;
tasks?: Maybe<Array<Task>>;
variant: Scalars["String"]["output"];
};

Expand Down Expand Up @@ -1074,7 +1091,8 @@ export type MutationAddAnnotationIssueArgs = {
};

export type MutationAddFavoriteProjectArgs = {
identifier: Scalars["String"]["input"];
identifier?: InputMaybe<Scalars["String"]["input"]>;
opts?: InputMaybe<AddFavoriteProjectInput>;
};

export type MutationAttachProjectToNewRepoArgs = {
Expand Down Expand Up @@ -1117,14 +1135,16 @@ export type MutationCreatePublicKeyArgs = {
};

export type MutationDeactivateStepbackTaskArgs = {
buildVariantName: Scalars["String"]["input"];
projectId: Scalars["String"]["input"];
taskName: Scalars["String"]["input"];
buildVariantName?: InputMaybe<Scalars["String"]["input"]>;
opts?: InputMaybe<DeactivateStepbackTaskInput>;
projectId?: InputMaybe<Scalars["String"]["input"]>;
taskName?: InputMaybe<Scalars["String"]["input"]>;
};

export type MutationDefaultSectionToRepoArgs = {
projectId: Scalars["String"]["input"];
section: ProjectSettingsSection;
opts?: InputMaybe<DefaultSectionToRepoInput>;
projectId?: InputMaybe<Scalars["String"]["input"]>;
section?: InputMaybe<ProjectSettingsSection>;
};

export type MutationDeleteDistroArgs = {
Expand Down Expand Up @@ -1184,8 +1204,9 @@ export type MutationOverrideTaskDependenciesArgs = {
};

export type MutationPromoteVarsToRepoArgs = {
projectId: Scalars["String"]["input"];
varNames: Array<Scalars["String"]["input"]>;
opts?: InputMaybe<PromoteVarsToRepoInput>;
projectId?: InputMaybe<Scalars["String"]["input"]>;
varNames?: InputMaybe<Array<Scalars["String"]["input"]>>;
};

export type MutationRemoveAnnotationIssueArgs = {
Expand All @@ -1196,7 +1217,8 @@ export type MutationRemoveAnnotationIssueArgs = {
};

export type MutationRemoveFavoriteProjectArgs = {
identifier: Scalars["String"]["input"];
identifier?: InputMaybe<Scalars["String"]["input"]>;
opts?: InputMaybe<RemoveFavoriteProjectInput>;
};

export type MutationRemoveItemFromCommitQueueArgs = {
Expand Down Expand Up @@ -1374,7 +1396,7 @@ export type NotificationsInput = {
export type OomTrackerInfo = {
__typename?: "OomTrackerInfo";
detected: Scalars["Boolean"]["output"];
pids?: Maybe<Array<Maybe<Scalars["Int"]["output"]>>>;
pids?: Maybe<Array<Scalars["Int"]["output"]>>;
};

export enum OverallocatedRule {
Expand Down Expand Up @@ -1452,7 +1474,7 @@ export type Patch = {
tasks: Array<Scalars["String"]["output"]>;
time?: Maybe<PatchTime>;
variants: Array<Scalars["String"]["output"]>;
variantsTasks: Array<Maybe<VariantTask>>;
variantsTasks: Array<VariantTask>;
versionFull?: Maybe<Version>;
};

Expand All @@ -1462,7 +1484,7 @@ export type Patch = {
*/
export type PatchConfigure = {
description: Scalars["String"]["input"];
parameters?: InputMaybe<Array<InputMaybe<ParameterInput>>>;
parameters?: InputMaybe<Array<ParameterInput>>;
patchTriggerAliases?: InputMaybe<Array<Scalars["String"]["input"]>>;
variantsTasks: Array<VariantTasks>;
};
Expand Down Expand Up @@ -1526,6 +1548,7 @@ export type PatchesInput = {
onlyCommitQueue?: InputMaybe<Scalars["Boolean"]["input"]>;
page?: Scalars["Int"]["input"];
patchName?: Scalars["String"]["input"];
requesters?: InputMaybe<Array<Scalars["String"]["input"]>>;
statuses?: Array<Scalars["String"]["input"]>;
};

Expand Down Expand Up @@ -1659,7 +1682,7 @@ export type PreconditionScriptInput = {
/** Project models single repository on GitHub. */
export type Project = {
__typename?: "Project";
admins?: Maybe<Array<Maybe<Scalars["String"]["output"]>>>;
admins?: Maybe<Array<Scalars["String"]["output"]>>;
banner?: Maybe<ProjectBanner>;
batchTime: Scalars["Int"]["output"];
branch: Scalars["String"]["output"];
Expand Down Expand Up @@ -1813,9 +1836,7 @@ export type ProjectInput = {
gitTagAuthorizedUsers?: InputMaybe<Array<Scalars["String"]["input"]>>;
gitTagVersionsEnabled?: InputMaybe<Scalars["Boolean"]["input"]>;
githubChecksEnabled?: InputMaybe<Scalars["Boolean"]["input"]>;
githubTriggerAliases?: InputMaybe<
Array<InputMaybe<Scalars["String"]["input"]>>
>;
githubTriggerAliases?: InputMaybe<Array<Scalars["String"]["input"]>>;
id: Scalars["String"]["input"];
identifier?: InputMaybe<Scalars["String"]["input"]>;
manualPrTestingEnabled?: InputMaybe<Scalars["Boolean"]["input"]>;
Expand Down Expand Up @@ -1910,11 +1931,17 @@ export type ProjectVars = {
};

export type ProjectVarsInput = {
adminOnlyVarsList?: InputMaybe<Array<InputMaybe<Scalars["String"]["input"]>>>;
privateVarsList?: InputMaybe<Array<InputMaybe<Scalars["String"]["input"]>>>;
adminOnlyVarsList?: InputMaybe<Array<Scalars["String"]["input"]>>;
privateVarsList?: InputMaybe<Array<Scalars["String"]["input"]>>;
vars?: InputMaybe<Scalars["StringMap"]["input"]>;
};

/** PromoteVarsToRepoInput is the input to the promoteVarsToRepo mutation. */
export type PromoteVarsToRepoInput = {
projectId: Scalars["String"]["input"];
varNames: Array<Scalars["String"]["input"]>;
};

export enum Provider {
Docker = "DOCKER",
Ec2Fleet = "EC2_FLEET",
Expand All @@ -1940,13 +1967,13 @@ export type Query = {
awsRegions?: Maybe<Array<Scalars["String"]["output"]>>;
bbGetCreatedTickets: Array<JiraTicket>;
buildBaron: BuildBaron;
buildVariantsForTaskName?: Maybe<Array<Maybe<BuildVariantTuple>>>;
buildVariantsForTaskName?: Maybe<Array<BuildVariantTuple>>;
clientConfig?: Maybe<ClientConfig>;
commitQueue: CommitQueue;
distro?: Maybe<Distro>;
distroEvents: DistroEventsPayload;
distroTaskQueue: Array<TaskQueueItem>;
distros: Array<Maybe<Distro>>;
distros: Array<Distro>;
githubProjectConflicts: GithubProjectConflicts;
hasVersion: Scalars["Boolean"]["output"];
host?: Maybe<Host>;
Expand All @@ -1963,7 +1990,7 @@ export type Query = {
project: Project;
projectEvents: ProjectEvents;
projectSettings: ProjectSettings;
projects: Array<Maybe<GroupedProjects>>;
projects: Array<GroupedProjects>;
repoEvents: ProjectEvents;
repoSettings: RepoSettings;
spruceConfig?: Maybe<SpruceConfig>;
Expand All @@ -1977,7 +2004,7 @@ export type Query = {
userConfig?: Maybe<UserConfig>;
userSettings?: Maybe<UserSettings>;
version: Version;
viewableProjectRefs: Array<Maybe<GroupedProjects>>;
viewableProjectRefs: Array<GroupedProjects>;
};

export type QueryBbGetCreatedTicketsArgs = {
Expand Down Expand Up @@ -2068,12 +2095,14 @@ export type QueryProjectArgs = {

export type QueryProjectEventsArgs = {
before?: InputMaybe<Scalars["Time"]["input"]>;
identifier: Scalars["String"]["input"];
identifier?: InputMaybe<Scalars["String"]["input"]>;
limit?: InputMaybe<Scalars["Int"]["input"]>;
projectIdentifier?: InputMaybe<Scalars["String"]["input"]>;
};

export type QueryProjectSettingsArgs = {
identifier: Scalars["String"]["input"];
identifier?: InputMaybe<Scalars["String"]["input"]>;
projectIdentifier?: InputMaybe<Scalars["String"]["input"]>;
};

export type QueryRepoEventsArgs = {
Expand Down Expand Up @@ -2114,6 +2143,10 @@ export type QueryVersionArgs = {
versionId: Scalars["String"]["input"];
};

export type RemoveFavoriteProjectInput = {
projectIdentifier: Scalars["String"]["input"];
};

export type RepoCommitQueueParams = {
__typename?: "RepoCommitQueueParams";
enabled: Scalars["Boolean"]["output"];
Expand Down Expand Up @@ -3046,8 +3079,8 @@ export type Version = {
baseVersion?: Maybe<Version>;
branch: Scalars["String"]["output"];
buildVariantStats?: Maybe<Array<GroupedTaskStatusCount>>;
buildVariants?: Maybe<Array<Maybe<GroupedBuildVariant>>>;
childVersions?: Maybe<Array<Maybe<Version>>>;
buildVariants?: Maybe<Array<GroupedBuildVariant>>;
childVersions?: Maybe<Array<Version>>;
createTime: Scalars["Time"]["output"];
errors: Array<Scalars["String"]["output"]>;
externalLinksForMetadata: Array<ExternalLinkForMetadata>;
Expand Down Expand Up @@ -3171,7 +3204,7 @@ export type WebhookInput = {

export type WebhookSubscriber = {
__typename?: "WebhookSubscriber";
headers: Array<Maybe<WebhookHeader>>;
headers: Array<WebhookHeader>;
minDelayMs: Scalars["Int"]["output"];
retries: Scalars["Int"]["output"];
secret: Scalars["String"]["output"];
Expand All @@ -3180,7 +3213,7 @@ export type WebhookSubscriber = {
};

export type WebhookSubscriberInput = {
headers: Array<InputMaybe<WebhookHeaderInput>>;
headers: Array<WebhookHeaderInput>;
minDelayMs?: InputMaybe<Scalars["Int"]["input"]>;
retries?: InputMaybe<Scalars["Int"]["input"]>;
secret: Scalars["String"]["input"];
Expand Down
2 changes: 1 addition & 1 deletion apps/spruce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"ansi_up": "6.0.2",
"antd": "4.20.0",
"date-fns": "3.6.0",
"date-fns-tz": "2.0.0",
"date-fns-tz": "3.1.3",
"deep-object-diff": "1.1.9",
"env-cmd": "10.1.0",
"graphql": "16.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { PatchPageQueryParams, ALL_PATCH_STATUS } from "types/patch";
*/
export const usePatchesQueryParams = (): Omit<
Required<PatchesInput>,
"includeCommitQueue" | "onlyCommitQueue"
"includeCommitQueue" | "onlyCommitQueue" | "requesters"
> => {
const [patchName] = useQueryParam<string>(PatchPageQueryParams.PatchName, "");
const [rawStatuses] = useQueryParam<string[]>(
Expand Down
10 changes: 5 additions & 5 deletions apps/spruce/src/components/SpruceForm/Widgets/DateTimePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "@emotion/styled";
import { Description, Label } from "@leafygreen-ui/typography";
import { utcToZonedTime, zonedTimeToUtc } from "date-fns-tz";
import { toZonedTime, fromZonedTime } from "date-fns-tz";
import DatePicker from "components/DatePicker";
import AntdTimePicker from "components/TimePicker";
import { size } from "constants/tokens";
Expand All @@ -25,10 +25,10 @@ export const DateTimePicker: React.FC<
} = options;

const timezone = useUserTimeZone();
const currentDateTime = utcToZonedTime(new Date(value || null), timezone);
const currentDateTime = toZonedTime(new Date(value || null), timezone);
const isDisabled = disabled || readonly;
const handleChange = (d: Date) => {
onChange(zonedTimeToUtc(d, timezone).toString());
onChange(fromZonedTime(d, timezone).toString());
};

const disabledDate = (current) => {
Expand Down Expand Up @@ -94,12 +94,12 @@ export const TimePicker: React.FC<
} = options;
const timezone = useUserTimeZone();
const currentDateTime = useUtc
? utcToZonedTime(new Date(value || null), timezone)
? toZonedTime(new Date(value || null), timezone)
: new Date(value || null);
const isDisabled = disabled || readonly;
const handleChange = (d: Date) => {
if (useUtc) {
onChange(zonedTimeToUtc(d, timezone).toString());
onChange(fromZonedTime(d, timezone).toString());
} else {
onChange(d.toString());
}
Expand Down
Loading

0 comments on commit 3bdd275

Please sign in to comment.