Commit 7529ff02 authored by descamps's avatar descamps
Browse files

KDE - 26/04/2022 - Fix Checkbox Choix Valeur fixe

parent 6b5c668a
......@@ -108,14 +108,13 @@
</ng-container>
<ng-container *ngSwitchCase="'enumeration'">
<mat-select [ngModel]="element.valeurFixe" class="mat-select-valeur-fixe"
placeholder="Choisissez une valeur" *ngIf="profileService.profileMode === 'PA'">
<mat-option [value]=""></mat-option>
<mat-option *ngFor="let val of element.enumeration; let i =index" [value]="val">
<mat-checkbox (change)="onChange(element,val);selected = i" [checked]="selected === i"> {{val}}
</mat-checkbox>
placeholder="Choisissez une valeur" *ngIf="profileService.profileMode === 'PA'" (selectionChange)="onChangeSelected(element,$event.value)">
<mat-option [value]="">--None--</mat-option>
<mat-option *ngFor="let val of element.enumeration; let i =index" [value]="val"> {{val}}
</mat-option>
</mat-select>
</ng-container>
<ng-container *ngIf="!checkElementType(element.nomDuChamp)">
<div *ngSwitchDefault class="pastis-vitamui-container-editable-valeur-fixe">
<vitamui-common-editable-textarea (ngModelChange)="setNodeValue(element,$event)" [maxlength]="120"
......@@ -306,7 +305,7 @@
</mat-form-field>
<ng-template #blockInput>
<vitamui-common-editable-input (ngModelChange)="addEnumsControl($event)" [ngModel]="editedEnumControl">
</vitamui-common-editable-input>
</vitamui-common-editable-input>
</ng-template>
</div>
<div class="col-8" *ngIf="isEmptyEnumeration(enumerationsSedaControl) && isDataType()"><p class="pastis-indication">{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.FORMAT_ENUMERATION_AUTORISES' |
......@@ -432,4 +431,4 @@
</ng-template>
</mat-sidenav-content>
</mat-sidenav-container>
\ No newline at end of file
</mat-sidenav-container>
......@@ -256,7 +256,7 @@ export class FileTreeMetadataComponent {
this.popupControlOkLabel = 'AJOUTER LES CONTROLES';
}
this.additionalPropertiesMetadonnee = false;
this.docPath = this.isStandalone ? 'assets/doc/Standalone - Documentation APP - PASTIS.pdf' : 'assets/doc/VITAM UI - Documentation APP - PASTIS.pdf';
this.languagePopup = false;
......@@ -850,15 +850,29 @@ export class FileTreeMetadataComponent {
}
}
onChange(val: any, $event: MatCheckboxChange) {
console.log('onChange file tree metadata go dans methode setNodeValue' + val + ' et event ' + $event);
// @ts-ignore
this.setNodeValue(val, $event);
onChangeSelected(element: any, value: any) {
if(value === undefined){
this.setOrigineNodeValue(element,value)
}
else {
console.log(value + " Valeur On Change Selected")
this.setNodeValue(element, value);
}
}
private setOrigineNodeValue(metadata: any, newValue: any) {
console.log(metadata.cardinalite + 'new Value ' + newValue);
if (this.clickedNode.name === metadata.nomDuChamp) {
this.clickedNode.value = null;
} else if (this.clickedNode.children.length > 0) {
const childNode = this.fileService.getFileNodeById(this.clickedNode, metadata.id);
if (childNode) {
childNode.value = null;
}
}
}
changeSedaLanguage() {
this.metadataLanguageService.sedaLanguage.subscribe(
(value: boolean) => {
......@@ -991,5 +1005,6 @@ export class FileTreeMetadataComponent {
return false;
}
}
Supports Markdown
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