Skip to content
Snippets Groups Projects
Commit 69ac5b2c authored by descamps's avatar descamps
Browse files

KDE - 10/06/2021 - WIP - Checkbox valeur fixe

parent c1b857e5
No related branches found
No related tags found
7 merge requests!58compare branch,!54Comparaison de merge vers vitam-ui,!53Comparaison de merge vers vitam-ui,!52Voir difference entre les deux verion,!41MAJ: compare to vitam-ui,!29BreadCrumb,!5KDE - 11/06/2021 - WIP - Changement popup Attributs :
......@@ -97,11 +97,14 @@
</div>
</ng-container>
<ng-container *ngSwitchCase="'enumeration'">
<mat-select placeholder="Choisissez une valeur" [ngModel]="element.valeurFixe"
(ngModelChange)="setNodeValue(element,$event)" class="mat-select-valeur-fixe">
<mat-option [value]=""></mat-option>
<mat-option *ngFor="let val of element.enumeration" [value]="val">{{val}}</mat-option>
</mat-select>
<mat-select placeholder="Choisissez une valeur" [ngModel]="element.valeurFixe"
class="mat-select-valeur-fixe">
<mat-option [value]=""></mat-option>
<mat-option *ngFor="let val of element.enumeration; let i =index" [value]="val">
<mat-checkbox [checked]="selected === i" (change)="onChange(element,val);selected = i"> {{val}}
</mat-checkbox>
</mat-option>
</mat-select>
</ng-container>
<ng-container *ngIf="!checkElementType(element.nomDuChamp)">
<!-- <textarea matInput *ngSwitchDefault [ngModel]="element.valeurFixe"
......
......@@ -52,6 +52,7 @@ import { NotificationService } from 'projects/pastis/src/app/core/services/notif
import { NgxUiLoaderService } from 'ngx-ui-loader';
import { Router } from '@angular/router';
import {Subscription} from "rxjs";
import {MatCheckboxChange} from "@angular/material/checkbox";
......@@ -70,6 +71,7 @@ export class FileTreeMetadataComponent {
dataType = Object.values(DataTypeConstants);
cardinalityList: string[];
cardinalityLabels = Object.values(CardinalityConstants)
selected = -1;
//Mat table
matDataSource: MatTableDataSource<MetadataHeaders>;
......@@ -236,15 +238,18 @@ export class FileTreeMetadataComponent {
}
setNodeValue(metadata: MetadataHeaders, newValue: string) {
let updatedValue = newValue.length > 0 ? newValue : null
if (this.clickedNode.name === metadata.nomDuChamp) {
this.clickedNode.value = updatedValue;
} else if (this.clickedNode.children.length > 0) {
let childNode = this.fileService.getFileNodeById(this.clickedNode, metadata.id);
if (childNode) {
childNode.value = updatedValue;
}
}
console.log(metadata.cardinalite + "new Value " + newValue)
if(newValue != null) {
let updatedValue = newValue.length > 0 ? newValue : null
if (this.clickedNode.name === metadata.nomDuChamp) {
this.clickedNode.value = updatedValue;
} else if (this.clickedNode.children.length > 0) {
let childNode = this.fileService.getFileNodeById(this.clickedNode, metadata.id);
if (childNode) {
childNode.value = updatedValue;
}
}
}
}
setDocumentation(metadata: MetadataHeaders, comment: string) {
......@@ -438,4 +443,12 @@ 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);
}
}
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