File tree Expand file tree Collapse file tree 5 files changed +27
-1
lines changed
pages/profiles/modification Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 88import ProfileModificationForm , {
99 LF_PARAM_ID ,
1010 PROFILE_NAME ,
11+ USER_QUOTAS ,
1112} from './profile-modification-form' ;
1213import yup from 'utils/yup-config' ;
1314import { yupResolver } from '@hookform/resolvers/yup' ;
@@ -50,6 +51,7 @@ const ProfileModificationDialog: FunctionComponent<
5051 . shape ( {
5152 [ PROFILE_NAME ] : yup . string ( ) . trim ( ) . required ( 'nameEmpty' ) ,
5253 [ LF_PARAM_ID ] : yup . string ( ) . optional ( ) ,
54+ [ USER_QUOTAS ] : yup . number ( ) . nullable ( ) ,
5355 } )
5456 . required ( ) ;
5557
@@ -66,6 +68,7 @@ const ProfileModificationDialog: FunctionComponent<
6668 id : profileId ,
6769 name : profileFormData [ PROFILE_NAME ] ,
6870 loadFlowParameterId : profileFormData [ LF_PARAM_ID ] ,
71+ maxAllowedCases : profileFormData [ USER_QUOTAS ] ,
6972 } ;
7073 modifyProfile ( profileData )
7174 . catch ( ( error ) => {
@@ -98,6 +101,7 @@ const ProfileModificationDialog: FunctionComponent<
98101 [ LF_PARAM_ID ] : response . loadFlowParameterId
99102 ? response . loadFlowParameterId
100103 : undefined ,
104+ [ USER_QUOTAS ] : response . maxAllowedCases ,
101105 } ) ;
102106 } )
103107 . catch ( ( error ) => {
Original file line number Diff line number Diff line change 55 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
66 */
77
8- import { ElementType , TextInput } from '@gridsuite/commons-ui' ;
8+ import { ElementType , IntegerInput , TextInput } from '@gridsuite/commons-ui' ;
99import Grid from '@mui/material/Grid' ;
1010import ParameterSelection from './parameter-selection' ;
1111import { FormattedMessage } from 'react-intl' ;
1212import React , { FunctionComponent } from 'react' ;
1313
1414export const PROFILE_NAME = 'name' ;
1515export const LF_PARAM_ID = 'lfParamId' ;
16+ export const USER_QUOTAS = 'userQuotas' ;
1617
1718const ProfileModificationForm : FunctionComponent = ( ) => {
1819 return (
@@ -37,6 +38,22 @@ const ProfileModificationForm: FunctionComponent = () => {
3738 parameterFormId = { LF_PARAM_ID }
3839 />
3940 </ 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 = { 5 } >
50+ < IntegerInput
51+ name = { USER_QUOTAS }
52+ label = "profiles.form.modification.numberOfCasesOrStudies"
53+ clearable = { true }
54+ />
55+ </ Grid >
56+ </ Grid >
4057 </ Grid >
4158 ) ;
4259} ;
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ export type UserProfile = {
111111 name : string ;
112112 allParametersLinksValid ?: boolean ;
113113 loadFlowParameterId ?: UUID ;
114+ maxAllowedCases ?: number ;
114115} ;
115116
116117export function fetchProfiles ( ) : Promise < UserProfile [ ] > {
Original file line number Diff line number Diff line change 6363
6464 "profiles.form.modification.title" : " Edit profile" ,
6565 "profiles.form.modification.defaultParameters" : " Default parameters" ,
66+ "profiles.form.modification.userQuotas" : " User quotas" ,
67+ "profiles.form.modification.numberOfCasesOrStudies" : " Number of cases or studies" ,
6668 "profiles.form.modification.parameter.choose.tooltip" : " Choose parameters" ,
6769 "profiles.form.modification.parameter.reset.tooltip" : " Set undefined parameters" ,
6870 "profiles.form.modification.parameterSelection.dialog.title" : " Choose parameters" ,
Original file line number Diff line number Diff line change 6464
6565 "profiles.form.modification.title" : " Modifier profil" ,
6666 "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" ,
6769 "profiles.form.modification.parameter.choose.tooltip" : " Choisir paramètres" ,
6870 "profiles.form.modification.parameter.reset.tooltip" : " Ne pas définir de paramètres" ,
6971 "profiles.form.modification.parameterSelection.dialog.title" : " Choisir des paramètres" ,
You can’t perform that action at this time.
0 commit comments