From d3fdaed4c22fab7c269da606d274f5303e17a615 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 23 Jan 2018 22:21:14 -0500 Subject: [PATCH] split vault into components --- src/app/app.module.ts | 6 ++ src/app/vault/ciphers.component.html | 28 ++++++++ src/app/vault/ciphers.component.ts | 23 +++++++ src/app/vault/groupings.component.html | 27 ++++++++ src/app/vault/groupings.component.ts | 28 ++++++++ src/app/vault/vault.component.html | 94 +------------------------- src/app/vault/vault.component.ts | 11 +-- src/app/vault/view.component.html | 18 +++++ src/app/vault/view.component.ts | 23 +++++++ src/scss/styles.scss | 36 ++-------- 10 files changed, 161 insertions(+), 133 deletions(-) create mode 100644 src/app/vault/ciphers.component.html create mode 100644 src/app/vault/ciphers.component.ts create mode 100644 src/app/vault/groupings.component.html create mode 100644 src/app/vault/groupings.component.ts create mode 100644 src/app/vault/view.component.html create mode 100644 src/app/vault/view.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a7c285e1d0..b026bd5aef 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,9 +8,12 @@ import { NgModule } from '@angular/core'; import { ServicesModule } from './services/services.module'; import { AppComponent } from './app.component'; +import { CiphersComponent } from './vault/ciphers.component'; +import { GroupingsComponent } from './vault/groupings.component'; import { IconComponent } from './vault/icon.component'; import { LoginComponent } from './accounts/login.component'; import { VaultComponent } from './vault/vault.component'; +import { ViewComponent } from './vault/view.component'; @NgModule({ imports: [ @@ -21,9 +24,12 @@ import { VaultComponent } from './vault/vault.component'; ], declarations: [ AppComponent, + CiphersComponent, + GroupingsComponent, IconComponent, LoginComponent, VaultComponent, + ViewComponent, ], providers: [], bootstrap: [AppComponent], diff --git a/src/app/vault/ciphers.component.html b/src/app/vault/ciphers.component.html new file mode 100644 index 0000000000..4c3deeef85 --- /dev/null +++ b/src/app/vault/ciphers.component.html @@ -0,0 +1,28 @@ + +
+ +
+ diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts new file mode 100644 index 0000000000..3b21ee72ec --- /dev/null +++ b/src/app/vault/ciphers.component.ts @@ -0,0 +1,23 @@ +import * as template from './ciphers.component.html'; + +import { + Component, + Input, + OnChanges, +} from '@angular/core'; + +@Component({ + selector: 'app-vault-ciphers', + template: template, +}) +export class CiphersComponent implements OnChanges { + @Input() ciphers: any[]; + + constructor() { + + } + + ngOnChanges() { + + } +} diff --git a/src/app/vault/groupings.component.html b/src/app/vault/groupings.component.html new file mode 100644 index 0000000000..e5dab2f9a7 --- /dev/null +++ b/src/app/vault/groupings.component.html @@ -0,0 +1,27 @@ +
+
+ +

Types

+ +

Folders

+ +

Collections

+ +
+
diff --git a/src/app/vault/groupings.component.ts b/src/app/vault/groupings.component.ts new file mode 100644 index 0000000000..b15c4db4a3 --- /dev/null +++ b/src/app/vault/groupings.component.ts @@ -0,0 +1,28 @@ +import * as template from './groupings.component.html'; + +import { + Component, + Input, + OnInit, +} from '@angular/core'; + +import { CollectionService } from 'jslib/abstractions/collection.service'; +import { FolderService } from 'jslib/abstractions/folder.service'; + +@Component({ + selector: 'app-vault-groupings', + template: template, +}) +export class GroupingsComponent implements OnInit { + folders: any[]; + collections: any[]; + + constructor(private collectionService: CollectionService, private folderService: FolderService) { + + } + + async ngOnInit() { + this.folders = await this.folderService.getAllDecrypted(); + this.collections = await this.collectionService.getAllDecrypted(); + } +} diff --git a/src/app/vault/vault.component.html b/src/app/vault/vault.component.html index 2221642d15..8a81f845e0 100644 --- a/src/app/vault/vault.component.html +++ b/src/app/vault/vault.component.html @@ -1,93 +1,5 @@
- -
-
-
- -

Types

- -

Folders

- -

Collections

- -
-
-
-
- - - -
-
-
-
Something Something Something Something Something Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
Something
Something
Something
Something
-
- -
+ + +
diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index fa2006ae64..82841cf531 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -6,28 +6,19 @@ import { } from '@angular/core'; import { CipherService } from 'jslib/abstractions/cipher.service'; -import { CollectionService } from 'jslib/abstractions/collection.service'; -import { FolderService } from 'jslib/abstractions/folder.service'; @Component({ selector: 'app-vault', template: template, }) export class VaultComponent implements OnInit { - vaultFolders: any[]; vaultCiphers: any[]; - vaultCollections: any[]; - constructor(private cipherService: CipherService, private collectionService: CollectionService, - private folderService: FolderService) { + constructor(private cipherService: CipherService) { } async ngOnInit() { - // TODO? - - this.vaultFolders = await this.folderService.getAllDecrypted(); - this.vaultCollections = await this.collectionService.getAllDecrypted(); this.vaultCiphers = await this.cipherService.getAllDecrypted(); } } diff --git a/src/app/vault/view.component.html b/src/app/vault/view.component.html new file mode 100644 index 0000000000..a74f98cd6f --- /dev/null +++ b/src/app/vault/view.component.html @@ -0,0 +1,18 @@ +
+
Something Something Something Something Something Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
Something
Something
Something
Something
+
+ diff --git a/src/app/vault/view.component.ts b/src/app/vault/view.component.ts new file mode 100644 index 0000000000..dd99bc2734 --- /dev/null +++ b/src/app/vault/view.component.ts @@ -0,0 +1,23 @@ +import * as template from './view.component.html'; + +import { + Component, + Input, + OnChanges, +} from '@angular/core'; + +@Component({ + selector: 'app-vault-view', + template: template, +}) +export class ViewComponent implements OnChanges { + @Input() cipherId: string; + + constructor() { + + } + + ngOnChanges() { + + } +} diff --git a/src/scss/styles.scss b/src/scss/styles.scss index 716cef8955..e56d32812b 100644 --- a/src/scss/styles.scss +++ b/src/scss/styles.scss @@ -44,7 +44,10 @@ div::-webkit-scrollbar-thumb { background-color: rgba(100,100,100,.2); border-radius: 10px; margin-right: 1px; - transition: opacity 300ms ease-in-out; + + &:hover { + background-color: rgba(100,100,100,.4); + } } html, body { @@ -77,37 +80,6 @@ a { height: 100vh; display: flex; - #nav { - background-color: #1a2226; - min-width: 50px; - color: white; - display: flex; - flex-direction: column; - - ul { - padding: 0; - margin: 0; - - li { - padding: 0; - margin: 0; - list-style: none; - - a { - display: block; - text-align: center; - padding: 20px 0; - text-decoration: none; - color: #fff; - } - } - - &.top { - flex: 1; - } - } - } - #categories { background-color: $background-color-alt; width: 15%;