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 @@ ...@@ -97,11 +97,14 @@
</div> </div>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="'enumeration'"> <ng-container *ngSwitchCase="'enumeration'">
<mat-select placeholder="Choisissez une valeur" [ngModel]="element.valeurFixe" <mat-select placeholder="Choisissez une valeur" [ngModel]="element.valeurFixe"
(ngModelChange)="setNodeValue(element,$event)" class="mat-select-valeur-fixe"> class="mat-select-valeur-fixe">
<mat-option [value]=""></mat-option> <mat-option [value]=""></mat-option>
<mat-option *ngFor="let val of element.enumeration" [value]="val">{{val}}</mat-option> <mat-option *ngFor="let val of element.enumeration; let i =index" [value]="val">
</mat-select> <mat-checkbox [checked]="selected === i" (change)="onChange(element,val);selected = i"> {{val}}
</mat-checkbox>
</mat-option>
</mat-select>
</ng-container> </ng-container>
<ng-container *ngIf="!checkElementType(element.nomDuChamp)"> <ng-container *ngIf="!checkElementType(element.nomDuChamp)">
<!-- <textarea matInput *ngSwitchDefault [ngModel]="element.valeurFixe" <!-- <textarea matInput *ngSwitchDefault [ngModel]="element.valeurFixe"
......
...@@ -52,6 +52,7 @@ import { NotificationService } from 'projects/pastis/src/app/core/services/notif ...@@ -52,6 +52,7 @@ import { NotificationService } from 'projects/pastis/src/app/core/services/notif
import { NgxUiLoaderService } from 'ngx-ui-loader'; import { NgxUiLoaderService } from 'ngx-ui-loader';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {MatCheckboxChange} from "@angular/material/checkbox";
...@@ -70,6 +71,7 @@ export class FileTreeMetadataComponent { ...@@ -70,6 +71,7 @@ export class FileTreeMetadataComponent {
dataType = Object.values(DataTypeConstants); dataType = Object.values(DataTypeConstants);
cardinalityList: string[]; cardinalityList: string[];
cardinalityLabels = Object.values(CardinalityConstants) cardinalityLabels = Object.values(CardinalityConstants)
selected = -1;
//Mat table //Mat table
matDataSource: MatTableDataSource<MetadataHeaders>; matDataSource: MatTableDataSource<MetadataHeaders>;
...@@ -236,15 +238,18 @@ export class FileTreeMetadataComponent { ...@@ -236,15 +238,18 @@ export class FileTreeMetadataComponent {
} }
setNodeValue(metadata: MetadataHeaders, newValue: string) { setNodeValue(metadata: MetadataHeaders, newValue: string) {
let updatedValue = newValue.length > 0 ? newValue : null console.log(metadata.cardinalite + "new Value " + newValue)
if (this.clickedNode.name === metadata.nomDuChamp) { if(newValue != null) {
this.clickedNode.value = updatedValue; let updatedValue = newValue.length > 0 ? newValue : null
} else if (this.clickedNode.children.length > 0) { if (this.clickedNode.name === metadata.nomDuChamp) {
let childNode = this.fileService.getFileNodeById(this.clickedNode, metadata.id); this.clickedNode.value = updatedValue;
if (childNode) { } else if (this.clickedNode.children.length > 0) {
childNode.value = updatedValue; let childNode = this.fileService.getFileNodeById(this.clickedNode, metadata.id);
} if (childNode) {
} childNode.value = updatedValue;
}
}
}
} }
setDocumentation(metadata: MetadataHeaders, comment: string) { setDocumentation(metadata: MetadataHeaders, comment: string) {
...@@ -438,4 +443,12 @@ export class FileTreeMetadataComponent { ...@@ -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