Skip to content
Snippets Groups Projects
Commit fc5fa179 authored by Cindy's avatar Cindy Committed by bouhaddouzay
Browse files

[FIX TRTL-568] fix javascript errors

parent 0c7151d1
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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();
}
}
......
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