-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (clients) : add client identifier
fixes: #260
- Loading branch information
Showing
6 changed files
with
165 additions
and
56 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
96 changes: 48 additions & 48 deletions
96
src/app/clients/clients-view/identities-tab/identities-tab.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,62 +1,62 @@ | ||
<div class="tab-container mat-typography"> | ||
|
||
<!-- Identities Table --> | ||
<!-- Identities Table --> | ||
|
||
<h3>Identities</h3> | ||
<h3>Identities</h3> | ||
|
||
<button mat-raised-button class="f-right" color="primary"> | ||
<button mat-raised-button class="f-right" color="primary" (click)="addIdentifier()"> | ||
<fa-icon icon="plus"></fa-icon> Add | ||
</button> | ||
|
||
<table mat-table #identifiersTable [dataSource]="clientIdentities" class="mat-elevation-z1"> | ||
|
||
<ng-container matColumnDef="id"> | ||
<th mat-header-cell *matHeaderCellDef> Id </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
{{identity.id}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="description"> | ||
<th mat-header-cell *matHeaderCellDef> Description </th> | ||
<td mat-cell *matCellDef="let identity"> {{identity.description}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="type"> | ||
<th mat-header-cell *matHeaderCellDef> type </th> | ||
<td mat-cell *matCellDef="let identity"> {{identity.documentType.name}} | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="documents"> | ||
<th mat-header-cell *matHeaderCellDef>Identity Documents </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
<div *ngFor="let document of identity.documents"> | ||
{{document.name}} | ||
<fa-icon icon="cloud-download-alt" (click)="download(document.parentEntityId,document.id)"></fa-icon> | ||
</div> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="status"> | ||
<th mat-header-cell *matHeaderCellDef> Status </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
{{(identity.status==='clientIdentifierStatusType.active')?'active':'inactive'}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="actions"> | ||
<th mat-header-cell *matHeaderCellDef> Actions </th> | ||
<td mat-cell *matCellDef="let identity; let i = index"> | ||
<button class="identity-action-button" mat-raised-button color="primary" (click)="uploadDocument(i,identity.id)"> | ||
<table mat-table #identifiersTable [dataSource]="clientIdentities" class="mat-elevation-z1"> | ||
|
||
<ng-container matColumnDef="id"> | ||
<th mat-header-cell *matHeaderCellDef> Id </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
{{identity.id}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="description"> | ||
<th mat-header-cell *matHeaderCellDef> Description </th> | ||
<td mat-cell *matCellDef="let identity"> {{identity.description}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="type"> | ||
<th mat-header-cell *matHeaderCellDef> type </th> | ||
<td mat-cell *matCellDef="let identity"> {{identity.documentType.name}} | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="documents"> | ||
<th mat-header-cell *matHeaderCellDef>Identity Documents </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
<div *ngFor="let document of identity.documents"> | ||
{{document.name}} | ||
<fa-icon icon="cloud-download-alt" (click)="download(document.parentEntityId,document.id)"></fa-icon> | ||
</div> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="status"> | ||
<th mat-header-cell *matHeaderCellDef> Status </th> | ||
<td mat-cell *matCellDef="let identity"> | ||
{{(identity.status==='clientIdentifierStatusType.active')?'active':'inactive'}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="actions"> | ||
<th mat-header-cell *matHeaderCellDef> Actions </th> | ||
<td mat-cell *matCellDef="let identity; let i = index"> | ||
<button class="identity-action-button" mat-raised-button color="primary" (click)="uploadDocument(i,identity.id)"> | ||
<fa-icon icon="cloud-upload-alt"></fa-icon> | ||
</button> | ||
<button class="identity-action-button" mat-raised-button color="warn" (click)="deleteIdentifier(identity.clientId,identity.id,i)"> | ||
<button class="identity-action-button" mat-raised-button color="warn" (click)="deleteIdentifier(identity.clientId,identity.id,index)"> | ||
<fa-icon icon="times"></fa-icon> | ||
</button> | ||
</td> | ||
</ng-container> | ||
</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="identitiesColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: identitiesColumns;"></tr> | ||
</table> | ||
<tr mat-header-row *matHeaderRowDef="identitiesColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: identitiesColumns;"></tr> | ||
</table> | ||
|
||
</div> |
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
30 changes: 30 additions & 0 deletions
30
src/app/clients/common-resolvers/client-identifier-template.resolver.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** Angular Imports */ | ||
import { Injectable } from '@angular/core'; | ||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; | ||
|
||
/** rxjs Imports */ | ||
import { Observable } from 'rxjs'; | ||
|
||
|
||
/** Custom Services */ | ||
import { ClientsService } from '../clients.service'; | ||
|
||
/** | ||
* Client Identifier Template resolver. | ||
*/ | ||
@Injectable() | ||
export class ClientIdentifierTemplateResolver implements Resolve<Object> { | ||
/** | ||
* @param {ClientsService} ClientsService Clients service. | ||
*/ | ||
constructor(private clientsService: ClientsService) { } | ||
/** | ||
* Returns the Client Identities data. | ||
* @returns {Observable<any>} | ||
*/ | ||
resolve(route: ActivatedRouteSnapshot): Observable<any> { | ||
const clientId = route.parent.paramMap.get('clientId'); | ||
return this.clientsService.getClientIdentifierTemplate(clientId); | ||
} | ||
} | ||
|
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