Skip to content

Commit

Permalink
Linted client-side code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff McMillen authored and Jeff McMillen committed Dec 6, 2024
1 parent 7cbe3a6 commit 3ef04df
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 48 deletions.
20 changes: 7 additions & 13 deletions client/src/hooks/datafiles/mutations/useCompress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ import { useMutation } from '@tanstack/react-query';
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
import { getCompressParams } from 'utils/getCompressParams';
import { apiClient } from 'utils/apiClient';
import {
TTapisFile,
TPortalSystem,
} from 'utils/types';
import {
TJobBody,
TJobPostResponse
} from './useSubmitJob'
import { TTapisFile, TPortalSystem } from 'utils/types';
import { TJobBody, TJobPostResponse } from './useSubmitJob';

async function submitJobUtil(body: TJobBody) {
const res = await apiClient.post<TJobPostResponse>(
`/api/workspace/jobs`,
body
`/api/workspace/jobs`,
body
);
return res.data.response;
return res.data.response;
}

function useCompress() {
Expand Down Expand Up @@ -77,8 +71,8 @@ function useCompress() {
let defaultPrivateSystem: TPortalSystem | undefined;

if (files[0].scheme === 'private' && files[0].api === 'tapis') {
defaultPrivateSystem === null
};
defaultPrivateSystem === null;
}

if (scheme !== 'private' && scheme !== 'projects') {
defaultPrivateSystem = systems.find((s: any) => s.default);
Expand Down
69 changes: 34 additions & 35 deletions client/src/hooks/datafiles/mutations/useSubmitJob.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,57 @@
import {
TTapisSystem,
TAppFileInput,
TTapisJob,
TJobArgSpecs,
TJobKeyValuePair,
TTapisSystem,
TAppFileInput,
TTapisJob,
TJobArgSpecs,
TJobKeyValuePair,
} from 'utils/types';

export type TJobPostOperations = 'resubmitJob' | 'cancelJob' | 'submitJob';

export type TParameterSetSubmit = {
appArgs?: TJobArgSpecs;
containerArgs?: TJobArgSpecs;
schedulerOptions?: TJobArgSpecs;
envVariables?: TJobKeyValuePair[];
appArgs?: TJobArgSpecs;
containerArgs?: TJobArgSpecs;
schedulerOptions?: TJobArgSpecs;
envVariables?: TJobKeyValuePair[];
};

export type TConfigurationValues = {
execSystemId?: string;
execSystemLogicalQueue?: string;
maxMinutes?: number;
nodeCount?: number;
coresPerNode?: number;
allocation?: string;
memoryMB?: number;
execSystemId?: string;
execSystemLogicalQueue?: string;
maxMinutes?: number;
nodeCount?: number;
coresPerNode?: number;
allocation?: string;
memoryMB?: number;
};

export type TOutputValues = {
name: string;
archiveSystemId?: string;
archiveSystemDir?: string;
name: string;
archiveSystemId?: string;
archiveSystemDir?: string;
};

export interface TJobSubmit extends TConfigurationValues, TOutputValues {
archiveOnAppError?: boolean;
appId: string;
fileInputs?: TAppFileInput[];
parameterSet?: TParameterSetSubmit;
};
archiveOnAppError?: boolean;
appId: string;
fileInputs?: TAppFileInput[];
parameterSet?: TParameterSetSubmit;
}

export type TJobBody = {
operation?: TJobPostOperations;
uuid?: string;
job: TJobSubmit;
licenseType?: string;
isInteractive?: boolean;
execSystemId?: string;
operation?: TJobPostOperations;
uuid?: string;
job: TJobSubmit;
licenseType?: string;
isInteractive?: boolean;
execSystemId?: string;
};

export interface IJobPostResponse extends TTapisJob {
execSys?: TTapisSystem;
execSys?: TTapisSystem;
}

export type TJobPostResponse = {
response: IJobPostResponse;
status: number;
response: IJobPostResponse;
status: number;
};

0 comments on commit 3ef04df

Please sign in to comment.