Skip to content

Commit

Permalink
Merge pull request #33 from InseeFr/develop
Browse files Browse the repository at this point in the history
Idec length 7 or 8
  • Loading branch information
EricThuaud authored Oct 27, 2023
2 parents ac03e49 + b8dabe0 commit 5fc3ba7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "colempub",
"version": "0.10.12",
"version": "1.0.0",
"dependencies": {
"axios": "^0.19.2",
"bootstrap": "^3.3.7",
"keycloak-js": "^10.0.2",
"node-sass": "^4.11.0",
"prop-types": "^15.6.2",
"react": "^16.12.0",
"react-app-polyfill": "^1.0.3",
Expand All @@ -18,7 +17,8 @@
"react-responsive-carousel": "^3.2.9",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^4.3.1",
"react-scripts": "3.4.0"
"react-scripts": "3.4.0",
"sass": "^1.68.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
6 changes: 3 additions & 3 deletions src/components/forms/assistance-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ErrorComponent from 'components/template/error-component';
import validate from 'utils/validate-forms';
import { getSurveyRootUrl } from 'utils/url-utils';
import { getListOptionsMailAssitance, getListOptionsSurvey } from 'utils/read-content';
import { idecLength, pathMail } from 'utils/properties';
import { idecLengthMin, idecLengthMax, pathMail } from 'utils/properties';
import Axios from 'axios';

class AssistanceForm extends React.Component {
Expand Down Expand Up @@ -258,15 +258,15 @@ class AssistanceForm extends React.Component {
valid={formControls.mailaddressconfirmation.valid}
maxLength={200}
/>
<label htmlFor="idec">{`Identifiant (7 caractères)`}</label>
<label htmlFor="idec">{`Identifiant (entre ${idecLengthMin} et ${idecLengthMax} caractères)`}</label>
<TextInput
name="idec"
placeholder={formControls.idec.placeholder}
value={formControls.idec.value}
onChange={this.changeHandler}
touched={formControls.idec.touched}
valid={formControls.idec.valid}
maxLength={idecLength}
maxLength={idecLengthMax}
/>
<br />
<label htmlFor="survey">{`Nom de l'enquête`}</label>
Expand Down
12 changes: 6 additions & 6 deletions src/components/forms/change-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PasswordInput from 'components/form-elements/passwordInput';
import validate from 'utils/validate-forms';
import isPasswordCompliant from 'utils/validate-password';
import { getSurveyRootUrl } from 'utils/url-utils';
import { idecLength, pathPassword, pathUser } from 'utils/properties';
import { idecLengthMin, idecLengthMax, pathPassword, pathUser } from 'utils/properties';
import Axios from 'axios';

class ChangePasswordForm extends React.Component {
Expand All @@ -23,8 +23,8 @@ class ChangePasswordForm extends React.Component {
placeholder: '',
valid: false,
validationRules: {
minLength: idecLength,
maxLength: idecLength,
minLength: idecLengthMin,
maxLength: idecLengthMax,
isRequired: true,
},
touched: false,
Expand Down Expand Up @@ -172,7 +172,7 @@ class ChangePasswordForm extends React.Component {
<h2>{`Formulaire de changement de mot de passe`}</h2>
<p>{`(*) Champs obligatoires`}</p>
<label htmlFor="idec">
{`Identifiant (7 caractères)`}
{`Identifiant (entre ${idecLengthMin} et ${idecLengthMax} caractères)`}
<sup>*</sup>
</label>
<TextInput
Expand All @@ -182,8 +182,8 @@ class ChangePasswordForm extends React.Component {
onChange={this.changeHandler}
touched={formControls.idec.touched}
valid={formControls.idec.valid}
maxLength={idecLength}
errormessage={`Merci de saisir un identifiant de 7 caractères`}
maxLength={idecLengthMax}
errormessage={`Merci de saisir un identifiant entre ${idecLengthMin} et ${idecLengthMax} caractères`}
/>
<br />
<label htmlFor="password">
Expand Down
12 changes: 6 additions & 6 deletions src/components/forms/form-input-id.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { idecLength } from 'utils/properties';
import { idecLengthMin, idecLengthMax } from 'utils/properties';
import TextInput from 'components/form-elements/textInput';

export default class FormInputId extends React.Component {
Expand Down Expand Up @@ -40,14 +40,14 @@ export default class FormInputId extends React.Component {
<label htmlFor="idec">
{`Identifiant `}
<sup>*</sup>
{` (7 caractères, exemple : N9XCZ3L)`}
{` (entre ${idecLengthMin} et ${idecLengthMax} caractères, exemple : N9XCZ3L)`}
</label>
<TextInput
id="idec"
name="idec"
maxLength={idecLength}
size={idecLength}
width={idecLength}
maxLength={idecLengthMax}
size={idecLengthMax}
width={idecLengthMax}
value={idec}
valid
touched
Expand All @@ -56,7 +56,7 @@ export default class FormInputId extends React.Component {
/>
{disable ? (
<div className="validation-error">
{`Merci de renseigner un identifiant qui doit comporter 7 caractères`}
{`Merci de renseigner un identifiant qui doit comporter entre ${idecLengthMin} et ${idecLengthMax} caractères`}
</div>
) : (
<></>
Expand Down
4 changes: 3 additions & 1 deletion src/utils/properties.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const idecLength = 7;
export const idecLengthMin = 7;

export const idecLengthMax = 8;

export const LONGUEUR_MINIMALE_PASSWORD_POLITIQUE_INSEE = 8;

Expand Down

0 comments on commit 5fc3ba7

Please sign in to comment.