Skip to content

Commit

Permalink
feat: add some fields (color, clay, cracking)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouxm committed Feb 9, 2024
1 parent 576a4ce commit 318e78d
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-redux": "^8.1.3",
"terraso-backend": "github:techmatters/terraso-backend#b2eca72c",
"terraso-backend": "github:techmatters/terraso-backend#e88a347",
"uuid": "^9.0.1"
},
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/soilId/soilIdFragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ export const depthDependentSoilData = /* GraphQL */ `
}
texture
rockFragmentVolume
clayPercent
colorHueSubstep
colorHue
colorValue
colorChroma
colorPhotoSoilCondition
colorPhotoLightingCondition
conductivity
conductivityTest
conductivityUnit
Expand Down
58 changes: 58 additions & 0 deletions src/soilId/soilIdTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ import type {
ProjectSoilSettingsNode,
SoilDataDepthIntervalNode,
SoilDataNode,
SoilIdDepthDependentSoilDataColorChromaChoices,
SoilIdDepthDependentSoilDataColorHueChoices,
SoilIdDepthDependentSoilDataColorHueSubstepChoices,
SoilIdDepthDependentSoilDataColorValueChoices,
SoilIdDepthDependentSoilDataRockFragmentVolumeChoices,
SoilIdDepthDependentSoilDataTextureChoices,
SoilIdSoilDataSurfaceCracksSelectChoices,
} from 'terraso-client-shared/graphqlSchema/graphql';

export const soilPitMethods = [
Expand Down Expand Up @@ -87,5 +92,58 @@ export const textures = [
'SILT_LOAM',
] as const satisfies readonly SoilTexture[];

export type SoilColorValue = SoilIdDepthDependentSoilDataColorValueChoices;
export const colorValues = [
'VALUE_2_5',
'VALUE_3',
'VALUE_4',
'VALUE_5',
'VALUE_6',
'VALUE_7',
'VALUE_8',
'VALUE_8_5',
'VALUE_9',
'VALUE_9_5',
] as const satisfies readonly SoilColorValue[];

export type SoilColorChroma = SoilIdDepthDependentSoilDataColorChromaChoices;
export const colorChromas = [
'CHROMA_1',
'CHROMA_2',
'CHROMA_3',
'CHROMA_4',
'CHROMA_5',
'CHROMA_6',
'CHROMA_7',
'CHROMA_8',
] as const satisfies readonly SoilColorChroma[];

export type SoilColorHue = SoilIdDepthDependentSoilDataColorHueChoices;
export const colorHues = [
'B',
'BG',
'G',
'GY',
'R',
'Y',
'YR',
] as const satisfies readonly SoilColorHue[];

export type SoilColorHueSubstep =
SoilIdDepthDependentSoilDataColorHueSubstepChoices;
export const colorHueSubsteps = [
'SUBSTEP_2_5',
'SUBSTEP_5',
'SUBSTEP_7_5',
'SUBSTEP_10',
] as const satisfies readonly SoilColorHueSubstep[];

export type RockFragmentVolume =
SoilIdDepthDependentSoilDataRockFragmentVolumeChoices;

export type SurfaceCracks = SoilIdSoilDataSurfaceCracksSelectChoices;
export const surfaceCracks = [
'NO_CRACKING',
'SURFACE_CRACKING_ONLY',
'DEEP_VERTICAL_CRACKS',
] as const satisfies readonly SurfaceCracks[];
1 change: 1 addition & 0 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type StateFromStoreFactory<T extends (_: any) => ToolkitStore> =
export type DispatchFromStoreFactory<T extends (_: any) => ToolkitStore> =
ReturnType<T>['dispatch'];

// TODO: why doesn't the returned store type include the reducers from S?
const createStoreFactory = <S>(reducers: ReducersMapObject<S>) => {
return (intialState?: Partial<SharedState & S>) =>
configureStore({
Expand Down

0 comments on commit 318e78d

Please sign in to comment.