diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts
index cce9e747da8..8c6af65a823 100644
--- a/src/app/send/add-edit.component.ts
+++ b/src/app/send/add-edit.component.ts
@@ -10,11 +10,12 @@ import { Component } from '@angular/core';
import { SendType } from 'jslib/enums/sendType';
-import { ApiService } from 'jslib/abstractions/api.service';
import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
+import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SendService } from 'jslib/abstractions/send.service';
+import { UserService } from 'jslib/abstractions/user.service';
import { SendView } from 'jslib/models/view/sendView';
import { SendFileView } from 'jslib/models/view/sendFileView';
@@ -22,8 +23,6 @@ import { SendTextView } from 'jslib/models/view/sendTextView';
import { Send } from 'jslib/models/domain/send';
-import { SendData } from 'jslib/models/data/sendData';
-
@Component({
selector: 'app-send-add-edit',
templateUrl: 'add-edit.component.html',
@@ -52,10 +51,13 @@ export class AddEditComponent {
expirationDateOptions: any[];
deletionDateSelect = 168;
expirationDateSelect: number = null;
+ canAccessPremium = true;
+ premiumRequiredAlertShown = false;
constructor(private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
private environmentService: EnvironmentService, private datePipe: DatePipe,
- private sendService: SendService) {
+ private sendService: SendService, private userService: UserService,
+ private messagingService: MessagingService) {
this.typeOptions = [
{ name: i18nService.t('sendTypeFile'), value: SendType.File },
{ name: i18nService.t('sendTypeText'), value: SendType.Text },
@@ -87,6 +89,11 @@ export class AddEditComponent {
this.title = this.i18nService.t('createSend');
}
+ this.canAccessPremium = await this.userService.canAccessPremium();
+ if (!this.canAccessPremium) {
+ this.type = SendType.Text;
+ }
+
if (this.send == null) {
if (this.editMode) {
const send = await this.loadSend();
@@ -194,6 +201,13 @@ export class AddEditComponent {
} catch { }
}
+ typeChanged() {
+ if (!this.canAccessPremium && this.send.type == SendType.File && !this.premiumRequiredAlertShown) {
+ this.premiumRequiredAlertShown = true;
+ this.messagingService.send('premiumRequired');
+ }
+ }
+
protected async loadSend(): Promise {
return this.sendService.get(this.sendId);
}
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 234208f1a25..6f05f75bda7 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -3319,15 +3319,35 @@
"deletionDate": {
"message": "Deletion Date"
},
+ "deletionDateDesc": {
+ "message": "The Send will be permanently deleted on the specified date and time.",
+ "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
+ },
"expirationDate": {
"message": "Expiration Date"
},
+ "expirationDateDesc": {
+ "message": "If set, access to this Send will expire on the specified date and time.",
+ "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
+ },
"maxAccessCount": {
"message": "Maximum Access Count"
},
+ "maxAccessCountDesc": {
+ "message": "If set, users will no longer be able to access this send once the maximum access count is reached.",
+ "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
+ },
"currentAccessCount": {
"message": "Current Access Count"
},
+ "sendPasswordDesc": {
+ "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."
+ },
+ "sendNotesDesc": {
+ "message": "Private notes about this Send.",
+ "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
+ },
"disabled": {
"message": "Disabled"
},
@@ -3565,5 +3585,9 @@
},
"custom": {
"message": "Custom"
+ },
+ "textHiddenByDefault": {
+ "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."
}
}