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

View File

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