-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
360051b
commit 49f073a
Showing
6 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...ossier-management-collaborators-list/dossier-management-collaborators-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<valtimo-carbon-list | ||
hideToolbar="true" | ||
[items]="collaborators$ | async" | ||
[fields]="COLLABORATORS_FIELDS" | ||
[fields]="collaboratorsFields$ | async" | ||
[loading]="(collaborators$ | async) === null" | ||
(rowClicked)="onRowClicked()" | ||
(rowClicked)="onRowClicked($event)" | ||
></valtimo-carbon-list> | ||
|
||
<ng-template #goToLogs let-data="data"> | ||
<button cdsButton="ghost" (click)="onRowClicked(data.item)">Go to Changelogs</button> | ||
</ng-template> |
63 changes: 48 additions & 15 deletions
63
.../dossier-management-collaborators-list/dossier-management-collaborators-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,64 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import { | ||
AfterViewInit, | ||
ChangeDetectionStrategy, | ||
Component, | ||
TemplateRef, | ||
ViewChild, | ||
} from '@angular/core'; | ||
import {CarbonListModule, ColumnConfig, ViewType} from '@valtimo/components'; | ||
import {Observable, tap} from 'rxjs'; | ||
import {Collaborator} from '../../models'; | ||
import {BehaviorSubject, Observable, tap} from 'rxjs'; | ||
import {Collaborator, TabEnum} from '../../models'; | ||
import {CaseCollaboratorsService} from '../../services/case-collaborators.service'; | ||
import {ButtonModule} from 'carbon-components-angular'; | ||
import {CaseChangeLogsService, CaseMenuService, TabService} from '../../services'; | ||
|
||
@Component({ | ||
selector: 'valtimo-dossier-management-collaborators-list', | ||
templateUrl: './dossier-management-collaborators-list.component.html', | ||
styleUrl: './dossier-management-collaborators-list.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [CommonModule, CarbonListModule], | ||
imports: [CommonModule, CarbonListModule, ButtonModule], | ||
}) | ||
export class DossierManagementCollaboratorsListComponent { | ||
export class DossierManagementCollaboratorsListComponent implements AfterViewInit { | ||
@ViewChild('goToLogs') private _goToLogsTemplate: TemplateRef<any>; | ||
public readonly collaborators$: Observable<Collaborator[] | null> = | ||
this.caseCollaboratorsService.collaborators$; | ||
|
||
|
||
public readonly COLLABORATORS_FIELDS: ColumnConfig[] = [ | ||
{ | ||
key: 'email', | ||
label: 'User email', | ||
viewType: ViewType.TEXT, | ||
}, | ||
]; | ||
constructor(private readonly caseCollaboratorsService: CaseCollaboratorsService) {} | ||
public readonly collaboratorsFields$ = new BehaviorSubject<ColumnConfig[]>([]); | ||
|
||
public onRowClicked() {} | ||
constructor( | ||
private readonly caseCollaboratorsService: CaseCollaboratorsService, | ||
private readonly caseChangeLogsService: CaseChangeLogsService, | ||
private readonly caseMenuService: CaseMenuService, | ||
private readonly tabService: TabService | ||
) {} | ||
|
||
public ngAfterViewInit(): void { | ||
this.collaboratorsFields$.next([ | ||
{ | ||
key: 'email', | ||
label: 'User email', | ||
viewType: ViewType.TEXT, | ||
}, | ||
{ | ||
key: 'fullName', | ||
label: 'User name', | ||
viewType: ViewType.TEXT, | ||
}, | ||
{ | ||
key: '', | ||
label: '', | ||
viewType: ViewType.TEMPLATE, | ||
template: this._goToLogsTemplate, | ||
}, | ||
]); | ||
} | ||
|
||
public onRowClicked(collaborator: Collaborator) { | ||
this.caseChangeLogsService.activeLogSearch$.next(collaborator.id); | ||
this.caseMenuService.selectMenuItem(TabEnum.CASE_CHANGE_LOGS); | ||
this.tabService.currentTab = TabEnum.CASE_CHANGE_LOGS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters