1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00
This commit is contained in:
addison 2021-02-03 23:12:23 -05:00
parent de162cd34f
commit 2b9bae6807
3 changed files with 43 additions and 37 deletions

View File

@ -70,6 +70,26 @@
</div> </div>
</div> </div>
<app-send-add-edit *ngIf="action == 'add' || action == 'edit'"></app-send-add-edit> <app-send-add-edit *ngIf="action == 'add' || action == 'edit'"></app-send-add-edit>
<div id="view" class="details" *ngIf="action == 'view'">
<div class="content">
<div class="inner-content">
<div class="box">
<div class="box-header">
{{'sendInformation' | i18n}}
</div>
<div class="box-content">
<div class="box-content-row">
<span class="row-label">{{'name' | i18n}}</span>
{{selectedSend.name}}
</div>
<!-- Login -->
<div *ngIf="cipher.login">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="logo" *ngIf="!action"> <div class="logo" *ngIf="!action">
<div class="content"> <div class="content">
<div class="inner-content"> <div class="inner-content">

View File

@ -20,7 +20,6 @@ import { SendComponent as BaseSendComponent } from 'jslib/angular/components/sen
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
import { SendType } from 'jslib/enums/sendType';
import { SendView } from 'jslib/models/view/sendView'; import { SendView } from 'jslib/models/view/sendView';
enum Action { enum Action {
@ -38,6 +37,7 @@ export class SendComponent extends BaseSendComponent implements OnInit {
sendId: string; sendId: string;
modal: ModalComponent = null; modal: ModalComponent = null;
action: Action = Action.None; action: Action = Action.None;
selectedSend: SendView;
constructor(sendService: SendService, i18nService: I18nService, constructor(sendService: SendService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
@ -52,39 +52,21 @@ export class SendComponent extends BaseSendComponent implements OnInit {
this.sends = await this.sendService.getAllDecrypted(); this.sends = await this.sendService.getAllDecrypted();
this.route.queryParams.subscribe(async (params) => { this.route.queryParams.subscribe(async (params) => {
if (params == null) { this.sendId = params.sendId;
this.selectedAll = true; if (this.sendId != null) {
await this.reload(); this.selectedSend = this.sends.find((s) => s.id === params.sendId);
} else { params.action === 'edit' ?
const sendView = new SendView(); this.action = Action.Edit :
if (params.sendId) { this.action = Action.View;
sendView.id = params.sendId; return;
if (params.action === 'edit') {
this.editSend(sendView);
} else if (params.action === 'view') {
// TODO: this
// this.viewSend(sendView);
} }
} else if (params.action === 'add') {
this.addSend(); if (params.action === 'add') {
} else { this.action = Action.Add;
if (params.files) { return;
sendView.type = SendType.File; }
this.filter = (s) => {
return filter(s) && s.text != null;
};
this.filter(sendView);
} else if (params.text) {
sendView.type = SendType.Text;
this.filter = (s) => {
return filter(s) && s.file != null;
};
this.filter(sendView);
} else {
this.selectAll(); this.selectAll();
}
}
}
}); });
this.loading = false; this.loading = false;
@ -102,10 +84,11 @@ export class SendComponent extends BaseSendComponent implements OnInit {
} }
editSend(send: SendView) { editSend(send: SendView) {
if (this.action === Action.Edit && this.sendId === send.id) {
return; return;
} }
this.action = Action.Edit;
selectSend(send: SendView) {
this.action = Action.View;
this.sendId = send.id; this.sendId = send.id;
this.go(); this.go();
} }

View File

@ -1510,5 +1510,8 @@
"searchSends": { "searchSends": {
"message": "Search Sends", "message": "Search Sends",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"sendInformation": {
"message": "Send Information"
} }
} }