diff --git a/jslib b/jslib index d1c46e6bdc9..a16d8f7de7a 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d1c46e6bdc9332bcf47acbd235c3a6278e086d8a +Subproject commit a16d8f7de7abe63532bcf7452cb7517f9174189a diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8a22dcfdaba..d7e48efc62c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -14,6 +14,8 @@ import { SetPasswordComponent } from './accounts/set-password.component'; import { SsoComponent } from './accounts/sso.component'; import { TwoFactorComponent } from './accounts/two-factor.component'; +import { SendComponent } from './send/send.component'; + import { VaultComponent } from './vault/vault.component'; const routes: Routes = [ @@ -30,6 +32,11 @@ const routes: Routes = [ { path: 'hint', component: HintComponent }, { path: 'set-password', component: SetPasswordComponent }, { path: 'sso', component: SsoComponent }, + { + path: 'send', + component: SendComponent, + canActivate: [AuthGuardService], + }, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7cb20ea035f..8ef25e709e8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,6 +10,7 @@ import { AppRoutingModule } from './app-routing.module'; import { ServicesModule } from './services.module'; import { DragDropModule } from '@angular/cdk/drag-drop'; +import { DatePipe } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; @@ -62,6 +63,11 @@ import { ShareComponent } from './vault/share.component'; import { VaultComponent } from './vault/vault.component'; import { ViewComponent } from './vault/view.component'; +import { AddEditComponent as SendAddEditComponent } from './send/add-edit.component'; +import { SendComponent } from './send/send.component'; + +import { NavComponent } from './layout/nav.component'; + import { registerLocaleData } from '@angular/common'; import localeBe from '@angular/common/locales/be'; import localeBg from '@angular/common/locales/bg'; @@ -177,6 +183,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); LockComponent, LoginComponent, ModalComponent, + NavComponent, PasswordGeneratorComponent, PasswordGeneratorHistoryComponent, PasswordHistoryComponent, @@ -184,6 +191,8 @@ registerLocaleData(localeZhTw, 'zh-TW'); RegisterComponent, SearchCiphersPipe, SelectCopyDirective, + SendAddEditComponent, + SendComponent, SetPasswordComponent, SettingsComponent, ShareComponent, @@ -209,9 +218,10 @@ registerLocaleData(localeZhTw, 'zh-TW'); PremiumComponent, SettingsComponent, ShareComponent, + SendAddEditComponent, TwoFactorOptionsComponent, ], - providers: [], + providers: [DatePipe], bootstrap: [AppComponent], }) export class AppModule { } diff --git a/src/app/layout/nav.component.html b/src/app/layout/nav.component.html new file mode 100644 index 00000000000..d24d23f9f8b --- /dev/null +++ b/src/app/layout/nav.component.html @@ -0,0 +1,5 @@ + + + {{ item.label }} + + diff --git a/src/app/layout/nav.component.ts b/src/app/layout/nav.component.ts new file mode 100644 index 00000000000..1aac3de0584 --- /dev/null +++ b/src/app/layout/nav.component.ts @@ -0,0 +1,23 @@ +import { Component } from '@angular/core'; +import { I18nService } from 'jslib/abstractions/i18n.service'; + +@Component({ + selector: 'app-nav', + templateUrl: 'nav.component.html', +}) +export class NavComponent { + items: any[] = [ + { + link: '/vault', + icon: 'fa-lock', + label: this.i18nService.translate('myVault'), + }, + { + link: '/send', + icon: 'fa-paper-plane', + label: 'Send', + }, + ]; + + constructor(private i18nService: I18nService) {} +} diff --git a/src/app/send/add-edit.component.html b/src/app/send/add-edit.component.html new file mode 100644 index 00000000000..d7a8fdcf14d --- /dev/null +++ b/src/app/send/add-edit.component.html @@ -0,0 +1,15 @@ +
+
+
+
+ {{'sendInformation' | i18n}} +
+
+
+ {{'name' | i18n}} + {{send.name}} +
+
+
+
+
diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts new file mode 100644 index 00000000000..bbffa41ba41 --- /dev/null +++ b/src/app/send/add-edit.component.ts @@ -0,0 +1,26 @@ +import { DatePipe } from '@angular/common'; + +import { Component } from '@angular/core'; + +import { EnvironmentService } from 'jslib/abstractions/environment.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { MessagingService } from 'jslib/abstractions/messaging.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { SendService } from 'jslib/abstractions/send.service'; +import { UserService } from 'jslib/abstractions/user.service'; + +import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/send/add-edit.component'; + +@Component({ + selector: 'app-send-add-edit', + templateUrl: 'add-edit.component.html', +}) +export class AddEditComponent extends BaseAddEditComponent { + constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService, + environmentService: EnvironmentService, datePipe: DatePipe, + sendService: SendService, userService: UserService, + messagingService: MessagingService) { + super(i18nService, platformUtilsService, environmentService, + datePipe, sendService, userService, messagingService); + } +} diff --git a/src/app/send/send.component.html b/src/app/send/send.component.html new file mode 100644 index 00000000000..9315c4e6a46 --- /dev/null +++ b/src/app/send/send.component.html @@ -0,0 +1,78 @@ +
+
+
+
+
+

{{'filters' | i18n}}

+ +

{{'types' | i18n}}

+ +
+ +
+
+
+ +
+ +
+ + + +

{{'noItemsInList' | i18n}}

+
+
+
+ +
+ + +
diff --git a/src/app/send/send.component.ts b/src/app/send/send.component.ts new file mode 100644 index 00000000000..577579a51af --- /dev/null +++ b/src/app/send/send.component.ts @@ -0,0 +1,58 @@ +import { + Component, + NgZone, + OnInit, +} from '@angular/core'; + +import { EnvironmentService } from 'jslib/abstractions/environment.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { SearchService } from 'jslib/abstractions/search.service'; +import { SendService } from 'jslib/abstractions/send.service'; + +import { SendComponent as BaseSendComponent } from 'jslib/angular/components/send/send.component'; + +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + +import { SendView } from 'jslib/models/view/sendView'; + +enum Action { + None = '', + Add = 'add', + Edit = 'edit', +} + +@Component({ + selector: 'app-send', + templateUrl: 'send.component.html', +}) +export class SendComponent extends BaseSendComponent implements OnInit { + sendId: string; + action: Action = Action.None; + + constructor(sendService: SendService, i18nService: I18nService, + platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, + broadcasterService: BroadcasterService, ngZone: NgZone, + searchService: SearchService) { + super(sendService, i18nService, platformUtilsService, + environmentService, broadcasterService, ngZone, searchService); + } + + addSend() { + this.sendId = null; + this.action = Action.Add; + } + + editSend(send: SendView) { + return; + } + + selectSend(send: SendView) { + this.sendId = send.id; + this.action = Action.Edit; + } + + get selectedSendType() { + return this.sends.find((s) => s.id === this.sendId).type; + } +} diff --git a/src/app/vault/groupings.component.html b/src/app/vault/groupings.component.html index 75c88863f68..57f71782fb0 100644 --- a/src/app/vault/groupings.component.html +++ b/src/app/vault/groupings.component.html @@ -98,4 +98,7 @@ + diff --git a/src/app/vault/vault.component.html b/src/app/vault/vault.component.html index 93938ac95f9..e6740c1dea1 100644 --- a/src/app/vault/vault.component.html +++ b/src/app/vault/vault.component.html @@ -1,19 +1,19 @@ -
- + - - - -