-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Validate GDE input. * chore: Validate Outcrop input. * chore: Change error message, remove log. * chore: Move stratCol dialig. Add input validation and error feedback. * chore: Fix gde error logic. * chore: Fix duplicate key in model table.
- Loading branch information
1 parent
7108d3b
commit 08d3396
Showing
11 changed files
with
341 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GDE.hooks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { GDEErrorType, GdeType } from './GrossDepositionEnviromentGroup'; | ||
|
||
export const validateInput = async (gdeObject: GdeType) => { | ||
const errorObject: GDEErrorType = {}; | ||
const message = 'Value missing'; | ||
|
||
if (gdeObject.grossDepEnv === undefined) { | ||
errorObject.GDE = message; | ||
} | ||
if (gdeObject.depEnv === undefined) { | ||
errorObject.DEnv = message; | ||
} | ||
if (gdeObject.subenv === undefined) { | ||
errorObject.subEnv = message; | ||
} | ||
if (gdeObject.architecturalElements?.length === 0) { | ||
errorObject.AEl = message; | ||
} | ||
|
||
return errorObject; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.