File tree 5 files changed +27
-1
lines changed
pages/profiles/modification
5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 8
8
import ProfileModificationForm , {
9
9
LF_PARAM_ID ,
10
10
PROFILE_NAME ,
11
+ USER_QUOTAS ,
11
12
} from './profile-modification-form' ;
12
13
import yup from 'utils/yup-config' ;
13
14
import { yupResolver } from '@hookform/resolvers/yup' ;
@@ -50,6 +51,7 @@ const ProfileModificationDialog: FunctionComponent<
50
51
. shape ( {
51
52
[ PROFILE_NAME ] : yup . string ( ) . trim ( ) . required ( 'nameEmpty' ) ,
52
53
[ LF_PARAM_ID ] : yup . string ( ) . optional ( ) ,
54
+ [ USER_QUOTAS ] : yup . number ( ) . nullable ( ) ,
53
55
} )
54
56
. required ( ) ;
55
57
@@ -66,6 +68,7 @@ const ProfileModificationDialog: FunctionComponent<
66
68
id : profileId ,
67
69
name : profileFormData [ PROFILE_NAME ] ,
68
70
loadFlowParameterId : profileFormData [ LF_PARAM_ID ] ,
71
+ maxAllowedCases : profileFormData [ USER_QUOTAS ] ,
69
72
} ;
70
73
modifyProfile ( profileData )
71
74
. catch ( ( error ) => {
@@ -98,6 +101,7 @@ const ProfileModificationDialog: FunctionComponent<
98
101
[ LF_PARAM_ID ] : response . loadFlowParameterId
99
102
? response . loadFlowParameterId
100
103
: undefined ,
104
+ [ USER_QUOTAS ] : response . maxAllowedCases ,
101
105
} ) ;
102
106
} )
103
107
. catch ( ( error ) => {
Original file line number Diff line number Diff line change 5
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
*/
7
7
8
- import { ElementType , TextInput } from '@gridsuite/commons-ui' ;
8
+ import { ElementType , IntegerInput , TextInput } from '@gridsuite/commons-ui' ;
9
9
import Grid from '@mui/material/Grid' ;
10
10
import ParameterSelection from './parameter-selection' ;
11
11
import { FormattedMessage } from 'react-intl' ;
12
12
import React , { FunctionComponent } from 'react' ;
13
13
14
14
export const PROFILE_NAME = 'name' ;
15
15
export const LF_PARAM_ID = 'lfParamId' ;
16
+ export const USER_QUOTAS = 'userQuotas' ;
16
17
17
18
const ProfileModificationForm : FunctionComponent = ( ) => {
18
19
return (
@@ -37,6 +38,22 @@ const ProfileModificationForm: FunctionComponent = () => {
37
38
parameterFormId = { LF_PARAM_ID }
38
39
/>
39
40
</ Grid >
41
+ < Grid item xs = { 12 } >
42
+ < h3 >
43
+ < FormattedMessage
44
+ id = { 'profiles.form.modification.userQuotas' }
45
+ />
46
+ </ h3 >
47
+ </ Grid >
48
+ < Grid item xs = { 12 } >
49
+ < Grid item xs = { 4 } >
50
+ < IntegerInput
51
+ name = { USER_QUOTAS }
52
+ label = "profiles.form.modification.numberOfCasesOrStudies"
53
+ clearable = { true }
54
+ />
55
+ </ Grid >
56
+ </ Grid >
40
57
</ Grid >
41
58
) ;
42
59
} ;
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ export type UserProfile = {
111
111
name : string ;
112
112
allParametersLinksValid ?: boolean ;
113
113
loadFlowParameterId ?: UUID ;
114
+ maxAllowedCases ?: number ;
114
115
} ;
115
116
116
117
export function fetchProfiles ( ) : Promise < UserProfile [ ] > {
Original file line number Diff line number Diff line change 63
63
64
64
"profiles.form.modification.title" : " Edit profile" ,
65
65
"profiles.form.modification.defaultParameters" : " Default parameters" ,
66
+ "profiles.form.modification.userQuotas" : " User quotas" ,
67
+ "profiles.form.modification.numberOfCasesOrStudies" : " Number of cases or studies" ,
66
68
"profiles.form.modification.parameter.choose.tooltip" : " Choose parameters" ,
67
69
"profiles.form.modification.parameter.reset.tooltip" : " Set undefined parameters" ,
68
70
"profiles.form.modification.parameterSelection.dialog.title" : " Choose parameters" ,
Original file line number Diff line number Diff line change 64
64
65
65
"profiles.form.modification.title" : " Modifier profil" ,
66
66
"profiles.form.modification.defaultParameters" : " Paramètres par défaut" ,
67
+ "profiles.form.modification.userQuotas" : " Quotas utilisateur" ,
68
+ "profiles.form.modification.numberOfCasesOrStudies" : " Nombre de situations ou d'études" ,
67
69
"profiles.form.modification.parameter.choose.tooltip" : " Choisir paramètres" ,
68
70
"profiles.form.modification.parameter.reset.tooltip" : " Ne pas définir de paramètres" ,
69
71
"profiles.form.modification.parameterSelection.dialog.title" : " Choisir des paramètres" ,
You can’t perform that action at this time.
0 commit comments