Skip to content
Snippets Groups Projects
Commit 8fb9a7db authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #10034 TIME 10 fix issues

parent 90d6912a
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
[matAutocomplete]="auto" [matChipInputFor]="chipList"> [matAutocomplete]="auto" [matChipInputFor]="chipList">
</mat-chip-list> </mat-chip-list>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)"> <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
<mat-option *ngFor="let tag of filteredOptions | async" [value]="tag" [disabled]="isSelected(tag)"> <mat-option *ngFor="let tag of filteredOptions | async" [value]="tag" [disabled]="isSelected(tag) || tag.id == id">
{{tag.label}} {{tag.label}}
</mat-option> </mat-option>
</mat-autocomplete> </mat-autocomplete>
...@@ -77,4 +77,4 @@ ...@@ -77,4 +77,4 @@
</div> </div>
</mat-list> </mat-list>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
\ No newline at end of file
...@@ -63,19 +63,19 @@ export class TagAdministrationComponent implements OnInit { ...@@ -63,19 +63,19 @@ export class TagAdministrationComponent implements OnInit {
) { ) {
} }
async ngOnInit(): Promise<void> { ngOnInit(): void {
this.loading = true; this.loading = true;
await this.getTags();
this.route.params.subscribe((params) => { this.route.params.subscribe(async (params) => {
this.id = params['id'];
await this.getTags();
if (typeof params['id'] === 'undefined') { if (typeof params['id'] === 'undefined') {
this.headerService.setHeader(this.lang.tagCreation); this.headerService.setHeader(this.lang.tagCreation);
this.creationMode = true; this.creationMode = true;
this.loading = false; this.loading = false;
} else { } else {
this.creationMode = false; this.creationMode = false;
this.id = params['id'];
this.http.get(`../../rest/tags/${this.id}`).pipe( this.http.get(`../../rest/tags/${this.id}`).pipe(
tap((data: any) => { tap((data: any) => {
Object.keys(this.tag).forEach(element => { Object.keys(this.tag).forEach(element => {
...@@ -148,12 +148,13 @@ export class TagAdministrationComponent implements OnInit { ...@@ -148,12 +148,13 @@ export class TagAdministrationComponent implements OnInit {
return new Promise((resolve) => { return new Promise((resolve) => {
this.http.get('../../rest/tags').pipe( this.http.get('../../rest/tags').pipe(
tap((data: any) => { tap((data: any) => {
this.tags = data.tags.filter((tag: any) => tag.id !== this.id).map((tag: any) => { this.tags = data.tags.map((tag: any) => {
return { return {
id: tag.id, id: tag.id,
label: tag.label, label: tag.label,
parentId: tag.parentId, parentId: tag.parentId,
countResources: tag.countResources countResources: tag.countResources,
disabled: tag.id == this.id
}; };
}); });
resolve(true); resolve(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment