diff --git a/src/api/generated/index.ts b/src/api/generated/index.ts index 91914d6..a48b0a9 100644 --- a/src/api/generated/index.ts +++ b/src/api/generated/index.ts @@ -28,6 +28,7 @@ export type { AnalogueModelDetail } from './models/AnalogueModelDetail'; export type { AnalogueModelImageDto } from './models/AnalogueModelImageDto'; export type { AnalogueModelList } from './models/AnalogueModelList'; export { AnalogueModelSourceType } from './models/AnalogueModelSourceType'; +export type { CancelJobDto } from './models/CancelJobDto'; export type { ComputeCaseComputeMethodDto } from './models/ComputeCaseComputeMethodDto'; export type { ComputeCaseDto } from './models/ComputeCaseDto'; export type { ComputeCaseInputSettingsDto } from './models/ComputeCaseInputSettingsDto'; @@ -119,6 +120,8 @@ export type { ParameterList } from './models/ParameterList'; export type { PatchAnalogueModelCommandResponse } from './models/PatchAnalogueModelCommandResponse'; export type { PatchAnalogueModelDto } from './models/PatchAnalogueModelDto'; export type { PercentilesDto } from './models/PercentilesDto'; +export type { PostCancelJobCommand } from './models/PostCancelJobCommand'; +export type { PostCancelJobCommandResponse } from './models/PostCancelJobCommandResponse'; export type { PrepareChunkedUploadCommandResponse } from './models/PrepareChunkedUploadCommandResponse'; export type { PrepareChunkedUploadDto } from './models/PrepareChunkedUploadDto'; export type { ProblemDetails } from './models/ProblemDetails'; diff --git a/src/api/generated/models/CancelJobDto.ts b/src/api/generated/models/CancelJobDto.ts new file mode 100644 index 0000000..829b454 --- /dev/null +++ b/src/api/generated/models/CancelJobDto.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { JobStatus } from './JobStatus'; +import type { JobType } from './JobType'; + +export type CancelJobDto = { + jobId: string; + name: string; + jobStatus: JobStatus; + jobType: JobType; +}; + diff --git a/src/api/generated/models/PostCancelJobCommand.ts b/src/api/generated/models/PostCancelJobCommand.ts new file mode 100644 index 0000000..418b925 --- /dev/null +++ b/src/api/generated/models/PostCancelJobCommand.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PostCancelJobCommand = { + modelId: string; + computeCaseId: string; +}; + diff --git a/src/api/generated/models/PostCancelJobCommandResponse.ts b/src/api/generated/models/PostCancelJobCommandResponse.ts new file mode 100644 index 0000000..2faf605 --- /dev/null +++ b/src/api/generated/models/PostCancelJobCommandResponse.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { CancelJobDto } from './CancelJobDto'; + +export type PostCancelJobCommandResponse = { + success?: boolean; + count?: number | null; + message?: string | null; + validationErrors?: Array | null; + data: CancelJobDto; +}; + diff --git a/src/api/generated/services/JobsService.ts b/src/api/generated/services/JobsService.ts index d4ea189..1b703a0 100644 --- a/src/api/generated/services/JobsService.ts +++ b/src/api/generated/services/JobsService.ts @@ -14,6 +14,8 @@ import type { GetCurrentJobStatusCommandResponse } from '../models/GetCurrentJob import type { GetCurrentJobStatusListCommand } from '../models/GetCurrentJobStatusListCommand'; import type { GetJobDetailQueryResponse } from '../models/GetJobDetailQueryResponse'; import type { GetJobListQueryResponse } from '../models/GetJobListQueryResponse'; +import type { PostCancelJobCommand } from '../models/PostCancelJobCommand'; +import type { PostCancelJobCommandResponse } from '../models/PostCancelJobCommandResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; @@ -95,6 +97,27 @@ export class JobsService { }); } + /** + * Cancel the running job. + * @param requestBody + * @returns PostCancelJobCommandResponse Accepted + * @throws ApiError + */ + public static postApiJobsCancel( + requestBody?: PostCancelJobCommand, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/jobs/cancel', + body: requestBody, + mediaType: 'application/json-patch+json', + errors: { + 403: `Forbidden`, + 404: `Not Found`, + }, + }); + } + /** * Convert AnalogueModels to the internal format used by PEPM in order to perform calculations. * @param requestBody diff --git a/src/components/AreaCoordinates/AreaCoordinates.tsx b/src/components/AreaCoordinates/AreaCoordinates.tsx index 61cf83f..0c2808f 100644 --- a/src/components/AreaCoordinates/AreaCoordinates.tsx +++ b/src/components/AreaCoordinates/AreaCoordinates.tsx @@ -259,7 +259,7 @@ export const AreaCoordinates = ({ setEdit(!edit); }; - const handleCancleEdit = () => { + const handleCancelEdit = () => { fallbackAreaCoordinate && setAreaCoordinate(cloneDeep(fallbackAreaCoordinate)); @@ -352,7 +352,7 @@ export const AreaCoordinates = ({ {edit ? ( <> - diff --git a/src/components/ConfirmDialog/ConfirmDialog.tsx b/src/components/ConfirmDialog/ConfirmDialog.tsx index 6b004e9..3e81fe6 100644 --- a/src/components/ConfirmDialog/ConfirmDialog.tsx +++ b/src/components/ConfirmDialog/ConfirmDialog.tsx @@ -25,7 +25,7 @@ export const ConfirmDialog = ({ color={danger ? 'danger' : undefined} onClick={() => setIsOpen(false)} > - {'Cancle'} + {'Cancel'}