mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
Added support for viewing Sends'
This commit is contained in:
@@ -2,13 +2,16 @@ import {
|
||||
Component,
|
||||
NgZone,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
} 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 { PolicyService } from 'jslib/abstractions/policy.service';
|
||||
import { SearchService } from 'jslib/abstractions/search.service';
|
||||
import { SendService } from 'jslib/abstractions/send.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
import { SendComponent as BaseSendComponent } from 'jslib/angular/components/send/send.component';
|
||||
|
||||
@@ -16,6 +19,8 @@ import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||
|
||||
import { SendView } from 'jslib/models/view/sendView';
|
||||
|
||||
import { AddEditComponent } from './add-edit.component';
|
||||
|
||||
enum Action {
|
||||
None = '',
|
||||
Add = 'add',
|
||||
@@ -27,15 +32,24 @@ enum Action {
|
||||
templateUrl: 'send.component.html',
|
||||
})
|
||||
export class SendComponent extends BaseSendComponent implements OnInit {
|
||||
@ViewChild(AddEditComponent) addEditComponent: AddEditComponent;
|
||||
|
||||
sendId: string;
|
||||
action: Action = Action.None;
|
||||
|
||||
constructor(sendService: SendService, i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
||||
broadcasterService: BroadcasterService, ngZone: NgZone,
|
||||
searchService: SearchService) {
|
||||
searchService: SearchService, policyService: PolicyService,
|
||||
userService: UserService) {
|
||||
super(sendService, i18nService, platformUtilsService,
|
||||
environmentService, broadcasterService, ngZone, searchService);
|
||||
environmentService, broadcasterService, ngZone, searchService,
|
||||
policyService, userService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
await this.load();
|
||||
}
|
||||
|
||||
addSend() {
|
||||
@@ -47,9 +61,14 @@ export class SendComponent extends BaseSendComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
selectSend(send: SendView) {
|
||||
this.sendId = send.id;
|
||||
async selectSend(sendId: string) {
|
||||
this.sendId = sendId;
|
||||
this.action = Action.Edit;
|
||||
|
||||
if (this.addEditComponent != null) {
|
||||
this.addEditComponent.sendId = this.sendId;
|
||||
await this.addEditComponent.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
get selectedSendType() {
|
||||
|
||||
Reference in New Issue
Block a user