mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
[SM-45] Scaffold secrets manager module (#2989)
* Scaffold secrets manager module
This commit is contained in:
parent
d99acd818b
commit
80ee6d23c3
@ -78,11 +78,11 @@ img.logo {
|
||||
height: 43px;
|
||||
margin: 0 auto;
|
||||
width: 284px;
|
||||
}
|
||||
|
||||
&.logo-themed {
|
||||
@include themify($themes) {
|
||||
content: url("../images/logo-" + themed("logoSuffix") + "@2x.png");
|
||||
}
|
||||
img.logo-themed {
|
||||
@include themify($themes) {
|
||||
content: url("../images/logo-" + themed("logoSuffix") + "@2x.png");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,10 @@
|
||||
/* eslint-disable no-undef, @typescript-eslint/no-var-requires */
|
||||
const config = require("../../libs/components/tailwind.config.base");
|
||||
|
||||
config.content = [
|
||||
"./src/**/*.{html,ts}",
|
||||
"../../libs/components/src/**/*.{html,ts}",
|
||||
"../../bitwarden_license/bit-web/src/**/*.{html,ts}",
|
||||
];
|
||||
|
||||
module.exports = config;
|
||||
|
@ -8,6 +8,10 @@ const routes: Routes = [
|
||||
path: "providers",
|
||||
loadChildren: () => ProvidersModule,
|
||||
},
|
||||
{
|
||||
path: "sm",
|
||||
loadChildren: async () => (await import("./sm/sm.module")).SecretsManagerModule,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -0,0 +1,8 @@
|
||||
<div class="tw-flex tw-w-full">
|
||||
<aside class="tw-w-60 tw-bg-background tw-min-h-screen">
|
||||
<router-outlet name="sidebar"></router-outlet>
|
||||
</aside>
|
||||
<main class="tw-flex-1 tw-bg-background-alt tw-min-h-screen tw-px-6 tw-pt-3">
|
||||
<router-outlet></router-outlet>
|
||||
</main>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: "sm-layout",
|
||||
templateUrl: "./layout.component.html",
|
||||
})
|
||||
export class LayoutComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
document.body.classList.remove("layout_frontend");
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<img alt="Bitwarden" class="logo-themed tw-box-border tw-block tw-w-full tw-py-5 tw-px-3" />
|
||||
|
||||
<div class="card mb-4 tw-m-2">
|
||||
<div class="list-group list-group-flush">
|
||||
<a routerLink="projects" class="list-group-item" routerLinkActive="active"> Projects </a>
|
||||
<a routerLink="secrets" class="list-group-item" routerLinkActive="active"> Secrets </a>
|
||||
<a routerLink="serviceAccounts" class="list-group-item" routerLinkActive="active">
|
||||
Service Accounts
|
||||
</a>
|
||||
<a routerLink="trash" class="list-group-item" routerLinkActive="active"> Trash </a>
|
||||
<a routerLink="settings" class="list-group-item" routerLinkActive="active"> Settings </a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,7 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: "sm-navigation",
|
||||
templateUrl: "./navigation.component.html",
|
||||
})
|
||||
export class NavigationComponent {}
|
@ -0,0 +1,17 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
|
||||
import { SecretsComponent } from "./secrets.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: "",
|
||||
component: SecretsComponent,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class SecretsRoutingModule {}
|
@ -0,0 +1 @@
|
||||
<h1 class="tw-text-3x tw-font-semibold">Secrets</h1>
|
@ -0,0 +1,7 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: "sm-secrets",
|
||||
templateUrl: "./secrets.component.html",
|
||||
})
|
||||
export class SecretsComponent {}
|
@ -0,0 +1,12 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { NgModule } from "@angular/core";
|
||||
|
||||
import { SecretsRoutingModule } from "./secrets-routing.module";
|
||||
import { SecretsComponent } from "./secrets.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, SecretsRoutingModule],
|
||||
declarations: [SecretsComponent],
|
||||
providers: [],
|
||||
})
|
||||
export class SecretsModule {}
|
36
bitwarden_license/bit-web/src/app/sm/sm-routing.module.ts
Normal file
36
bitwarden_license/bit-web/src/app/sm/sm-routing.module.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
|
||||
import { LayoutComponent } from "./layout/layout.component";
|
||||
import { NavigationComponent } from "./layout/navigation.component";
|
||||
import { SecretsModule } from "./secrets/secrets.module";
|
||||
import { SMGuard } from "./sm.guard";
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: "",
|
||||
component: LayoutComponent,
|
||||
canActivate: [SMGuard],
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
component: NavigationComponent,
|
||||
outlet: "sidebar",
|
||||
},
|
||||
{
|
||||
path: "secrets",
|
||||
loadChildren: () => SecretsModule,
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
redirectTo: "secrets",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class SecretsManagerRoutingModule {}
|
13
bitwarden_license/bit-web/src/app/sm/sm.guard.ts
Normal file
13
bitwarden_license/bit-web/src/app/sm/sm.guard.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { ActivatedRouteSnapshot, CanActivate } from "@angular/router";
|
||||
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
|
||||
@Injectable()
|
||||
export class SMGuard implements CanActivate {
|
||||
constructor(private platformUtilsService: PlatformUtilsService) {}
|
||||
|
||||
async canActivate(route: ActivatedRouteSnapshot) {
|
||||
return this.platformUtilsService.isDev();
|
||||
}
|
||||
}
|
19
bitwarden_license/bit-web/src/app/sm/sm.module.ts
Normal file
19
bitwarden_license/bit-web/src/app/sm/sm.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { NgModule } from "@angular/core";
|
||||
import { FormsModule } from "@angular/forms";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
|
||||
import { OssModule } from "src/app/oss.module";
|
||||
|
||||
import { LayoutComponent } from "./layout/layout.component";
|
||||
import { NavigationComponent } from "./layout/navigation.component";
|
||||
import { SecretsManagerRoutingModule } from "./sm-routing.module";
|
||||
import { SMGuard } from "./sm.guard";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, FormsModule, OssModule, JslibModule, SecretsManagerRoutingModule],
|
||||
declarations: [LayoutComponent, NavigationComponent],
|
||||
providers: [SMGuard],
|
||||
})
|
||||
export class SecretsManagerModule {}
|
Loading…
Reference in New Issue
Block a user