-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-13156] - Access intelligence page (#11420)
* WIP - access intelligence page * finish access intelligence page * finish access intelligence page * use tab label directive * remove extension swap change * only show when feature flag enabled * Move files under tools ownership --------- Co-authored-by: Daniel James Smith <[email protected]>
- Loading branch information
1 parent
36c965c
commit 7fc987d
Showing
12 changed files
with
239 additions
and
0 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
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
25 changes: 25 additions & 0 deletions
25
apps/web/src/app/tools/access-intelligence/access-intelligence-routing.module.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,25 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { RouterModule, Routes } from "@angular/router"; | ||
|
||
import { unauthGuardFn } from "@bitwarden/angular/auth/guards"; | ||
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard"; | ||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; | ||
|
||
import { AccessIntelligenceComponent } from "./access-intelligence.component"; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: "", | ||
component: AccessIntelligenceComponent, | ||
canActivate: [canAccessFeature(FeatureFlag.AccessIntelligence), unauthGuardFn()], | ||
data: { | ||
titleId: "accessIntelligence", | ||
}, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class AccessIntelligenceRoutingModule {} |
23 changes: 23 additions & 0 deletions
23
apps/web/src/app/tools/access-intelligence/access-intelligence.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<app-header></app-header> | ||
<bit-tab-group [(selectedIndex)]="tabIndex"> | ||
<bit-tab label="{{ 'allApplicationsWithCount' | i18n: apps.length }}"> | ||
<h2 bitTypography="h2">{{ "allApplications" | i18n }}</h2> | ||
<tools-application-table></tools-application-table> | ||
</bit-tab> | ||
<bit-tab> | ||
<ng-template bitTabLabel> | ||
<i class="bwi bwi-star"></i> | ||
{{ "priorityApplicationsWithCount" | i18n: priorityApps.length }} | ||
</ng-template> | ||
<h2 bitTypography>{{ "priorityApplications" | i18n }}</h2> | ||
<tools-application-table></tools-application-table> | ||
</bit-tab> | ||
<bit-tab> | ||
<ng-template bitTabLabel> | ||
<i class="bwi bwi-envelope"></i> | ||
{{ "notifiedMembersWithCount" | i18n: priorityApps.length }} | ||
</ng-template> | ||
<h2 bitTypography="h2">{{ "notifiedMembers" | i18n }}</h2> | ||
<tools-notified-members-table></tools-notified-members-table> | ||
</bit-tab> | ||
</bit-tab-group> |
45 changes: 45 additions & 0 deletions
45
apps/web/src/app/tools/access-intelligence/access-intelligence.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { Component } from "@angular/core"; | ||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; | ||
import { ActivatedRoute } from "@angular/router"; | ||
import { first } from "rxjs"; | ||
|
||
import { JslibModule } from "@bitwarden/angular/jslib.module"; | ||
import { TabsModule } from "@bitwarden/components"; | ||
|
||
import { HeaderModule } from "../../layouts/header/header.module"; | ||
|
||
import { ApplicationTableComponent } from "./application-table.component"; | ||
import { NotifiedMembersTableComponent } from "./notified-members-table.component"; | ||
|
||
export enum AccessIntelligenceTabType { | ||
AllApps = 0, | ||
PriorityApps = 1, | ||
NotifiedMembers = 2, | ||
} | ||
|
||
@Component({ | ||
standalone: true, | ||
templateUrl: "./access-intelligence.component.html", | ||
imports: [ | ||
ApplicationTableComponent, | ||
CommonModule, | ||
JslibModule, | ||
HeaderModule, | ||
NotifiedMembersTableComponent, | ||
TabsModule, | ||
], | ||
}) | ||
export class AccessIntelligenceComponent { | ||
tabIndex: AccessIntelligenceTabType; | ||
|
||
apps: any[] = []; | ||
priorityApps: any[] = []; | ||
notifiedMembers: any[] = []; | ||
|
||
constructor(route: ActivatedRoute) { | ||
route.queryParams.pipe(takeUntilDestroyed(), first()).subscribe(({ tabIndex }) => { | ||
this.tabIndex = !isNaN(tabIndex) ? tabIndex : AccessIntelligenceTabType.AllApps; | ||
}); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/web/src/app/tools/access-intelligence/access-intelligence.module.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,9 @@ | ||
import { NgModule } from "@angular/core"; | ||
|
||
import { AccessIntelligenceRoutingModule } from "./access-intelligence-routing.module"; | ||
import { AccessIntelligenceComponent } from "./access-intelligence.component"; | ||
|
||
@NgModule({ | ||
imports: [AccessIntelligenceComponent, AccessIntelligenceRoutingModule], | ||
}) | ||
export class AccessIntelligenceModule {} |
11 changes: 11 additions & 0 deletions
11
apps/web/src/app/tools/access-intelligence/application-table.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- <bit-table [dataSource]="dataSource"> --> | ||
<ng-container header> | ||
<tr> | ||
<th bitCell>{{ "application" | i18n }}</th> | ||
<th bitCell>{{ "atRiskPasswords" | i18n }}</th> | ||
<th bitCell>{{ "totalPasswords" | i18n }}</th> | ||
<th bitCell>{{ "atRiskMembers" | i18n }}</th> | ||
<th bitCell>{{ "totalMembers" | i18n }}</th> | ||
</tr> | ||
</ng-container> | ||
<!-- </bit-table> --> |
19 changes: 19 additions & 0 deletions
19
apps/web/src/app/tools/access-intelligence/application-table.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { Component } from "@angular/core"; | ||
|
||
import { JslibModule } from "@bitwarden/angular/jslib.module"; | ||
import { TableDataSource, TableModule } from "@bitwarden/components"; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: "tools-application-table", | ||
templateUrl: "./application-table.component.html", | ||
imports: [CommonModule, JslibModule, TableModule], | ||
}) | ||
export class ApplicationTableComponent { | ||
protected dataSource = new TableDataSource<any>(); | ||
|
||
constructor() { | ||
this.dataSource.data = []; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
apps/web/src/app/tools/access-intelligence/notified-members-table.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- <bit-table [dataSource]="dataSource"> --> | ||
<ng-container header> | ||
<tr> | ||
<th bitCell>{{ "member" | i18n }}</th> | ||
<th bitCell>{{ "atRiskPasswords" | i18n }}</th> | ||
<th bitCell>{{ "totalPasswords" | i18n }}</th> | ||
<th bitCell>{{ "atRiskApplications" | i18n }}</th> | ||
<th bitCell>{{ "totalApplications" | i18n }}</th> | ||
</tr> | ||
</ng-container> | ||
<!-- </bit-table> --> |
19 changes: 19 additions & 0 deletions
19
apps/web/src/app/tools/access-intelligence/notified-members-table.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { Component } from "@angular/core"; | ||
|
||
import { JslibModule } from "@bitwarden/angular/jslib.module"; | ||
import { TableDataSource, TableModule } from "@bitwarden/components"; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: "tools-notified-members-table", | ||
templateUrl: "./notified-members-table.component.html", | ||
imports: [CommonModule, JslibModule, TableModule], | ||
}) | ||
export class NotifiedMembersTableComponent { | ||
dataSource = new TableDataSource<any>(); | ||
|
||
constructor() { | ||
this.dataSource.data = []; | ||
} | ||
} |
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