From fc5fa1792daa345c5ff1326fc5d82e3c6d7f34e0 Mon Sep 17 00:00:00 2001 From: Cindy <cindy.nacibide@teamdlab.com> Date: Wed, 9 Dec 2020 19:25:44 +0100 Subject: [PATCH] [FIX TRTL-568] fix javascript errors --- .../group-attribution.component.html | 2 +- .../group-attribution/group-attribution.component.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html index 6d9fa637c..cc323e632 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html @@ -23,7 +23,7 @@ <ng-container *ngFor="let group of activeGroups; let index = index"> <div class="vitamui-row p-0 px-4" [class.no-hover]="row.state === 'expanded'" *ngIf="!group?.selected" [vitamuiCommonCollapse] #row="vitamuiCommonCollapse"> <div class="d-flex justify-content-between align-items-center clickable"> - <div class="row-label d-flex align-items-center" (click)="updateGroup(group?.id,group?.name, row)">{{group?.name}}</div> + <div class="row-label d-flex align-items-center" (click)="updateGroup(group?.id,group?.name)">{{group?.name}}</div> <button class="btn link underline" (click)="row.toggle()">{{row.state === 'collapsed' ? "Voir detail" : "Masquer detail"}}</button> </div> <app-group-detail *ngIf="row.state === 'expanded'" [group]="group" [@expansionAnimation]></app-group-detail> diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts index 5ad4e72c1..02569731f 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts @@ -36,7 +36,7 @@ */ /* tslint:disable: no-use-before-declare */ -import { CollapseDirective, Group, User } from 'ui-frontend-common'; +import { Group, User } from 'ui-frontend-common'; import { animate, state, style, transition, trigger } from '@angular/animations'; import { Component, forwardRef, Inject, OnInit } from '@angular/core'; @@ -62,6 +62,12 @@ export const GROUP_ATTRIBUTION_VALUE_ACCESSOR: any = { state('expanded', style({ height: '*', visibility: 'visible' })), transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')), ]), + trigger('expansionAnimation', [ + state('true', style({ height: '*', visibility: 'visible' })), + state('void', style({ height: '0px', visibility: 'hidden' })), + transition(':enter', animate('150ms')), + transition(':leave', animate('150ms')), + ]), ] }) export class GroupAttributionComponent implements OnInit { @@ -109,15 +115,13 @@ export class GroupAttributionComponent implements OnInit { this.unselectAllProfileGroups(); } - public updateGroup(groupId: string, groupName: string, groupLevel: string, collapseDirective: CollapseDirective): void { + public updateGroup(groupId: string, groupName: string): void { this.selectedGroupName = groupName; this.user.groupId = groupId; - this.user.level = groupLevel; this.unselectAllProfileGroups(); const selectedGroup = this.activeGroups.find((group) => group.id === groupId); if (selectedGroup) { selectedGroup.selected = true; - collapseDirective.collapse(); } } -- GitLab