[PM-13189] Send copy updates (#11619)

* Add more descriptive header text

* Update hint under optional password field

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2024-10-21 16:10:57 +02:00 committed by GitHub
parent c9de05de95
commit d298ac6edf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 9 deletions

View File

@ -2464,8 +2464,8 @@
"message": "Optionally require a password for users to access this Send.", "message": "Optionally require a password for users to access this Send.",
"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."
}, },
"sendPasswordDescV2": { "sendPasswordDescV3": {
"message": "Require this password to view the Send.", "message": "Add an optional password for recipients to access this Send.",
"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."
}, },
"sendNotesDesc": { "sendNotesDesc": {
@ -4494,9 +4494,15 @@
"itemLocation": { "itemLocation": {
"message": "Item Location" "message": "Item Location"
}, },
"fileSend": {
"message": "File Send"
},
"fileSends": { "fileSends": {
"message": "File Sends" "message": "File Sends"
}, },
"textSend": {
"message": "Text Send"
},
"textSends": { "textSends": {
"message": "Text Sends" "message": "Text Sends"
}, },

View File

@ -174,18 +174,25 @@ export class SendAddEditComponent {
) )
.subscribe((config) => { .subscribe((config) => {
this.config = config; this.config = config;
this.headerText = this.getHeaderText(config.mode); this.headerText = this.getHeaderText(config.mode, config.sendType);
}); });
} }
/** /**
* Gets the header text based on the mode. * Gets the header text based on the mode and type.
* @param mode The mode of the send form. * @param mode The mode of the send form.
* @param type The type of the send
* @returns The header text. * @returns The header text.
*/ */
private getHeaderText(mode: SendFormMode) { private getHeaderText(mode: SendFormMode, type: SendType) {
return this.i18nService.t( const headerKey =
mode === "edit" || mode === "partial-edit" ? "editSend" : "createSend", mode === "edit" || mode === "partial-edit" ? "editItemHeader" : "newItemHeader";
);
switch (type) {
case SendType.Text:
return this.i18nService.t(headerKey, this.i18nService.t("textSend"));
case SendType.File:
return this.i18nService.t(headerKey, this.i18nService.t("fileSend"));
}
} }
} }

View File

@ -41,7 +41,7 @@
[appCopyClick]="sendOptionsForm.get('password').value" [appCopyClick]="sendOptionsForm.get('password').value"
showToast showToast
></button> ></button>
<bit-hint>{{ "sendPasswordDescV2" | i18n }}</bit-hint> <bit-hint>{{ "sendPasswordDescV3" | i18n }}</bit-hint>
</bit-form-field> </bit-form-field>
<bit-form-control *ngIf="!disableHideEmail || originalSendView?.hideEmail"> <bit-form-control *ngIf="!disableHideEmail || originalSendView?.hideEmail">
<input <input