Commit 1ec59e2a authored by naji's avatar naji
Browse files

disable notice submit button when Intitule is undefined

parent 92ede4b5
......@@ -9,7 +9,15 @@
<div class="row">
<div class="col-10 form-control">
<vitamui-common-input class="col-9 px-0" formControlName="identifier"
<vitamui-common-input *ngIf="modePUA" class="col-9 px-0"
placeholder="identifier" formControlName="identifier">
</vitamui-common-input>
</div>
</div>
<div class="row">
<div class="col-10 form-control">
<vitamui-common-input (change)="changeNotice()" [(ngModel)]="identifier" class="col-9 px-0" formControlName="intitule"
placeholder="{{ 'PROFILE.POP_UP_CREATION_NOTICE.INTITULE' | translate }} ">
</vitamui-common-input>
</div>
......@@ -58,7 +66,10 @@
<div class="btn-container">
<mat-dialog-actions align="right" class="pastis-dialog-confirm-buttons">
<button type="submit" class="pastis-btn-oui-dialog-confirm">{{data.okLabel}}
<button type="submit" [disabled]="identifier.length === 0 || identifier === undefined"
Class="pastis-btn-oui-dialog-confirm"
[ngStyle]="{'background': background()}"
>{{data.okLabel}}
</button>
<button type="button" class="pastis-btn-non-dialog-confirm" (click)="onCancel()">{{data.cancelLabel}}</button>
</mat-dialog-actions>
......
......@@ -135,7 +135,7 @@
}
.pastis-btn-oui-dialog-confirm {
background: #9C31B5 !important;
//background: #9C31B5 !important;
font-family: Mulish !important;
border-radius: 100px;
......
......@@ -31,6 +31,7 @@ export class CreateNoticeComponent implements OnInit {
btnIsDisabled: boolean;
dialogData: PastisDialogData;
isDisabledButton = false;
identifier:string = ""
titleDialog: string;
subTitleDialog: string;
......@@ -78,12 +79,14 @@ export class CreateNoticeComponent implements OnInit {
this.information = "texte d'information"
this.form = this.formBuilder.group({
identifier: [null, Validators.required],
intitule: [null, Validators.required],
selectedStatus: [null],
description: [null],
autoriserPresenceMetadonnees : false
//TODO à implémenter
// this.keyPressSubscription = this.confirmDialogService.listenToEscapeKeyPress(this.dialogRef).subscribe(() => this.onCancel());
});
this.presenceNonDeclareMetadonneesPUAControl.valueChanges.subscribe((value) => {
this.form.controls.autoriserPresenceMetadonnees.setValue(value);
......@@ -135,6 +138,14 @@ export class CreateNoticeComponent implements OnInit {
}
changeNotice(){
alert(this.identifier)
}
background(): string{
if(this.identifier.length === 0 || this.identifier === undefined) return 'grey'
else return '#9C31B5'
}
onSubmit() {
if (this.form.invalid) {
this.isDisabledButton = true;
......
......@@ -49,7 +49,6 @@ import {stringify} from "querystring";
import {ArchivalProfileUnit} from "../../models/archival-profile-unit";
import {Profile} from "../../models/profile";
import {ProfileDescription} from "../../models/profile-description.model";
import {Router} from "@angular/router";
import {LangChangeEvent, TranslateService} from "@ngx-translate/core";
import {environment} from "../../../environments/environment";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment