Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/pages/profiles/modification/configuration-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ConfigSelectionProps {
| ElementType.SECURITY_ANALYSIS_PARAMETERS
| ElementType.SENSITIVITY_PARAMETERS
| ElementType.SHORT_CIRCUIT_PARAMETERS
| ElementType.PCC_MIN_PARAMETERS
| ElementType.VOLTAGE_INIT_PARAMETERS
| ElementType.SPREADSHEET_CONFIG_COLLECTION
| ElementType.NETWORK_VISUALIZATIONS_PARAMETERS
Expand All @@ -30,7 +31,6 @@ export interface ConfigSelectionProps {

const ConfigurationSelection: FunctionComponent<ConfigSelectionProps> = (props) => {
const intl = useIntl();

const [openDirectorySelector, setOpenDirectorySelector] = useState<boolean>(false);
const [selectedElementName, setSelectedElementName] = useState<string>();
const [configLinkValid, setConfigLinkValid] = useState<boolean>();
Expand Down Expand Up @@ -91,6 +91,8 @@ const ConfigurationSelection: FunctionComponent<ConfigSelectionProps> = (props)
return 'profiles.form.modification.spreadsheetConfigCollection.name';
case ElementType.NETWORK_VISUALIZATIONS_PARAMETERS:
return 'profiles.form.modification.networkVisualizations.name';
case ElementType.PCC_MIN_PARAMETERS:
return 'profiles.form.modification.pccMin.name';
case ElementType.WORKSPACE:
return 'profiles.form.modification.workspace.name';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import ProfileModificationForm, {
LOADFLOW_PARAM_ID,
NETWORK_VISUALIZATION_PARAMETERS_ID,
PCCMIN_PARAM_ID,
PROFILE_NAME,
SECURITY_ANALYSIS_PARAM_ID,
SENSITIVITY_ANALYSIS_PARAM_ID,
Expand Down Expand Up @@ -50,6 +51,7 @@ const ProfileModificationDialog: FunctionComponent<ProfileModificationDialogProp
[SECURITY_ANALYSIS_PARAM_ID]: yup.string<UUID>().optional(),
[SENSITIVITY_ANALYSIS_PARAM_ID]: yup.string<UUID>().optional(),
[SHORTCIRCUIT_PARAM_ID]: yup.string<UUID>().optional(),
[PCCMIN_PARAM_ID]: yup.string<UUID>().optional(),
[VOLTAGE_INIT_PARAM_ID]: yup.string<UUID>().optional(),
[USER_QUOTA_CASE_NB]: yup.number().positive('userQuotaPositive').optional(),
[USER_QUOTA_BUILD_NB]: yup.number().positive('userQuotaPositive').optional(),
Expand Down Expand Up @@ -77,6 +79,7 @@ const ProfileModificationDialog: FunctionComponent<ProfileModificationDialogProp
securityAnalysisParameterId: profileFormData[SECURITY_ANALYSIS_PARAM_ID],
sensitivityAnalysisParameterId: profileFormData[SENSITIVITY_ANALYSIS_PARAM_ID],
shortcircuitParameterId: profileFormData[SHORTCIRCUIT_PARAM_ID],
pccMinParameterId: profileFormData[PCCMIN_PARAM_ID],
voltageInitParameterId: profileFormData[VOLTAGE_INIT_PARAM_ID],
maxAllowedCases: profileFormData[USER_QUOTA_CASE_NB],
maxAllowedBuilds: profileFormData[USER_QUOTA_BUILD_NB],
Expand Down Expand Up @@ -116,6 +119,7 @@ const ProfileModificationDialog: FunctionComponent<ProfileModificationDialogProp
[SECURITY_ANALYSIS_PARAM_ID]: response.securityAnalysisParameterId ?? undefined,
[SENSITIVITY_ANALYSIS_PARAM_ID]: response.sensitivityAnalysisParameterId ?? undefined,
[SHORTCIRCUIT_PARAM_ID]: response.shortcircuitParameterId ?? undefined,
[PCCMIN_PARAM_ID]: response.pccMinParameterId ?? undefined,
[VOLTAGE_INIT_PARAM_ID]: response.voltageInitParameterId ?? undefined,
[USER_QUOTA_CASE_NB]: response.maxAllowedCases,
[USER_QUOTA_BUILD_NB]: response.maxAllowedBuilds,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/profiles/modification/profile-modification-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const LOADFLOW_PARAM_ID = 'loadFlowParamId';
export const SECURITY_ANALYSIS_PARAM_ID = 'securityAnalysisParamId';
export const SENSITIVITY_ANALYSIS_PARAM_ID = 'sensitivityAnalysisParamId';
export const SHORTCIRCUIT_PARAM_ID = 'shortcircuitParamId';
export const PCCMIN_PARAM_ID = 'pccminParamId';
export const VOLTAGE_INIT_PARAM_ID = 'voltageInitParamId';
export const SPREADSHEET_CONFIG_COLLECTION_ID = 'spreadsheetConfigCollectionId';
export const NETWORK_VISUALIZATION_PARAMETERS_ID = 'networkVisualizationParametersId';
Expand All @@ -29,6 +30,7 @@ const configList: ConfigSelectionProps[] = [
{ selectionFormId: SECURITY_ANALYSIS_PARAM_ID, elementType: ElementType.SECURITY_ANALYSIS_PARAMETERS },
{ selectionFormId: SENSITIVITY_ANALYSIS_PARAM_ID, elementType: ElementType.SENSITIVITY_PARAMETERS },
{ selectionFormId: SHORTCIRCUIT_PARAM_ID, elementType: ElementType.SHORT_CIRCUIT_PARAMETERS },
{ selectionFormId: PCCMIN_PARAM_ID, elementType: ElementType.PCC_MIN_PARAMETERS },
{ selectionFormId: VOLTAGE_INIT_PARAM_ID, elementType: ElementType.VOLTAGE_INIT_PARAMETERS },
{ selectionFormId: SPREADSHEET_CONFIG_COLLECTION_ID, elementType: ElementType.SPREADSHEET_CONFIG_COLLECTION },
{
Expand Down
2 changes: 1 addition & 1 deletion src/services/user-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export type UserProfile = {
securityAnalysisParameterId?: UUID;
sensitivityAnalysisParameterId?: UUID;
shortcircuitParameterId?: UUID;
pccMinParameterId?: UUID;
voltageInitParameterId?: UUID;
maxAllowedCases?: number;
maxAllowedBuilds?: number;
Expand Down Expand Up @@ -152,7 +153,6 @@ export function getProfile(profileId: UUID): Promise<UserProfile> {

export function modifyProfile(profileData: UserProfile) {
console.debug(`Updating a profile...`);

return backendFetch(`${USER_ADMIN_URL}/profiles/${profileData.id}`, {
method: 'PUT',
headers: {
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"profiles.form.modification.securityAnalysis.name": "Security analysis",
"profiles.form.modification.sensitivityAnalysis.name": "Sensitivity analysis",
"profiles.form.modification.shortcircuit.name": "Short-circuit",
"profiles.form.modification.pccMin.name": "Pcc min N-1",
"profiles.form.modification.voltageInit.name": "Voltage init",
"profiles.form.modification.spreadsheetConfigCollection.name": "Spreadsheet model collection",
"profiles.form.modification.networkVisualizations.name": "Network visualizations",
Expand Down
1 change: 1 addition & 0 deletions src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"profiles.form.modification.securityAnalysis.name": "Analyse de sécurité",
"profiles.form.modification.sensitivityAnalysis.name": "Analyse de sensibilités",
"profiles.form.modification.shortcircuit.name": "Calcul de court-circuit",
"profiles.form.modification.pccMin.name": "Pcc min N-1",
"profiles.form.modification.voltageInit.name": "Initialisation du plan de tension",
"profiles.form.modification.spreadsheetConfigCollection.name": "Modèles de tableur",
"profiles.form.modification.networkVisualizations.name": "Images réseau",
Expand Down
Loading