Skip to content

Conversation

@Mathieu-Deharbe
Copy link
Contributor

No description provided.

Mathieu-Deharbe and others added 3 commits October 28, 2025 16:57
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
@basseche basseche self-requested a review October 31, 2025 15:16
Mathieu-Deharbe and others added 3 commits November 3, 2025 16:43
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2025

sideActionCallback: manageContingencyName,
},
cellStyle: { padding: 0 },
flex: 1,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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 {
Copy link
Contributor

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(),
Copy link
Contributor

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;
Copy link
Contributor

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

Comment on lines 27 to 35
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();
Copy link
Contributor

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);
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants