From e7809b405d49232ec383232ffed44680209754fa Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 26 Apr 2018 17:26:19 -0400 Subject: [PATCH] tabs --- src/app/app-routing.module.ts | 26 ++++++++++++++++--- src/app/app.module.ts | 6 ++++- src/app/services/launch-guard.service.ts | 2 +- .../dashboard.component.html | 0 .../dashboard.component.ts | 0 src/app/tabs/settings.component.html | 3 +++ src/app/tabs/settings.component.ts | 20 ++++++++++++++ src/app/tabs/tabs.component.html | 13 ++++++++++ src/app/tabs/tabs.component.ts | 7 +++++ 9 files changed, 71 insertions(+), 6 deletions(-) rename src/app/{dashboard => tabs}/dashboard.component.html (100%) rename src/app/{dashboard => tabs}/dashboard.component.ts (100%) create mode 100644 src/app/tabs/settings.component.html create mode 100644 src/app/tabs/settings.component.ts create mode 100644 src/app/tabs/tabs.component.html create mode 100644 src/app/tabs/tabs.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index cd597bdb..04bdeb23 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -9,7 +9,9 @@ import { LaunchGuardService } from './services/launch-guard.service'; import { LoginComponent } from './accounts/login.component'; import { TwoFactorComponent } from './accounts/two-factor.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; +import { DashboardComponent } from './tabs/dashboard.component'; +import { SettingsComponent } from './tabs/settings.component'; +import { TabsComponent } from './tabs/tabs.component'; const routes: Routes = [ { path: '', redirectTo: '/login', pathMatch: 'full' }, @@ -20,9 +22,25 @@ const routes: Routes = [ }, { path: '2fa', component: TwoFactorComponent }, { - path: 'dashboard', - component: DashboardComponent, - canActivate: [AuthGuardService], + path: 'tabs', + component: TabsComponent, + children: [ + { + path: '', + redirectTo: '/tabs/dashboard', + pathMatch: 'full', + }, + { + path: 'dashboard', + component: DashboardComponent, + canActivate: [AuthGuardService], + }, + { + path: 'settings', + component: SettingsComponent, + canActivate: [AuthGuardService], + }, + ], }, ]; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 064af722..d4b671d2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -22,7 +22,9 @@ import { EnvironmentComponent } from './accounts/environment.component'; import { LoginComponent } from './accounts/login.component'; import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component'; import { TwoFactorComponent } from './accounts/two-factor.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; +import { DashboardComponent } from './tabs/dashboard.component'; +import { SettingsComponent } from './tabs/settings.component'; +import { TabsComponent } from './tabs/tabs.component'; import { ApiActionDirective } from 'jslib/angular/directives/api-action.directive'; import { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive'; @@ -63,8 +65,10 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe'; LoginComponent, ModalComponent, SearchCiphersPipe, + SettingsComponent, StopClickDirective, StopPropDirective, + TabsComponent, TwoFactorComponent, TwoFactorOptionsComponent, ], diff --git a/src/app/services/launch-guard.service.ts b/src/app/services/launch-guard.service.ts index 5dd9cb63..705553ad 100644 --- a/src/app/services/launch-guard.service.ts +++ b/src/app/services/launch-guard.service.ts @@ -16,7 +16,7 @@ export class LaunchGuardService implements CanActivate { return true; } - this.router.navigate(['/dashboard']); + this.router.navigate(['/tabs/dashboard']); return false; } } diff --git a/src/app/dashboard/dashboard.component.html b/src/app/tabs/dashboard.component.html similarity index 100% rename from src/app/dashboard/dashboard.component.html rename to src/app/tabs/dashboard.component.html diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/tabs/dashboard.component.ts similarity index 100% rename from src/app/dashboard/dashboard.component.ts rename to src/app/tabs/dashboard.component.ts diff --git a/src/app/tabs/settings.component.html b/src/app/tabs/settings.component.html new file mode 100644 index 00000000..a2bee479 --- /dev/null +++ b/src/app/tabs/settings.component.html @@ -0,0 +1,3 @@ + + +The settings!!! diff --git a/src/app/tabs/settings.component.ts b/src/app/tabs/settings.component.ts new file mode 100644 index 00000000..73e86155 --- /dev/null +++ b/src/app/tabs/settings.component.ts @@ -0,0 +1,20 @@ +import { + Component, + ComponentFactoryResolver, + ViewChild, + ViewContainerRef, +} from '@angular/core'; + +import { ToasterService } from 'angular2-toaster'; +import { Angulartics2 } from 'angulartics2'; + +import { I18nService } from 'jslib/abstractions/i18n.service'; + +@Component({ + selector: 'app-settings', + templateUrl: 'settings.component.html', +}) +export class SettingsComponent { + constructor(analytics: Angulartics2, toasterService: ToasterService, + i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver) {} +} diff --git a/src/app/tabs/tabs.component.html b/src/app/tabs/tabs.component.html new file mode 100644 index 00000000..fbc1bb8d --- /dev/null +++ b/src/app/tabs/tabs.component.html @@ -0,0 +1,13 @@ +
+ + +
diff --git a/src/app/tabs/tabs.component.ts b/src/app/tabs/tabs.component.ts new file mode 100644 index 00000000..8c5df545 --- /dev/null +++ b/src/app/tabs/tabs.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-tabs', + templateUrl: 'tabs.component.html', +}) +export class TabsComponent { }