Skip to content

Commit

Permalink
Merge pull request #64 from KB-iGOT/cbrelease-4.8.17
Browse files Browse the repository at this point in the history
Cbrelease 4.8.17 merge into Cbrelease 4.8.18
  • Loading branch information
vishnubansaltarento authored Oct 15, 2024
2 parents 42b049f + 87a32e2 commit b31af48
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
</mat-expansion-panel>
</mat-accordion>

<mat-card class="no-border mt-4">
<mat-card class="no-border mt-4" *ngIf="hassAccessToreports">
<mat-card-content>

<ng-container>
<mat-card class="mt-8">
<ng-container>
Expand Down Expand Up @@ -75,7 +74,8 @@
</mat-card>
<ng-container class="margin-top-l">
<div class="table-container">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8 full-width-table">
<table matSort mat-table [dataSource]="dataSource" [matSortActive]="orgName" [matSortDirection]="asc"
class="mat-elevation-z8 full-width-table">
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef class="header-checkbox">
<mat-checkbox (change)="$event ? masterToggle() : null" [checked]="isAllSelected()"
Expand All @@ -90,7 +90,8 @@
</ng-container>

<ng-container matColumnDef="orgName">
<th mat-header-cell *matHeaderCellDef class="header-cell"> Organisation Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header="orgName" class="header-cell"> Organisation Name
</th>
<td mat-cell *matCellDef="let element" class="cell h-400-r-14-l"> {{element.orgName}} </td>
</ng-container>

Expand Down Expand Up @@ -171,17 +172,24 @@
</mat-card-content>
</mat-card>

<div class="mt-8">
<mat-accordion>
<mat-expansion-panel (opened)="panelStateAccessCtrl = true" (closed)="panelStateAccessCtrl = false">
<mat-expansion-panel-header>
<mat-panel-title>
<div class="flex-4 mobile-margin text-capitalize mat-h2 padding-10">Access Control to MDO Admins:</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="flex gap-10 mt-2">
<ng-container *ngIf="showAdminsTable">
<ng-container *ngIf="!showLoaderOnTable; else loader">
<div class="mt-10 flex justify-center items-center h-full" *ngIf="!hassAccessToreports">
<p class="text-center">
Your access to reports expired on {{reportAccessExpireDate | date:'dd-MMM-yyyy'}}. Please
contact your MDO Leader to renew access.
</p>
</div>

<ng-container *ngIf="showAdminsTable">
<div class="mt-8" *ngIf="!showLoaderOnTable">
<mat-accordion>
<mat-expansion-panel (opened)="panelStateAccessCtrl = true" (closed)="panelStateAccessCtrl = false">
<mat-expansion-panel-header>
<mat-panel-title>
<div class="flex-4 mobile-margin text-capitalize mat-h2 padding-10">Access Control to MDO Admins:</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="flex gap-10 mt-2">
<ng-container>
<div class="mt-8 full-width-table">
<ws-app-admins-table [tableHeaders]="adminTableData" [tableData]="adminTableDataSource"
(updateAccess)="updateAccess($event)"></ws-app-admins-table>
Expand All @@ -191,15 +199,15 @@
<button mat-raised-button class="laodMoreBtn" (click)="getAdmins()">Load more...</button>
</div> -->
</ng-container>
</ng-container>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</ng-container>
</div>
</ng-container>
<ng-container *ngIf="!noteLoaded || reportsDownlaoding">
<!-- <ng-container *ngIf="!noteLoaded || reportsDownlaoding">
<div class="reports-loader">
<mat-spinner></mat-spinner>
</div>
</ng-container>
</ng-container> -->
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { MatDialog, MatPaginator, MatSnackBar, MatTableDataSource } from '@angular/material'
import { MatDialog, MatPaginator, MatSnackBar, MatSort, MatTableDataSource } from '@angular/material'
import { DownloadReportService } from '../../services/download-report.service'
import { DatePipe } from '@angular/common'
import { mergeMap } from 'rxjs/operators'
Expand Down Expand Up @@ -34,6 +34,7 @@ export class ReportsSectionComponent implements OnInit {
noteLoaded = false
reportsNoteList: string[] = []
hassAccessToreports = false
reportAccessExpireDate: any
reportsAvailbale = false
reportsDownlaoding = false
teamUrl: any
Expand All @@ -59,6 +60,12 @@ export class ReportsSectionComponent implements OnInit {
this.dataSource.paginator = this.paginator
}

@ViewChild(MatSort, { static: false }) set matSort(sort: MatSort) {
if (!this.dataSource.sort) {
this.dataSource.sort = sort
}
}

constructor(
private activeRouter: ActivatedRoute,
private downloadService: DownloadReportService,
Expand Down Expand Up @@ -205,6 +212,7 @@ export class ReportsSectionComponent implements OnInit {
//#endregion

getNoteList(isMDOLeader: boolean, hasUsers: boolean, userAccessExpireDate: string) {
this.reportAccessExpireDate = userAccessExpireDate
if (hasUsers) {
if (isMDOLeader) {
this.hassAccessToreports = true
Expand All @@ -228,13 +236,13 @@ export class ReportsSectionComponent implements OnInit {
this.reportsNoteList = [
`These reports contain Personally Identifiable Information (PII) data.
Please use them cautiously.`,
`Your access to the report is available until ${this.datePipe.transform(userAccessExpireDate, 'dd/MM/yyyy')}.
`Your access to the report is available until ${this.datePipe.transform(userAccessExpireDate, 'dd-MMM-yyyy')}.
Please contact your MDO Leader to renew your access.`,
]
} else if (userAccessExpireDate < todayDate) {
this.hassAccessToreports = false
this.reportsNoteList = [
`Your access to reports expired on ${this.datePipe.transform(userAccessExpireDate, 'dd/MM/yyyy')}. Please
`Your access to reports expired on ${this.datePipe.transform(userAccessExpireDate, 'dd-MMM-yyyy')}. Please
contact your MDO Leader to renew access.`,
]
} else {
Expand Down

0 comments on commit b31af48

Please sign in to comment.