7
7
8
8
import { ElementType , IntegerInput , TextInput } from '@gridsuite/commons-ui' ;
9
9
import Grid from '@mui/material/Grid' ;
10
- import ConfigurationSelection from './configuration-selection' ;
10
+ import ConfigurationSelection , { ConfigSelectionProps } from './configuration-selection' ;
11
11
import { FormattedMessage } from 'react-intl' ;
12
12
import React , { FunctionComponent } from 'react' ;
13
13
@@ -23,6 +23,19 @@ export const NETWORK_VISUALIZATION_PARAMETERS_ID = 'networkVisualizationParamete
23
23
export const USER_QUOTA_CASE_NB = 'userQuotaCaseNb' ;
24
24
export const USER_QUOTA_BUILD_NB = 'userQuotaBuildNb' ;
25
25
26
+ const configList : ConfigSelectionProps [ ] = [
27
+ { selectionFormId : LOADFLOW_PARAM_ID , elementType : ElementType . LOADFLOW_PARAMETERS } ,
28
+ { selectionFormId : SECURITY_ANALYSIS_PARAM_ID , elementType : ElementType . SECURITY_ANALYSIS_PARAMETERS } ,
29
+ { selectionFormId : SENSITIVITY_ANALYSIS_PARAM_ID , elementType : ElementType . SENSITIVITY_PARAMETERS } ,
30
+ { selectionFormId : SHORTCIRCUIT_PARAM_ID , elementType : ElementType . SHORT_CIRCUIT_PARAMETERS } ,
31
+ { selectionFormId : VOLTAGE_INIT_PARAM_ID , elementType : ElementType . VOLTAGE_INIT_PARAMETERS } ,
32
+ { selectionFormId : SPREADSHEET_CONFIG_COLLECTION_ID , elementType : ElementType . SPREADSHEET_CONFIG_COLLECTION } ,
33
+ {
34
+ selectionFormId : NETWORK_VISUALIZATION_PARAMETERS_ID ,
35
+ elementType : ElementType . NETWORK_VISUALIZATIONS_PARAMETERS ,
36
+ } ,
37
+ ] ;
38
+
26
39
const ProfileModificationForm : FunctionComponent = ( ) => {
27
40
return (
28
41
< Grid container spacing = { 2 } marginTop = { 'auto' } >
@@ -34,54 +47,22 @@ const ProfileModificationForm: FunctionComponent = () => {
34
47
< FormattedMessage id = { 'profiles.form.modification.defaultConfigurations' } />
35
48
</ h3 >
36
49
</ Grid >
37
- < Grid item xs = { 12 } >
38
- < ConfigurationSelection
39
- elementType = { ElementType . LOADFLOW_PARAMETERS }
40
- selectionFormId = { LOADFLOW_PARAM_ID }
41
- />
42
- </ Grid >
43
- < Grid item xs = { 12 } >
44
- < ConfigurationSelection
45
- elementType = { ElementType . SECURITY_ANALYSIS_PARAMETERS }
46
- selectionFormId = { SECURITY_ANALYSIS_PARAM_ID }
47
- />
48
- </ Grid >
49
- < Grid item xs = { 12 } >
50
- < ConfigurationSelection
51
- elementType = { ElementType . SENSITIVITY_PARAMETERS }
52
- selectionFormId = { SENSITIVITY_ANALYSIS_PARAM_ID }
53
- />
54
- </ Grid >
55
- < Grid item xs = { 12 } >
56
- < ConfigurationSelection
57
- elementType = { ElementType . SHORT_CIRCUIT_PARAMETERS }
58
- selectionFormId = { SHORTCIRCUIT_PARAM_ID }
59
- />
60
- </ Grid >
61
- < Grid item xs = { 12 } >
62
- < ConfigurationSelection
63
- elementType = { ElementType . VOLTAGE_INIT_PARAMETERS }
64
- selectionFormId = { VOLTAGE_INIT_PARAM_ID }
65
- />
66
- </ Grid >
67
- < Grid item xs = { 12 } >
68
- < ConfigurationSelection
69
- elementType = { ElementType . SPREADSHEET_CONFIG_COLLECTION }
70
- selectionFormId = { SPREADSHEET_CONFIG_COLLECTION_ID }
71
- />
72
- </ Grid >
73
- < Grid item xs = { 12 } >
74
- < ConfigurationSelection
75
- elementType = { ElementType . NETWORK_VISUALIZATIONS_PARAMETERS }
76
- selectionFormId = { NETWORK_VISUALIZATION_PARAMETERS_ID }
77
- />
78
- </ Grid >
50
+ { configList . map ( ( config ) => {
51
+ return (
52
+ < Grid item xs = { 12 } key = { config . selectionFormId } >
53
+ < ConfigurationSelection
54
+ elementType = { config . elementType }
55
+ selectionFormId = { config . selectionFormId }
56
+ />
57
+ </ Grid >
58
+ ) ;
59
+ } ) }
79
60
< Grid item xs = { 12 } >
80
61
< h3 >
81
62
< FormattedMessage id = { 'profiles.form.modification.userQuotas' } />
82
63
</ h3 >
83
64
</ Grid >
84
- < Grid container spacing = { 2 } >
65
+ < Grid container spacing = { 2 } direction = "row" marginLeft = { 'auto' } >
85
66
< Grid item xs = { 4 } >
86
67
< IntegerInput
87
68
name = { USER_QUOTA_CASE_NB }
0 commit comments