From 1290ff2c40d2ad9d4d8e84ecff9bc2a49d82ace2 Mon Sep 17 00:00:00 2001 From: addison Date: Tue, 16 Feb 2021 11:52:23 -0500 Subject: [PATCH 01/13] finished CRUD operations for Send --- jslib | 2 +- src/app/send/add-edit.component.html | 205 +++++++++++++++++---------- src/app/send/add-edit.component.ts | 7 +- src/app/send/send.component.html | 3 +- src/app/send/send.component.ts | 48 +++++-- src/locales/en/messages.json | 33 +++++ src/scss/box.scss | 23 ++- 7 files changed, 230 insertions(+), 91 deletions(-) diff --git a/jslib b/jslib index ee164bebc6..7941664a59 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit ee164bebc65aa56e41a122eb4ece8971eb23119b +Subproject commit 7941664a59f90a1b510b13d37062b90210da3b3c diff --git a/src/app/send/add-edit.component.html b/src/app/send/add-edit.component.html index 2ce51ad731..719d90e7f9 100644 --- a/src/app/send/add-edit.component.html +++ b/src/app/send/add-edit.component.html @@ -1,106 +1,159 @@ - -
-
-
-
-
- {{'editSend' | i18n}} + +
+
+
+
+ {{title}} +
+
+
+ +
-
-
- - +
+
+
+
+ +
+ +
+ + +
-
+
+ + +
{{'sendFileDesc' | i18n}} {{'maxFileSize' | i18n}}
+
+ + +
+
+
- + +
{{'sendTextDesc' | i18n}}
+
+
+
+
+
+ {{'options' | i18n}} +
+
+
+ + + +
{{'deletionDateDesc' | i18n}}
+
+
+ +
+
+ + + +
{{'expirationDateDesc' | i18n}}
+
+
+
-
-
- {{'options' | i18n}} +
+
+
+
+ + +
{{'maxAccessCountDesc' | i18n}}
-
-
- - -
{{'deletionDateDesc' | i18n}}
-
-
- - -
{{'expirationDateDesc' | i18n}}
-
+
+ +
-
-
-
- - -
{{'maxAccessCountDesc' | i18n}}
-
-
- - -
+
+
+
+
+ + +
{{'sendPasswordDesc' | i18n}}
-
-
-
- - -
{{'sendPasswordDesc' | i18n}}
-
+
+
+
+ {{'notes' | i18n}} +
+
+
+ + {{'sendNotesDesc' | i18n}}
-
-
- {{'notes' | i18n}} -
-
-
- - {{'sendNotesDesc' | i18n}} -
+
+
+
+
+ +
-
-
-
- - -
-
+
+
+
+ {{'share' | i18n}}
-
-
- {{'share' | i18n}} -
-
-
- - -
+
+
+ +
- + + diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts index bc9ccaa254..e657bcd9c2 100644 --- a/src/app/send/add-edit.component.ts +++ b/src/app/send/add-edit.component.ts @@ -28,9 +28,14 @@ export class AddEditComponent extends BaseAddEditComponent { async refresh() { const send = await this.loadSend(); 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; + } + + cancel() { + this.onCancelled.emit(this.send); } } diff --git a/src/app/send/send.component.html b/src/app/send/send.component.html index ade3c8468a..ab7b419dec 100644 --- a/src/app/send/send.component.html +++ b/src/app/send/send.component.html @@ -67,7 +67,8 @@
- + From 4a8cf624954f1f4ae59835817bcf91e7f345ec49 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Tue, 16 Feb 2021 16:33:32 -0500 Subject: [PATCH 05/13] removed extra subscription --- src/app/send/send.component.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/app/send/send.component.ts b/src/app/send/send.component.ts index 4b57579cd3..44c4b585af 100644 --- a/src/app/send/send.component.ts +++ b/src/app/send/send.component.ts @@ -55,11 +55,6 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { this.ngZone.run(async () => { switch (message.command) { - case 'syncCompleted': - if (message.successfully) { - await this.load(); - } - break; case 'syncCompleted': await this.load(); break; From ac807b6d543ff62199f63a5ba722ccecc98bc026 Mon Sep 17 00:00:00 2001 From: addison Date: Thu, 18 Feb 2021 13:03:20 -0500 Subject: [PATCH 06/13] bells and whistles for Send --- src/app/app.component.ts | 8 ++ src/app/send/add-edit.component.html | 176 ++++++++++++++++----------- src/app/send/add-edit.component.ts | 11 ++ src/app/send/send.component.html | 2 +- src/app/send/send.component.ts | 22 +++- src/locales/en/messages.json | 19 +++ src/scss/box.scss | 10 ++ 7 files changed, 170 insertions(+), 78 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2b1fdafc72..027b661874 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -197,6 +197,14 @@ export class AppComponent implements OnInit { break; case 'ssoCallback': this.router.navigate(['sso'], { queryParams: { code: message.code, state: message.state } }); + case 'premiumRequired': + const premiumConfirmed = await this.platformUtilsService.showDialog( + this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'), + this.i18nService.t('learnMore'), this.i18nService.t('cancel')); + if (premiumConfirmed) { + this.openModal(PremiumComponent, this.premiumRef); + } + break; default: } }); diff --git a/src/app/send/add-edit.component.html b/src/app/send/add-edit.component.html index 36d7e83770..46b4ccbf9d 100644 --- a/src/app/send/add-edit.component.html +++ b/src/app/send/add-edit.component.html @@ -1,6 +1,12 @@ +
+
+ + {{'sendDisabledWarning' | i18n}} + +
{{title}} @@ -8,7 +14,7 @@
- +
@@ -35,18 +41,18 @@
- +
- +
{{'sendTextDesc' | i18n}}
- +
@@ -54,99 +60,123 @@
-
-
- - - -
{{'deletionDateDesc' | i18n}}
+
+
+
+
+
+ + +
{{'deletionDateDesc' | i18n}}
+
+
+ + +
{{'deletionDateDesc' | i18n}}
+
+
+ + +
{{'expirationDateDesc' | i18n}}
+
+
+ + +
{{'expirationDateDesc' | i18n}}
+
-
- +
+
+
+
+ + +
{{'maxAccessCountDesc' | i18n}}
+
+
+ + +
-
- - - -
{{'expirationDateDesc' | i18n}}
+
+
+
+
+
+ + +
{{'sendPasswordDesc' | i18n}}
+
+
+ + + +
+
-
- +
+
+
+ {{'notes' | i18n}} +
+
+
+ + {{'sendNotesDesc' | i18n}} +
+
+
+
+
+
+ + +
-
-
- - -
{{'maxAccessCountDesc' | i18n}}
-
-
- - -
-
-
-
-
-
- - -
{{'sendPasswordDesc' | i18n}}
-
-
-
-
-
- {{'notes' | i18n}} -
-
-
- - {{'sendNotesDesc' | i18n}} -
-
-
-
-
-
- - -
-
-
-
{{'share' | i18n}}
-
- - +
+ + +
+
+ +