Skip to content

Commit 25e01fa

Browse files
authored
feat: added outcrop region and location (#362)
1 parent 6df30fe commit 25e01fa

File tree

9 files changed

+123
-7
lines changed

9 files changed

+123
-7
lines changed

src/api/generated/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export type { GetObjectResultsDto } from './models/GetObjectResultsDto';
8080
export type { GetObjectResultsFileDto } from './models/GetObjectResultsFileDto';
8181
export type { GetOutcropsCommandResponse } from './models/GetOutcropsCommandResponse';
8282
export type { GetOutcropsDto } from './models/GetOutcropsDto';
83+
export type { GetOutcropsLocationDto } from './models/GetOutcropsLocationDto';
84+
export type { GetOutcropsRegionDto } from './models/GetOutcropsRegionDto';
8385
export type { GetUploadDetailQueryResponse } from './models/GetUploadDetailQueryResponse';
8486
export type { GetUploadListQueryResponse } from './models/GetUploadListQueryResponse';
8587
export type { GetVariogramResultsByModelIdQueryResponse } from './models/GetVariogramResultsByModelIdQueryResponse';
@@ -105,6 +107,7 @@ export type { ListMetadataTypesQueryResponse } from './models/ListMetadataTypesQ
105107
export type { ListModelAreaTypesQueryResponse } from './models/ListModelAreaTypesQueryResponse';
106108
export type { ListStratColumnQueryResponse } from './models/ListStratColumnQueryResponse';
107109
export type { ListStratUnitsQueryResponse } from './models/ListStratUnitsQueryResponse';
110+
export type { LocationDto } from './models/LocationDto';
108111
export type { MergeModelCommandResponse } from './models/MergeModelCommandResponse';
109112
export type { MergeModelDto } from './models/MergeModelDto';
110113
export type { MetadataDto } from './models/MetadataDto';
@@ -126,6 +129,7 @@ export type { PrepareChunkedUploadCommandResponse } from './models/PrepareChunke
126129
export type { PrepareChunkedUploadDto } from './models/PrepareChunkedUploadDto';
127130
export type { ProblemDetails } from './models/ProblemDetails';
128131
export type { RadixJobDto } from './models/RadixJobDto';
132+
export type { RegionDto } from './models/RegionDto';
129133
export type { StratColumnDto } from './models/StratColumnDto';
130134
export type { StratigraphicGroupDto } from './models/StratigraphicGroupDto';
131135
export type { StratUnitDto } from './models/StratUnitDto';

src/api/generated/models/GetOutcropsDto.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
/* tslint:disable */
44
/* eslint-disable */
55

6+
import type { GetOutcropsRegionDto } from './GetOutcropsRegionDto';
7+
68
export type GetOutcropsDto = {
79
outcropId: string;
810
name: string;
911
outcropCategory: string;
10-
region: string;
1112
basins: Array<string>;
13+
region: GetOutcropsRegionDto;
1214
};
1315

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
6+
export type GetOutcropsLocationDto = {
7+
locationId: string;
8+
regionId: string;
9+
locationName: string;
10+
country: string;
11+
};
12+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
6+
import type { GetOutcropsLocationDto } from './GetOutcropsLocationDto';
7+
8+
export type GetOutcropsRegionDto = {
9+
regionId: string;
10+
name: string;
11+
locations: Array<GetOutcropsLocationDto>;
12+
};
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
6+
export type LocationDto = {
7+
locationId: string;
8+
regionId: string;
9+
locationName: string;
10+
country: string;
11+
};
12+

src/api/generated/models/OutcropDto.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
/* tslint:disable */
44
/* eslint-disable */
55

6+
import type { RegionDto } from './RegionDto';
7+
68
export type OutcropDto = {
79
outcropId: string;
810
name: string;
911
outcropCategory: string;
10-
region: string;
1112
basins: Array<string>;
13+
region: RegionDto;
1214
};
1315

src/api/generated/models/RegionDto.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
6+
import type { LocationDto } from './LocationDto';
7+
8+
export type RegionDto = {
9+
regionId: string;
10+
name: string;
11+
locations: Array<LocationDto>;
12+
};
13+

src/components/OutcropAnalogue/OutcropAnalogueGroup/OutcropAnalogueGroup.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
AddAnalogueModelOutcropForm,
1313
AnalogueModelDetail,
1414
OutcropDto,
15+
RegionDto,
1516
} from '../../../api/generated';
1617
import { useOutcropAnalouge } from '../../../hooks/useOutcropAnalogue';
1718
import * as StyledDialog from '../../../styles/addRowDialog/AddRowDialog.styled';
@@ -23,7 +24,7 @@ export interface OutcropType {
2324
outcropId?: string;
2425
name?: string;
2526
outcropCategory?: string;
26-
region?: string;
27+
region?: RegionDto;
2728
basins?: Array<string>;
2829
}
2930

@@ -108,6 +109,8 @@ export const OutcropAnalogueGroup = ({
108109
<Table.Row>
109110
<Table.Cell></Table.Cell>
110111
<Table.Cell>Analogue</Table.Cell>
112+
<Table.Cell>Country</Table.Cell>
113+
<Table.Cell>Location</Table.Cell>
111114
<Table.Cell>Region</Table.Cell>
112115
<Table.Cell>Basin</Table.Cell>
113116
<Table.Cell>Category</Table.Cell>
@@ -136,7 +139,20 @@ export const OutcropAnalogueGroup = ({
136139
<Table.Cell>
137140
<Styled.StratColCell>{row.name}</Styled.StratColCell>
138141
</Table.Cell>
139-
<Table.Cell>{row.region}</Table.Cell>
142+
{row.region.locations.length !== 0 ? (
143+
<>
144+
<Table.Cell>{row.region.locations[0].country}</Table.Cell>
145+
<Table.Cell>
146+
{row.region.locations[0].locationName}
147+
</Table.Cell>
148+
</>
149+
) : (
150+
<>
151+
<Table.Cell></Table.Cell>
152+
<Table.Cell></Table.Cell>
153+
</>
154+
)}
155+
<Table.Cell>{row.region.name}</Table.Cell>
140156
<Table.Cell>
141157
<Styled.StratColCell>
142158
{row.basins?.map((item) => item)}

src/components/OutcropAnalogue/OutcropSelect/OutcropSelect.tsx

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,56 @@ export const OutcropSelect = ({
6464
helperText={error.Analogue ? error.Analogue : undefined}
6565
/>
6666

67+
{outcropObject.region?.locations.length !== 0 ? (
68+
<>
69+
<Autocomplete
70+
label="Country"
71+
selectedOptions={[outcropObject.region?.locations[0].country]}
72+
initialSelectedOptions={
73+
outcropObject.region
74+
? [outcropObject.region.locations[0].country]
75+
: ['']
76+
}
77+
options={
78+
outcropObject.region !== undefined
79+
? [outcropObject.region.locations[0].country]
80+
: ['']
81+
}
82+
noOptionsText="No options"
83+
readOnly
84+
/>
85+
86+
<Autocomplete
87+
label="Location"
88+
selectedOptions={[outcropObject.region?.locations[0].locationName]}
89+
initialSelectedOptions={
90+
outcropObject.region
91+
? [outcropObject.region.locations[0].locationName]
92+
: ['']
93+
}
94+
options={
95+
outcropObject.region !== undefined
96+
? [outcropObject.region.locations[0].locationName]
97+
: ['']
98+
}
99+
noOptionsText="No options"
100+
readOnly
101+
/>
102+
</>
103+
) : (
104+
<></>
105+
)}
106+
67107
<Autocomplete
68108
label="Region"
69-
selectedOptions={[outcropObject.region]}
109+
selectedOptions={[outcropObject.region?.name]}
70110
initialSelectedOptions={
71-
outcropObject.region ? [outcropObject.region] : ['']
111+
outcropObject.region ? [outcropObject.region.name] : ['']
72112
}
73113
options={
74-
outcropObject.region !== undefined ? [outcropObject.region] : ['']
114+
outcropObject.region !== undefined
115+
? [outcropObject.region.name]
116+
: ['']
75117
}
76118
noOptionsText="No options"
77119
readOnly

0 commit comments

Comments
 (0)