From 31827860a505ff41b7674ae3877101f86d2cfd24 Mon Sep 17 00:00:00 2001 From: Wilhelm Vold <43452613+Sinrefvol@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:59:20 +0200 Subject: [PATCH] fix: script update (#295) * fix: updated generated API models and tweaked the code to work with the changes * fix: updated naming --- src/api/generated/index.ts | 20 ++++++++-------- src/api/generated/models/ComputeType.ts | 1 + .../DeleteGeologicalGroupCommandResponse.ts | 13 +++++++++++ ...DeleteStratigraphicGroupCommandResponse.ts | 13 +++++++++++ ...nelCommand.ts => EstimateObjectCommand.ts} | 2 +- .../generated/models/GetChannelResultsDto.ts | 23 ------------------- ...GetObjectResultsByModelIdQueryResponse.ts} | 6 ++--- .../generated/models/GetObjectResultsDto.ts | 23 +++++++++++++++++++ ...sFileDto.ts => GetObjectResultsFileDto.ts} | 4 ++-- ...ultDto.ts => ObjectEstimationResultDto.ts} | 2 +- ...ChannelHeightDto.ts => ObjectHeightDto.ts} | 2 +- ...=> UpdateObjectEstimationStatusCommand.ts} | 2 +- ...eObjectEstimationStatusCommandResponse.ts} | 6 ++--- ....ts => UpdateObjectEstimationStatusDto.ts} | 2 +- .../services/AnalogueModelsService.ts | 10 ++++---- src/api/generated/services/JobsService.ts | 8 +++---- src/api/generated/services/ResultsService.ts | 10 ++++---- src/api/generated/services/WebhooksService.ts | 14 +++++------ .../GrossDepositionEnviromentGroup.tsx | 5 +++- .../StratigrapicGroups/StratigrapicGroups.tsx | 9 ++++++-- src/features/Compute/CaseGroup/CaseGroup.tsx | 8 +++++++ .../CaseResultView/CaseResultView.tsx | 4 ++-- .../ObjectCaseResult/ChannelResult.tsx | 4 ++-- .../ChannelResultTable/ChannelResultTable.tsx | 22 +++++++----------- .../ResultArea/ResultArea.tsx | 4 ++-- src/hooks/useFetchChannelResults.ts | 6 ++--- .../Compute/ComputeObject/ComputeObject.tsx | 10 +++++--- .../Results/ObjectResult/ObjectResult.tsx | 4 ++-- 28 files changed, 141 insertions(+), 96 deletions(-) create mode 100644 src/api/generated/models/DeleteGeologicalGroupCommandResponse.ts create mode 100644 src/api/generated/models/DeleteStratigraphicGroupCommandResponse.ts rename src/api/generated/models/{EstimateChannelCommand.ts => EstimateObjectCommand.ts} (82%) delete mode 100644 src/api/generated/models/GetChannelResultsDto.ts rename src/api/generated/models/{GetChanelResultsByModelIdQueryResponse.ts => GetObjectResultsByModelIdQueryResponse.ts} (61%) create mode 100644 src/api/generated/models/GetObjectResultsDto.ts rename src/api/generated/models/{GetChannelResultsFileDto.ts => GetObjectResultsFileDto.ts} (68%) rename src/api/generated/models/{ChannelEstimationResultDto.ts => ObjectEstimationResultDto.ts} (81%) rename src/api/generated/models/{ChannelHeightDto.ts => ObjectHeightDto.ts} (87%) rename src/api/generated/models/{UpdateChannelEstimationStatusCommand.ts => UpdateObjectEstimationStatusCommand.ts} (86%) rename src/api/generated/models/{UpdateChannelEstimationStatusCommandResponse.ts => UpdateObjectEstimationStatusCommandResponse.ts} (56%) rename src/api/generated/models/{UpdateChannelEstimationStatusDto.ts => UpdateObjectEstimationStatusDto.ts} (86%) diff --git a/src/api/generated/index.ts b/src/api/generated/index.ts index 8413ca79..03ed4b20 100644 --- a/src/api/generated/index.ts +++ b/src/api/generated/index.ts @@ -31,8 +31,6 @@ export type { AnalogueList } from './models/AnalogueList'; export type { AnalogueModelDetail } from './models/AnalogueModelDetail'; export type { AnalogueModelList } from './models/AnalogueModelList'; export { AnalogueModelSourceType } from './models/AnalogueModelSourceType'; -export type { ChannelEstimationResultDto } from './models/ChannelEstimationResultDto'; -export type { ChannelHeightDto } from './models/ChannelHeightDto'; export type { ComputeCaseComputeMethodDto } from './models/ComputeCaseComputeMethodDto'; export type { ComputeCaseDto } from './models/ComputeCaseDto'; export type { ComputeCaseInputSettingsDto } from './models/ComputeCaseInputSettingsDto'; @@ -53,8 +51,10 @@ export type { CreateComputeCaseCommandResponse } from './models/CreateComputeCas export type { CreateComputeCaseInputSettingsForm } from './models/CreateComputeCaseInputSettingsForm'; export type { CreateMetadataCommandForm } from './models/CreateMetadataCommandForm'; export type { CreateParameterCommand } from './models/CreateParameterCommand'; +export type { DeleteGeologicalGroupCommandResponse } from './models/DeleteGeologicalGroupCommandResponse'; +export type { DeleteStratigraphicGroupCommandResponse } from './models/DeleteStratigraphicGroupCommandResponse'; export type { ErrorResponse } from './models/ErrorResponse'; -export type { EstimateChannelCommand } from './models/EstimateChannelCommand'; +export type { EstimateObjectCommand } from './models/EstimateObjectCommand'; export type { EstimateVariogramCommand } from './models/EstimateVariogramCommand'; export type { FieldDto } from './models/FieldDto'; export type { File } from './models/File'; @@ -63,14 +63,14 @@ export type { GeologicalStandardDto } from './models/GeologicalStandardDto'; export type { GetAnalogueListQueryResponse } from './models/GetAnalogueListQueryResponse'; export type { GetAnalogueModelListQueryResponse } from './models/GetAnalogueModelListQueryResponse'; export type { GetAnalogueModelQueryResponse } from './models/GetAnalogueModelQueryResponse'; -export type { GetChanelResultsByModelIdQueryResponse } from './models/GetChanelResultsByModelIdQueryResponse'; -export type { GetChannelResultsDto } from './models/GetChannelResultsDto'; -export type { GetChannelResultsFileDto } from './models/GetChannelResultsFileDto'; export type { GetCurrentJobStatusCommandResponse } from './models/GetCurrentJobStatusCommandResponse'; export type { GetCurrentJobStatusDto } from './models/GetCurrentJobStatusDto'; export type { GetCurrentJobStatusListCommand } from './models/GetCurrentJobStatusListCommand'; export type { GetJobDetailQueryResponse } from './models/GetJobDetailQueryResponse'; export type { GetJobListQueryResponse } from './models/GetJobListQueryResponse'; +export type { GetObjectResultsByModelIdQueryResponse } from './models/GetObjectResultsByModelIdQueryResponse'; +export type { GetObjectResultsDto } from './models/GetObjectResultsDto'; +export type { GetObjectResultsFileDto } from './models/GetObjectResultsFileDto'; export type { GetParameterDetailQueryResponse } from './models/GetParameterDetailQueryResponse'; export type { GetParameterListQueryResponse } from './models/GetParameterListQueryResponse'; export type { GetUploadDetailQueryResponse } from './models/GetUploadDetailQueryResponse'; @@ -103,6 +103,8 @@ export type { MetadataDto } from './models/MetadataDto'; export type { MetadataTypeDto } from './models/MetadataTypeDto'; export type { ModelAreaDto } from './models/ModelAreaDto'; export type { ModelAreaTypeDto } from './models/ModelAreaTypeDto'; +export type { ObjectEstimationResultDto } from './models/ObjectEstimationResultDto'; +export type { ObjectHeightDto } from './models/ObjectHeightDto'; export type { Operation } from './models/Operation'; export { OperationType } from './models/OperationType'; export type { ParameterDetail } from './models/ParameterDetail'; @@ -121,14 +123,14 @@ export type { UpdateAnalogueModelAreaCommandForm } from './models/UpdateAnalogue export type { UpdateAnalogueModelCommandBody } from './models/UpdateAnalogueModelCommandBody'; export type { UpdateAnalogueModelCommandResponse } from './models/UpdateAnalogueModelCommandResponse'; export type { UpdateAnalogueModelDto } from './models/UpdateAnalogueModelDto'; -export type { UpdateChannelEstimationStatusCommand } from './models/UpdateChannelEstimationStatusCommand'; -export type { UpdateChannelEstimationStatusCommandResponse } from './models/UpdateChannelEstimationStatusCommandResponse'; -export type { UpdateChannelEstimationStatusDto } from './models/UpdateChannelEstimationStatusDto'; export type { UpdateComputeCaseCommandForm } from './models/UpdateComputeCaseCommandForm'; export type { UpdateComputeCaseInputSettingsForm } from './models/UpdateComputeCaseInputSettingsForm'; export type { UpdateJobStatusCommand } from './models/UpdateJobStatusCommand'; export type { UpdateJobStatusCommandResponse } from './models/UpdateJobStatusCommandResponse'; export type { UpdateJobStatusDto } from './models/UpdateJobStatusDto'; +export type { UpdateObjectEstimationStatusCommand } from './models/UpdateObjectEstimationStatusCommand'; +export type { UpdateObjectEstimationStatusCommandResponse } from './models/UpdateObjectEstimationStatusCommandResponse'; +export type { UpdateObjectEstimationStatusDto } from './models/UpdateObjectEstimationStatusDto'; export type { UpdateParameterCommandBody } from './models/UpdateParameterCommandBody'; export type { UpdateParameterCommandResponse } from './models/UpdateParameterCommandResponse'; export type { UpdateParameterDto } from './models/UpdateParameterDto'; diff --git a/src/api/generated/models/ComputeType.ts b/src/api/generated/models/ComputeType.ts index e951eedd..133cc442 100644 --- a/src/api/generated/models/ComputeType.ts +++ b/src/api/generated/models/ComputeType.ts @@ -6,4 +6,5 @@ export enum ComputeType { VARIOGRAM = 'Variogram', CHANNEL = 'Channel', + MOUTHBAR = 'Mouthbar', } diff --git a/src/api/generated/models/DeleteGeologicalGroupCommandResponse.ts b/src/api/generated/models/DeleteGeologicalGroupCommandResponse.ts new file mode 100644 index 00000000..fda943e5 --- /dev/null +++ b/src/api/generated/models/DeleteGeologicalGroupCommandResponse.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type DeleteGeologicalGroupCommandResponse = { + success?: boolean; + count?: number | null; + message?: string | null; + validationErrors?: Array | null; + data: string; +}; + diff --git a/src/api/generated/models/DeleteStratigraphicGroupCommandResponse.ts b/src/api/generated/models/DeleteStratigraphicGroupCommandResponse.ts new file mode 100644 index 00000000..f6f3aabb --- /dev/null +++ b/src/api/generated/models/DeleteStratigraphicGroupCommandResponse.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type DeleteStratigraphicGroupCommandResponse = { + success?: boolean; + count?: number | null; + message?: string | null; + validationErrors?: Array | null; + data: string; +}; + diff --git a/src/api/generated/models/EstimateChannelCommand.ts b/src/api/generated/models/EstimateObjectCommand.ts similarity index 82% rename from src/api/generated/models/EstimateChannelCommand.ts rename to src/api/generated/models/EstimateObjectCommand.ts index 2ffc8c8b..ec55be55 100644 --- a/src/api/generated/models/EstimateChannelCommand.ts +++ b/src/api/generated/models/EstimateObjectCommand.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ -export type EstimateChannelCommand = { +export type EstimateObjectCommand = { modelId: string; computeCaseId: string; }; diff --git a/src/api/generated/models/GetChannelResultsDto.ts b/src/api/generated/models/GetChannelResultsDto.ts deleted file mode 100644 index f3179715..00000000 --- a/src/api/generated/models/GetChannelResultsDto.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { ChannelEstimationResultDto } from './ChannelEstimationResultDto'; -import type { ChannelHeightDto } from './ChannelHeightDto'; -import type { ComputeType } from './ComputeType'; -import type { CoordinateDto } from './CoordinateDto'; -import type { GetChannelResultsFileDto } from './GetChannelResultsFileDto'; - -export type GetChannelResultsDto = { - channelResultId: string; - computeCaseId: string; - type: ComputeType; - channelResultFiles: Array; - segmentWidth: ChannelEstimationResultDto; - channelWidth: ChannelEstimationResultDto; - segmentHeight: ChannelEstimationResultDto; - channelHeight: ChannelHeightDto; - box: Array; -}; - diff --git a/src/api/generated/models/GetChanelResultsByModelIdQueryResponse.ts b/src/api/generated/models/GetObjectResultsByModelIdQueryResponse.ts similarity index 61% rename from src/api/generated/models/GetChanelResultsByModelIdQueryResponse.ts rename to src/api/generated/models/GetObjectResultsByModelIdQueryResponse.ts index c368924e..cdc1d592 100644 --- a/src/api/generated/models/GetChanelResultsByModelIdQueryResponse.ts +++ b/src/api/generated/models/GetObjectResultsByModelIdQueryResponse.ts @@ -3,13 +3,13 @@ /* tslint:disable */ /* eslint-disable */ -import type { GetChannelResultsDto } from './GetChannelResultsDto'; +import type { GetObjectResultsDto } from './GetObjectResultsDto'; -export type GetChanelResultsByModelIdQueryResponse = { +export type GetObjectResultsByModelIdQueryResponse = { success?: boolean; count?: number | null; message?: string | null; validationErrors?: Array | null; - data: Array; + data: Array; }; diff --git a/src/api/generated/models/GetObjectResultsDto.ts b/src/api/generated/models/GetObjectResultsDto.ts new file mode 100644 index 00000000..c5e0a7c3 --- /dev/null +++ b/src/api/generated/models/GetObjectResultsDto.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ComputeType } from './ComputeType'; +import type { CoordinateDto } from './CoordinateDto'; +import type { GetObjectResultsFileDto } from './GetObjectResultsFileDto'; +import type { ObjectEstimationResultDto } from './ObjectEstimationResultDto'; +import type { ObjectHeightDto } from './ObjectHeightDto'; + +export type GetObjectResultsDto = { + objectResultId: string; + computeCaseId: string; + type: ComputeType; + objectResultFiles: Array; + segmentWidth: ObjectEstimationResultDto; + width: ObjectEstimationResultDto; + segmentHeight: ObjectEstimationResultDto; + height: ObjectHeightDto; + box: Array; +}; + diff --git a/src/api/generated/models/GetChannelResultsFileDto.ts b/src/api/generated/models/GetObjectResultsFileDto.ts similarity index 68% rename from src/api/generated/models/GetChannelResultsFileDto.ts rename to src/api/generated/models/GetObjectResultsFileDto.ts index 120f2551..6137fb97 100644 --- a/src/api/generated/models/GetChannelResultsFileDto.ts +++ b/src/api/generated/models/GetObjectResultsFileDto.ts @@ -3,8 +3,8 @@ /* tslint:disable */ /* eslint-disable */ -export type GetChannelResultsFileDto = { +export type GetObjectResultsFileDto = { fileName: string; - channelResultFileId: string; + objectResultFileId: string; }; diff --git a/src/api/generated/models/ChannelEstimationResultDto.ts b/src/api/generated/models/ObjectEstimationResultDto.ts similarity index 81% rename from src/api/generated/models/ChannelEstimationResultDto.ts rename to src/api/generated/models/ObjectEstimationResultDto.ts index 5c628e16..380cb37f 100644 --- a/src/api/generated/models/ChannelEstimationResultDto.ts +++ b/src/api/generated/models/ObjectEstimationResultDto.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ -export type ChannelEstimationResultDto = { +export type ObjectEstimationResultDto = { mean: number; sd: number; count: number; diff --git a/src/api/generated/models/ChannelHeightDto.ts b/src/api/generated/models/ObjectHeightDto.ts similarity index 87% rename from src/api/generated/models/ChannelHeightDto.ts rename to src/api/generated/models/ObjectHeightDto.ts index b9db42a3..772f3a4c 100644 --- a/src/api/generated/models/ChannelHeightDto.ts +++ b/src/api/generated/models/ObjectHeightDto.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ -export type ChannelHeightDto = { +export type ObjectHeightDto = { mean: number; sd: number; count: number; diff --git a/src/api/generated/models/UpdateChannelEstimationStatusCommand.ts b/src/api/generated/models/UpdateObjectEstimationStatusCommand.ts similarity index 86% rename from src/api/generated/models/UpdateChannelEstimationStatusCommand.ts rename to src/api/generated/models/UpdateObjectEstimationStatusCommand.ts index d25fb670..b7b80e2c 100644 --- a/src/api/generated/models/UpdateChannelEstimationStatusCommand.ts +++ b/src/api/generated/models/UpdateObjectEstimationStatusCommand.ts @@ -5,7 +5,7 @@ import type { RadixJobDto } from './RadixJobDto'; -export type UpdateChannelEstimationStatusCommand = { +export type UpdateObjectEstimationStatusCommand = { name: string; started?: string | null; ended?: string | null; diff --git a/src/api/generated/models/UpdateChannelEstimationStatusCommandResponse.ts b/src/api/generated/models/UpdateObjectEstimationStatusCommandResponse.ts similarity index 56% rename from src/api/generated/models/UpdateChannelEstimationStatusCommandResponse.ts rename to src/api/generated/models/UpdateObjectEstimationStatusCommandResponse.ts index 40f8bb2a..fa8be94b 100644 --- a/src/api/generated/models/UpdateChannelEstimationStatusCommandResponse.ts +++ b/src/api/generated/models/UpdateObjectEstimationStatusCommandResponse.ts @@ -3,13 +3,13 @@ /* tslint:disable */ /* eslint-disable */ -import type { UpdateChannelEstimationStatusDto } from './UpdateChannelEstimationStatusDto'; +import type { UpdateObjectEstimationStatusDto } from './UpdateObjectEstimationStatusDto'; -export type UpdateChannelEstimationStatusCommandResponse = { +export type UpdateObjectEstimationStatusCommandResponse = { success?: boolean; count?: number | null; message?: string | null; validationErrors?: Array | null; - data: Array; + data: Array; }; diff --git a/src/api/generated/models/UpdateChannelEstimationStatusDto.ts b/src/api/generated/models/UpdateObjectEstimationStatusDto.ts similarity index 86% rename from src/api/generated/models/UpdateChannelEstimationStatusDto.ts rename to src/api/generated/models/UpdateObjectEstimationStatusDto.ts index a5107dae..e83111ad 100644 --- a/src/api/generated/models/UpdateChannelEstimationStatusDto.ts +++ b/src/api/generated/models/UpdateObjectEstimationStatusDto.ts @@ -6,7 +6,7 @@ import type { JobStatus } from './JobStatus'; import type { JobType } from './JobType'; -export type UpdateChannelEstimationStatusDto = { +export type UpdateObjectEstimationStatusDto = { jobId: string; name: string; jobStatus: JobStatus; diff --git a/src/api/generated/services/AnalogueModelsService.ts b/src/api/generated/services/AnalogueModelsService.ts index f4f414db..183dc1ab 100644 --- a/src/api/generated/services/AnalogueModelsService.ts +++ b/src/api/generated/services/AnalogueModelsService.ts @@ -10,6 +10,8 @@ import type { AddStatigraphicGroupForm } from '../models/AddStatigraphicGroupFor import type { AddStratigraphicGroupCommandResponse } from '../models/AddStratigraphicGroupCommandResponse'; import type { CreateAnalogueModelCommand } from '../models/CreateAnalogueModelCommand'; import type { CreateAnalogueModelCommandResponse } from '../models/CreateAnalogueModelCommandResponse'; +import type { DeleteGeologicalGroupCommandResponse } from '../models/DeleteGeologicalGroupCommandResponse'; +import type { DeleteStratigraphicGroupCommandResponse } from '../models/DeleteStratigraphicGroupCommandResponse'; import type { GetAnalogueModelListQueryResponse } from '../models/GetAnalogueModelListQueryResponse'; import type { GetAnalogueModelQueryResponse } from '../models/GetAnalogueModelQueryResponse'; import type { Operation } from '../models/Operation'; @@ -289,13 +291,13 @@ export class AnalogueModelsService { * Deletes a geological group * @param analogueModelId * @param geologicalGroupId - * @returns void + * @returns DeleteGeologicalGroupCommandResponse Success * @throws ApiError */ public static deleteApiAnalogueModelsGeologicalGroups( analogueModelId: string, geologicalGroupId: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/analogue-models/{analogueModelId}/geological-groups/{geologicalGroupId}', @@ -314,13 +316,13 @@ export class AnalogueModelsService { * Deletes a stratigraphic group * @param analogueModelId * @param stratigraphicGroupId - * @returns void + * @returns DeleteStratigraphicGroupCommandResponse Success * @throws ApiError */ public static deleteApiAnalogueModelsStratigraphicGroups( analogueModelId: string, stratigraphicGroupId: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/analogue-models/{analogueModelId}/stratigraphic-groups/{stratigraphicGroupId}', diff --git a/src/api/generated/services/JobsService.ts b/src/api/generated/services/JobsService.ts index baa309a5..fe4b90f9 100644 --- a/src/api/generated/services/JobsService.ts +++ b/src/api/generated/services/JobsService.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { ConvertAnalogueModelCommand } from '../models/ConvertAnalogueModelCommand'; -import type { EstimateChannelCommand } from '../models/EstimateChannelCommand'; +import type { EstimateObjectCommand } from '../models/EstimateObjectCommand'; import type { EstimateVariogramCommand } from '../models/EstimateVariogramCommand'; import type { GetCurrentJobStatusCommandResponse } from '../models/GetCurrentJobStatusCommandResponse'; import type { GetCurrentJobStatusListCommand } from '../models/GetCurrentJobStatusListCommand'; @@ -97,12 +97,12 @@ export class JobsService { * @returns any Accepted * @throws ApiError */ - public static postApiJobsComputeChannelEstimations( - requestBody?: EstimateChannelCommand, + public static postApiJobsComputeObjectEstimations( + requestBody?: EstimateObjectCommand, ): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/api/jobs/compute/channel-estimations', + url: '/api/jobs/compute/object-estimations', body: requestBody, mediaType: 'application/json-patch+json', }); diff --git a/src/api/generated/services/ResultsService.ts b/src/api/generated/services/ResultsService.ts index 39e79809..c0ca03dc 100644 --- a/src/api/generated/services/ResultsService.ts +++ b/src/api/generated/services/ResultsService.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { GetChanelResultsByModelIdQueryResponse } from '../models/GetChanelResultsByModelIdQueryResponse'; +import type { GetObjectResultsByModelIdQueryResponse } from '../models/GetObjectResultsByModelIdQueryResponse'; import type { GetVariogramResultsByModelIdQueryResponse } from '../models/GetVariogramResultsByModelIdQueryResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; @@ -14,15 +14,15 @@ export class ResultsService { /** * Returns channel estimation results * @param id - * @returns GetChanelResultsByModelIdQueryResponse Success + * @returns GetObjectResultsByModelIdQueryResponse Success * @throws ApiError */ - public static getApiAnalogueModelsResultsChannel( + public static getApiAnalogueModelsResultsObject( id: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/api/analogue-models/{id}/results/channel', + url: '/api/analogue-models/{id}/results/object', path: { 'id': id, }, diff --git a/src/api/generated/services/WebhooksService.ts b/src/api/generated/services/WebhooksService.ts index 56bc5bae..6aa6e08d 100644 --- a/src/api/generated/services/WebhooksService.ts +++ b/src/api/generated/services/WebhooksService.ts @@ -2,10 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { UpdateChannelEstimationStatusCommand } from '../models/UpdateChannelEstimationStatusCommand'; -import type { UpdateChannelEstimationStatusCommandResponse } from '../models/UpdateChannelEstimationStatusCommandResponse'; import type { UpdateJobStatusCommand } from '../models/UpdateJobStatusCommand'; import type { UpdateJobStatusCommandResponse } from '../models/UpdateJobStatusCommandResponse'; +import type { UpdateObjectEstimationStatusCommand } from '../models/UpdateObjectEstimationStatusCommand'; +import type { UpdateObjectEstimationStatusCommandResponse } from '../models/UpdateObjectEstimationStatusCommandResponse'; import type { UpdateVariogramEstimationStatusCommand } from '../models/UpdateVariogramEstimationStatusCommand'; import type { CancelablePromise } from '../core/CancelablePromise'; @@ -33,12 +33,12 @@ export class WebhooksService { /** * @param requestBody - * @returns UpdateChannelEstimationStatusCommandResponse Success + * @returns UpdateObjectEstimationStatusCommandResponse Success * @throws ApiError */ public static postApiWebhooksChannestStatus( - requestBody?: UpdateChannelEstimationStatusCommand, - ): CancelablePromise { + requestBody?: UpdateObjectEstimationStatusCommand, + ): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/webhooks/channest/status', @@ -49,12 +49,12 @@ export class WebhooksService { /** * @param requestBody - * @returns UpdateChannelEstimationStatusCommandResponse Success + * @returns UpdateObjectEstimationStatusCommandResponse Success * @throws ApiError */ public static postApiWebhooksVargrestStatus( requestBody?: UpdateVariogramEstimationStatusCommand, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/webhooks/vargrest/status', diff --git a/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx b/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx index f28c8202..80ab904c 100644 --- a/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx +++ b/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx @@ -13,6 +13,7 @@ import { AddGeologicalGroupForm, AnalogueModelDetail, AnalogueModelsService, + DeleteGeologicalGroupCommandResponse, GeologicalGroupDto, GeologicalStandardDto, } from '../../../api/generated'; @@ -41,7 +42,9 @@ export const GrossDepositionEnviromentGroup = ({ modelIdParent?: string; defaultMetadata: AnalogueModelDetail; gdeGroups: GeologicalGroupDto[]; - deleteGdeRow: (geologicalGroupId: string) => Promise; + deleteGdeRow: ( + geologicalGroupId: string, + ) => Promise; }) => { const [showGdeDialog, setShowGdeDialog] = useState(false); const [gdeObject, setGdeObject] = useState(defaultGdeData); diff --git a/src/components/StrategraphicColumn/StratigrapicGroups/StratigrapicGroups.tsx b/src/components/StrategraphicColumn/StratigrapicGroups/StratigrapicGroups.tsx index d4d6d02d..50ec3fbe 100644 --- a/src/components/StrategraphicColumn/StratigrapicGroups/StratigrapicGroups.tsx +++ b/src/components/StrategraphicColumn/StratigrapicGroups/StratigrapicGroups.tsx @@ -1,7 +1,10 @@ /* eslint-disable max-lines-per-function */ import { Button, Icon, Table, Typography } from '@equinor/eds-core-react'; import { delete_to_trash as deleteIcon } from '@equinor/eds-icons'; -import { StratigraphicGroupDto } from '../../../api/generated'; +import { + DeleteStratigraphicGroupCommandResponse, + StratigraphicGroupDto, +} from '../../../api/generated'; import * as Styled from './StratigrapicGroups.styled'; export const StratigrapicGroups = ({ @@ -11,7 +14,9 @@ export const StratigrapicGroups = ({ }: { stratColumnGroups: StratigraphicGroupDto[]; handleStratColDialog: () => void; - deleteStratColRow: (stratigraphicGroupId: string) => Promise; + deleteStratColRow: ( + stratigraphicGroupId: string, + ) => Promise; }) => { const filterUnitLevel = (row: StratigraphicGroupDto, level: number) => { return row.stratUnits.filter((unit) => unit.level === level); diff --git a/src/features/Compute/CaseGroup/CaseGroup.tsx b/src/features/Compute/CaseGroup/CaseGroup.tsx index 20f3e970..712d6c15 100644 --- a/src/features/Compute/CaseGroup/CaseGroup.tsx +++ b/src/features/Compute/CaseGroup/CaseGroup.tsx @@ -115,6 +115,7 @@ export const CaseGroup = ({ } }; + const mouthbarSettings = settingsFilter('Mouthbar'); const channelSettings = settingsFilter('Channel'); const indicatorSettings = settingsFilter('Indicator'); const NetToGrossSettings = settingsFilter('Net-To-Gross'); @@ -151,6 +152,9 @@ export const CaseGroup = ({ let methodId = undefined; switch (methodType) { + case 'Mouthbar': + methodId = mouthbarSettings && mouthbarSettings[0].computeMethodId; + break; case 'Channel': methodId = channelSettings && channelSettings[0].computeMethodId; break; @@ -190,6 +194,9 @@ export const CaseGroup = ({ }; switch (methodType) { + case 'Mouthbar': + setListItem('Mouthbar', newCase); + break; case 'Channel': setListItem('Channel', newCase); break; @@ -206,6 +213,7 @@ export const CaseGroup = ({ } }, [ + mouthbarSettings, ContiniousParameterSettings, NetToGrossSettings, channelSettings, diff --git a/src/features/Results/CaseResult/CaseResultView/CaseResultView.tsx b/src/features/Results/CaseResult/CaseResultView/CaseResultView.tsx index dfdeb7f9..610ab191 100644 --- a/src/features/Results/CaseResult/CaseResultView/CaseResultView.tsx +++ b/src/features/Results/CaseResult/CaseResultView/CaseResultView.tsx @@ -4,7 +4,7 @@ import * as Styled from './CaseResultView.styled'; import { Typography } from '@equinor/eds-core-react'; import { ComputeCaseDto, - GetChannelResultsDto, + GetObjectResultsDto, GetVariogramResultsDto, } from '../../../../api/generated'; import { ChannelResult } from './ObjectCaseResult/ChannelResult'; @@ -15,7 +15,7 @@ export const CaseResultView = ({ variogramResultList, computeCases, }: { - channelResultList?: GetChannelResultsDto[]; + channelResultList?: GetObjectResultsDto[]; variogramResultList?: GetVariogramResultsDto[]; computeCases?: ComputeCaseDto[]; }) => { diff --git a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResult.tsx b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResult.tsx index 515bbd42..fbbb1694 100644 --- a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResult.tsx +++ b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResult.tsx @@ -1,6 +1,6 @@ import { ComputeCaseDto, - GetChannelResultsDto, + GetObjectResultsDto, } from '../../../../../api/generated'; import * as Styled from './ChannelResult.styled'; import { ChannelResultTable } from './ChannelResultTable/ChannelResultTable'; @@ -10,7 +10,7 @@ export const ChannelResult = ({ data, computeCase, }: { - data: GetChannelResultsDto; + data: GetObjectResultsDto; computeCase?: ComputeCaseDto[]; }) => { let modelArea = ''; diff --git a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResultTable/ChannelResultTable.tsx b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResultTable/ChannelResultTable.tsx index fe276aa1..6500def3 100644 --- a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResultTable/ChannelResultTable.tsx +++ b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ChannelResultTable/ChannelResultTable.tsx @@ -1,16 +1,12 @@ /* eslint-disable max-lines-per-function */ import { Table } from '@equinor/eds-core-react'; -import { GetChannelResultsDto } from '../../../../../../api/generated'; import * as Styled from './ChannelResultTable.styled'; +import { GetObjectResultsDto } from '../../../../../../api/generated/models/GetObjectResultsDto'; const NumberOfDecimals = 2; -export const ChannelResultTable = ({ - data, -}: { - data: GetChannelResultsDto; -}) => { +export const ChannelResultTable = ({ data }: { data: GetObjectResultsDto }) => { const roundResultString = (value?: number) => { if (value) { return value.toFixed(NumberOfDecimals); @@ -31,22 +27,20 @@ export const ChannelResultTable = ({ Channel width - {roundResultString(data.channelWidth?.mean)} + {roundResultString(data.width?.mean)} - - {roundResultString(data.channelWidth?.sd)} - - {data.channelWidth?.count} + {roundResultString(data.width?.sd)} + {data.width?.count} Channel height - {roundResultString(data.channelHeight?.mean)} + {roundResultString(data.height?.mean)} - {roundResultString(data.channelHeight?.sd)} + {roundResultString(data.height?.sd)} - {data.channelHeight?.count} + {data.height?.count} diff --git a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ResultArea/ResultArea.tsx b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ResultArea/ResultArea.tsx index 7c031224..fe1e8e11 100644 --- a/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ResultArea/ResultArea.tsx +++ b/src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/ResultArea/ResultArea.tsx @@ -1,7 +1,7 @@ /* eslint-disable max-lines-per-function */ import { Label, Typography } from '@equinor/eds-core-react'; -import { GetChannelResultsDto } from '../../../../../../api/generated'; import * as Styled from './ResultArea.styled'; +import { GetObjectResultsDto } from '../../../../../../api/generated/models/GetObjectResultsDto'; export const ResultArea = ({ computeMethod, @@ -10,7 +10,7 @@ export const ResultArea = ({ }: { computeMethod?: string; modelArea: string; - data: GetChannelResultsDto; + data: GetObjectResultsDto; }) => { const xCoordinate = data.box?.filter((b) => b.m === 0)[0]; const yCoordinate = data.box?.filter((b) => b.m === 1)[0]; diff --git a/src/hooks/useFetchChannelResults.ts b/src/hooks/useFetchChannelResults.ts index 3da68fc5..80df7623 100644 --- a/src/hooks/useFetchChannelResults.ts +++ b/src/hooks/useFetchChannelResults.ts @@ -5,15 +5,15 @@ import { useMsal } from '@azure/msal-react'; import { useParams } from 'react-router-dom'; import { useAccessToken } from './useAccessToken'; -export const useFetchChannelResults = () => { +export const useFetchObjectResults = () => { const { modelId } = useParams(); const { instance, accounts } = useMsal(); const token = useAccessToken(instance, accounts[0]); const query = useQuery({ - queryKey: ['channel-results', modelId], + queryKey: ['object-results', modelId], queryFn: () => - ResultsService.getApiAnalogueModelsResultsChannel(modelId as string), + ResultsService.getApiAnalogueModelsResultsObject(modelId as string), enabled: !!token, }); diff --git a/src/pages/ModelPages/Compute/ComputeObject/ComputeObject.tsx b/src/pages/ModelPages/Compute/ComputeObject/ComputeObject.tsx index 41140f20..528dcda7 100644 --- a/src/pages/ModelPages/Compute/ComputeObject/ComputeObject.tsx +++ b/src/pages/ModelPages/Compute/ComputeObject/ComputeObject.tsx @@ -3,7 +3,7 @@ import { Snackbar } from '@equinor/eds-core-react'; import { useMutation } from '@tanstack/react-query'; import { useState } from 'react'; import { useParams } from 'react-router-dom'; -import { EstimateChannelCommand, JobsService } from '../../../../api/generated'; +import { EstimateObjectCommand, JobsService } from '../../../../api/generated'; import { queryClient } from '../../../../auth/queryClient'; import { CaseGroup } from '../../../../features/Compute/CaseGroup/CaseGroup'; import { ComputeHeader } from '../../../../features/Compute/ComputeHeader/ComputeHeader'; @@ -33,7 +33,7 @@ export const ComputeObject = () => { const { data } = useFetchCases(); const computeObject = useMutation({ - mutationFn: JobsService.postApiJobsComputeChannelEstimations, + mutationFn: JobsService.postApiJobsComputeObjectEstimations, onSuccess: () => { queryClient.refetchQueries({ queryKey: ['model-cases'] }); }, @@ -41,7 +41,7 @@ export const ComputeObject = () => { const runComputeObject = async (computeCaseId: string) => { if (!modelId) return; - const requestBody: EstimateChannelCommand = { + const requestBody: EstimateObjectCommand = { modelId: modelId, computeCaseId: computeCaseId, }; @@ -58,6 +58,10 @@ export const ComputeObject = () => { (method) => method.computeMethod.name === 'Channel', ); + // const mouthbar = data?.data.filter( + // (method) => method.computeMethod.name === 'Mouthbar', + // ) + return ( <> diff --git a/src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx b/src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx index c48fd94d..29dffcf0 100644 --- a/src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx +++ b/src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx @@ -1,11 +1,11 @@ import { CaseResultView } from '../../../../features/Results/CaseResult/CaseResultView/CaseResultView'; import { NoResults } from '../../../../features/Results/NoResults/NoResults'; import { useFetchCases } from '../../../../hooks/useFetchCases'; -import { useFetchChannelResults } from '../../../../hooks/useFetchChannelResults'; +import { useFetchObjectResults } from '../../../../hooks/useFetchChannelResults'; export const ObjectResult = () => { const cases = useFetchCases(); - const { data, isLoading } = useFetchChannelResults(); + const { data, isLoading } = useFetchObjectResults(); const objectResults = data?.data; if (isLoading) return <>Loading ...;