1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

Merge pull request #721 from bitwarden/Send

Allowed editing sends
This commit is contained in:
Addison Beck 2021-02-10 21:00:04 -05:00 committed by GitHub
commit 82cb6fd020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 120 additions and 92 deletions

View File

@ -1,4 +1,6 @@
<div class="content" *ngIf="send"> <ng-container *ngIf="send">
<form (ngSubmit)="submit()" [appApiAction]="formPromise">
<div class="content" *ngIf="send">
<div class="inner-content"> <div class="inner-content">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
@ -36,7 +38,7 @@
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="expirationDate">{{'expirationDate' | i18n}}</label> <label for="expirationDate">{{'expirationDate' | i18n}}</label>
<input id="expirationDate" type="datetime-local" name="expirationDate" [(ngModel)]="send.expirationDate"> <input id="expirationDate" type="datetime-local" name="expirationDate" [(ngModel)]="expirationDate">
<div class="subtext">{{'expirationDateDesc' | i18n}}</div> <div class="subtext">{{'expirationDateDesc' | i18n}}</div>
</div> </div>
</div> </div>
@ -57,8 +59,8 @@
<div class="box"> <div class="box">
<div class="box-content"> <div class="box-content">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="password">{{'password' | i18n}}</label> <label for="password">{{(hasPassword ? 'newPassword' : 'password') | i18n}}</label>
<input id="password" type="password" name="password" [(ngModel)]="send.password"> <input id="password" type="password" name="password" [(ngModel)]="password">
<div class="subtext">{{'sendPasswordDesc' | i18n}}</div> <div class="subtext">{{'sendPasswordDesc' | i18n}}</div>
</div> </div>
</div> </div>
@ -94,4 +96,11 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="footer">
<button appBlurClick type="submit" class="primary" appA11yTitle="{{'save' | i18n}}">
<i class="fa fa-save fa-lg fa-fw" aria-hidden="true"></i>
</button>
</div>
</form>
</ng-container>

View File

@ -28,5 +28,9 @@ export class AddEditComponent extends BaseAddEditComponent {
async refresh() { async refresh() {
const send = await this.loadSend(); const send = await this.loadSend();
this.send = await send.decrypt(); this.send = await send.decrypt();
this.hasPassword = this.send.password != null && this.send.password.trim() !== '';
this.deletionDate = this.dateToString(this.send.deletionDate);
this.expirationDate = this.dateToString(this.send.expirationDate);
this.password = null;
} }
} }

View File

@ -67,7 +67,7 @@
</button> </button>
</div> </div>
</div> </div>
<app-send-add-edit id="addEdit" class="details" *ngIf="action == 'add' || action == 'edit'" [sendId]="sendId" [type]="selectedSendType"></app-send-add-edit> <app-send-add-edit id="addEdit" class="details" *ngIf="action == 'add' || action == 'edit'" [sendId]="sendId" [type]="selectedSendType" (onSavedSend)="refresh()"></app-send-add-edit>
<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

@ -72,6 +72,6 @@ export class SendComponent extends BaseSendComponent implements OnInit {
} }
get selectedSendType() { get selectedSendType() {
return this.sends.find(s => s.id === this.sendId).type; return this.sends.find(s => s.id === this.sendId)?.type;
} }
} }

View File

@ -1568,5 +1568,20 @@
"textHiddenByDefault": { "textHiddenByDefault": {
"message": "When accessing the Send, hide the text by default", "message": "When accessing the Send, hide the text by default",
"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."
},
"createdSend": {
"message": "Created Send",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"editedSend": {
"message": "Edited Send",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"deletedSend": {
"message": "Deleted Send",
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
},
"newPassword": {
"message": "New Password"
} }
} }