diff --git a/src/app/form/form-view/form-view.component.html b/src/app/form/form-view/form-view.component.html index 0c6a549beb48982fe617c7889127e8923a005d99..ed72d6c083a0a451f4ff09bb6751a6f8d9972028 100644 --- a/src/app/form/form-view/form-view.component.html +++ b/src/app/form/form-view/form-view.component.html @@ -1,4 +1,4 @@ -<div> +<div class="formView"> <app-progress-bar [formType]="formType[routeParam]" [isEditMode]="isEditMode" diff --git a/src/app/form/form-view/form-view.component.scss b/src/app/form/form-view/form-view.component.scss index b36bce4c4a77ee61695febf4adc3a168d0c24415..c9d10754fcabc00d5ccd2edddeba7033ba9dc1a7 100644 --- a/src/app/form/form-view/form-view.component.scss +++ b/src/app/form/form-view/form-view.component.scss @@ -3,18 +3,29 @@ @import '../../../assets/scss/layout'; @import '../../../assets//scss/typography'; +.formView { + height: 100%; + display: flex; + flex-direction: column; +} + ::ng-deep.page { - max-width: 1000px; box-sizing: border-box; + max-width: 980px; + width: 100%; + height: 100%; margin: auto; - min-height: 450px; - max-height: 75vh; overflow-y: auto; color: $grey-1; background: $white; border-radius: 8px; border: 1px solid $grey-6; padding: 32px 48px; + + @media #{$tablet} { + margin: 0px 4px; + width: auto; + } * { max-width: 700px; } diff --git a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss index 42bce1cb3d9659aefb50476e5986f70879d70ef9..3eb3a67bcbb3827b7a87f88f7bb4465fe28107e2 100644 --- a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss +++ b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss @@ -1,11 +1,16 @@ @import '../../../../../assets/scss/layout'; @import '../../../../../assets/scss/color'; @import '../../../../../assets/scss/typography'; +@import '../../../../../assets/scss/breakpoint'; .progressBar { height: #{$progressBar-height}; - max-width: 1000px; + max-width: 980px; margin: 16px auto; + + @media #{$tablet} { + margin: 0px 4px; + } p { @include lato-bold-14; color: $red; diff --git a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.html b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.html index 32c91a097e8fb9c85d8f00dc0d92e2c2004bfa08..771b5c356f0c4b4d9c6411056bad8a0e9ed7e568 100644 --- a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.html +++ b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.html @@ -37,6 +37,8 @@ (input)="setValidationsForm()" formControlName="nbComputers" min="0" + step="1" + max="1000" class="form-input nbEquipment" [(value)]="structureForm.value.nbComputers" /> @@ -55,6 +57,8 @@ (input)="setValidationsForm()" formControlName="nbTablets" min="0" + step="1" + max="1000" class="form-input nbEquipment" [(value)]="structureForm.value.nbTablets" /> @@ -73,6 +77,8 @@ (input)="setValidationsForm()" formControlName="nbPrinters" min="0" + step="1" + max="1000" class="form-input nbEquipment" [(value)]="structureForm.value.nbPrinters" /> @@ -91,6 +97,8 @@ (input)="setValidationsForm()" formControlName="nbNumericTerminal" min="0" + step="1" + max="1000" class="form-input nbEquipment" [(value)]="structureForm.value.nbNumericTerminal" /> @@ -109,6 +117,8 @@ (input)="setValidationsForm()" formControlName="nbScanners" min="0" + step="1" + max="1000" class="form-input nbEquipment" [(value)]="structureForm.value.nbScanners" /> diff --git a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts index d3881aa213442196d172367cd98680e2e749d114..7d9001e248d44872ec8c32410a4b466a0126e108 100644 --- a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts +++ b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts @@ -32,7 +32,9 @@ export class StructureEquipmentsComponent implements OnInit { if (equipment === 'imprimantes') field = 'nbPrinters'; if (value === -1 && this.structureForm.value[field] === 0) return; - this.getStructureControl(field).setValue(this.structureForm.value[field] + value); + if (this.structureForm.value[field] + value < 0) return; + this.getStructureControl(field).setValue(Math.round(this.structureForm.value[field] + value)); + this.validateForm.emit(); } public setValidationsForm() { diff --git a/src/app/form/form-view/structure-form/structure-form.component.ts b/src/app/form/form-view/structure-form/structure-form.component.ts index f4e58be22769244ab6d1c9119059d8e54580cc2e..2bb467f9199bbb39a3ed9260c63467f6a51a7658 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.ts +++ b/src/app/form/form-view/structure-form/structure-form.component.ts @@ -204,7 +204,13 @@ export class StructureFormComponent implements OnChanges, OnInit { valid: this.structureForm.get('equipmentsAndServices').valid, }; this.pagesValidation[structureFormStep.structureEquipments] = { - valid: true, + valid: + this.structureForm.get('nbComputers').valid && + this.structureForm.get('nbPrinters').valid && + this.structureForm.get('nbTablets').valid && + this.structureForm.get('nbNumericTerminal').valid && + this.structureForm.get('nbScanners').valid, + name: 'Equipements mis à disposition', }; this.pagesValidation[structureFormStep.structureLabels] = { valid: true, diff --git a/src/app/form/structure-form/form.component.scss b/src/app/form/structure-form/form.component.scss index a45d37a3620dcab843130c75e873e15c3b8487e9..b9e9e2ff6608722046ec84531f564178be4e7732 100644 --- a/src/app/form/structure-form/form.component.scss +++ b/src/app/form/structure-form/form.component.scss @@ -32,7 +32,7 @@ h4 { .footer { width: 100%; - max-width: 1000px; + max-width: 980px; margin: 20px auto; text-align: center; &.desktop { @@ -127,7 +127,7 @@ h4 { } } .page { - max-width: 1000px; + max-width: 980px; box-sizing: border-box; margin: auto; min-height: 450px; diff --git a/src/app/login/login.component.scss b/src/app/login/login.component.scss index 155a3d3d4e17db742bdd6c4e76e3279ed47d38d8..a03988f8d8d8e54b1c5bc9d3585f1d442e1742a5 100644 --- a/src/app/login/login.component.scss +++ b/src/app/login/login.component.scss @@ -13,7 +13,7 @@ } .loginPage { width: 100%; - max-width: 1000px; + max-width: 980px; box-sizing: border-box; margin: auto; min-height: 450px; diff --git a/src/app/reset-password/reset-password.component.scss b/src/app/reset-password/reset-password.component.scss index 5f15d7666d451f2b48350743577978e01e6a5ee9..241a92753c0aa7a4ac3c9cec3664f2b35f26ac8d 100644 --- a/src/app/reset-password/reset-password.component.scss +++ b/src/app/reset-password/reset-password.component.scss @@ -12,7 +12,7 @@ } .resetPage { width: 100%; - max-width: 1000px; + max-width: 980px; box-sizing: border-box; margin: auto; min-height: 450px; diff --git a/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss b/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss index ef712e2a3b445ed76b4cda39ef3c23d4290c0d46..8fea868d57f8e78d5289c65e58167eeb518efd4f 100644 --- a/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss +++ b/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss @@ -90,6 +90,7 @@ svg { } .btn-grid { padding: 0px 15px 19px 12px; + user-select: none; } .collapseHeader { .titleCollapse { diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index dc577ff3b5d9a55c5ac4ecf99ea17963a4827797..ec78eb627168561eb2c599b9b5e9bda1b8f7288e 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -124,26 +124,39 @@ export class formUtils { digitalCultureSecurity: new FormControl(structure.digitalCultureSecurity), nbComputers: new FormControl( structure.equipmentsAndServices.includes('ordinateurs') ? structure.nbComputers : 0, - [Validators.required, Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), Validators.min(0)] + [ + Validators.required, + Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), + Validators.min(0), + Validators.max(1000), + ] ), nbPrinters: new FormControl(structure.equipmentsAndServices.includes('imprimantes') ? structure.nbPrinters : 0, [ Validators.required, Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), Validators.min(0), + Validators.max(1000), ]), nbTablets: new FormControl(structure.equipmentsAndServices.includes('tablettes') ? structure.nbTablets : 0, [ Validators.required, Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), Validators.min(0), + Validators.max(1000), ]), nbNumericTerminal: new FormControl( structure.equipmentsAndServices.includes('bornesNumeriques') ? structure.nbNumericTerminal : 0, - [Validators.required, Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), Validators.min(0)] + [ + Validators.required, + Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), + Validators.min(0), + Validators.max(1000), + ] ), nbScanners: new FormControl(structure.equipmentsAndServices.includes('scanners') ? structure.nbScanners : 0, [ Validators.required, Validators.pattern(CustomRegExp.NO_NEGATIVE_NUMBER), Validators.min(0), + Validators.max(1000), ]), freeWorkShop: new FormControl(structure.freeWorkShop, [Validators.required]), dataShareConsentDate: new FormControl(structure.dataShareConsentDate),