-
Notifications
You must be signed in to change notification settings - Fork 2
remove criteria contingencies #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
src/components/dialogs/contingency-list/creation/contingency-list-creation-form.tsx
Outdated
Show resolved
Hide resolved
src/components/dialogs/contingency-list/creation/contingency-list-creation-dialog.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
…nto remove-criteria-contingencies
|
| sideActionCallback: manageContingencyName, | ||
| }, | ||
| cellStyle: { padding: 0 }, | ||
| flex: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is useless since it is already in defaultColDef
| editable: true, | ||
| rowDrag: true, | ||
| singleClickEdit: true, | ||
| flex: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| suppressKeyboardEvent(params), | ||
| autoHeight: true, | ||
| wrapText: true, | ||
| singleClickEdit: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be moved to defaultColDef
| field: FieldConstants.CONTINGENCY_NAME, | ||
| editable: true, | ||
| rowDrag: true, | ||
| singleClickEdit: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this after moving to defaultColDef
| */ | ||
|
|
||
| import { useSelector } from 'react-redux'; | ||
| import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO you should move creation and edition dialog into explicit-naming folder
| then: (schemaThen) => schemaThen.required(), | ||
| otherwise: (schemaOtherwise) => schemaOtherwise.nullable(), | ||
| }), | ||
| [FieldConstants.EQUIPMENT_TYPE]: yup.string().nullable(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very sure you need that!
|
|
||
| export interface ExplicitNamingEditionDialogProps { | ||
| contingencyListId: string; | ||
| contingencyListType: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need that anymore since you know it is explicit naming
| const schema = yup.object().shape({ | ||
| [FieldConstants.NAME]: yup.string().trim().required('nameEmpty'), | ||
| [FieldConstants.DESCRIPTION]: yup.string().max(MAX_CHAR_DESCRIPTION), | ||
| [FieldConstants.CONTINGENCY_LIST_TYPE]: yup.string().nullable(), | ||
| [FieldConstants.EQUIPMENT_TYPE]: yup.string().when([FieldConstants.CONTINGENCY_LIST_TYPE], { | ||
| is: ContingencyListType.CRITERIA_BASED.id, | ||
| then: (schemaThen) => schemaThen.required(), | ||
| otherwise: (schemaOtherwise) => schemaOtherwise.nullable(), | ||
| }), | ||
| [FieldConstants.EQUIPMENT_TYPE]: yup.string().nullable(), | ||
| ...getExplicitNamingSchema(), | ||
| ...getCriteriaBasedSchema(), | ||
| }); | ||
|
|
||
| const emptyFormData = getContingencyListEmptyFormData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is almost the same as in edition dialog maybe move it to contingency-list-utils
| ...getExplicitNamingEditSchema(), | ||
| }); | ||
|
|
||
| const emptyFormData = (name?: string) => getContingencyListEmptyFormData(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this component is useless as the only purpose is to call another component so modify directly getContingencyListEmptyFormData. You can even rename it if you want, as it is only used by explicit-naming contingency list.



No description provided.