From 3c3131adef4ebc431f020bb8174fc98966e5812c Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 12 Nov 2021 20:32:35 +0530 Subject: [PATCH 1/5] feat: Pass period & plan params to purchase page (#733) --- .../javascripts/purchaseFlow/PurchaseFlowWrapper.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/purchaseFlow/PurchaseFlowWrapper.tsx b/app/assets/javascripts/purchaseFlow/PurchaseFlowWrapper.tsx index 9deeec45d..d3fb5f302 100644 --- a/app/assets/javascripts/purchaseFlow/PurchaseFlowWrapper.tsx +++ b/app/assets/javascripts/purchaseFlow/PurchaseFlowWrapper.tsx @@ -10,7 +10,9 @@ export type PurchaseFlowWrapperProps = { application: WebApplication; }; -export const getPurchaseFlowUrl = async (application: WebApplication): Promise => { +export const getPurchaseFlowUrl = async ( + application: WebApplication +): Promise => { const currentUrl = window.location.origin; const successUrl = isDesktopApplication() ? `standardnotes://` : currentUrl; if (application.noAccount()) { @@ -27,8 +29,11 @@ export const loadPurchaseFlowUrl = async ( application: WebApplication ): Promise => { const url = await getPurchaseFlowUrl(application); + const params = new URLSearchParams(window.location.search); + const period = params.get('period') ? `&period=${params.get('period')}` : ''; + const plan = params.get('plan') ? `&plan=${params.get('plan')}` : ''; if (url) { - window.location.assign(url); + window.location.assign(`${url}${period}${plan}`); return true; } return false; From 8c1c00ec759cd2d0175e12d6046ae2f14764a498 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 12 Nov 2021 21:44:31 +0530 Subject: [PATCH 2/5] chore: Bump snjs to 2.17.6 (#735) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8c337ba67..692317da1 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@reach/listbox": "^0.16.2", "@standardnotes/features": "1.8.1", "@standardnotes/sncrypto-web": "1.5.3", - "@standardnotes/snjs": "2.17.5", + "@standardnotes/snjs": "2.17.6", "mobx": "^6.3.5", "mobx-react-lite": "^3.2.1", "preact": "^10.5.15", diff --git a/yarn.lock b/yarn.lock index 2ec5f062b..7097c1474 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,10 +2199,10 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@standardnotes/snjs@2.17.5": - version "2.17.5" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.5.tgz#19382b6d29947d896d543c7824a6129547196540" - integrity sha512-sdqcavG5C46VybOq2aQ8bEDEGvXE3sjjcwJJBVsTWCANQkFFh0k7gTA3y3n9ZiWncjoYpBOpuvwr6wpBwJE8EA== +"@standardnotes/snjs@2.17.6": + version "2.17.6" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.6.tgz#ce432bd820b565f97e7dbdd096a056f504c1615a" + integrity sha512-UGRgxzVdMlwGX9xTdve/Cq+H/gDeI8OTyrr2mGeMA79JhhfUwSaEGbriLGkmA9moDctUK+/m79oMtXg/r5Kbtw== dependencies: "@standardnotes/auth" "^3.8.1" "@standardnotes/common" "^1.2.1" From 08cd02040272ea0e950fc3b621e9855e0b372426 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 12 Nov 2021 22:47:47 +0530 Subject: [PATCH 3/5] fix: Two-factor activation modal (#736) --- app/assets/javascripts/components/shared/ModalDialog.tsx | 2 +- .../preferences/panes/account/changeEmail/index.tsx | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/components/shared/ModalDialog.tsx b/app/assets/javascripts/components/shared/ModalDialog.tsx index e2a46a27a..f465bf88f 100644 --- a/app/assets/javascripts/components/shared/ModalDialog.tsx +++ b/app/assets/javascripts/components/shared/ModalDialog.tsx @@ -31,7 +31,7 @@ export const ModalDialogLabel: FunctionComponent<{ closeDialog: () => void; className?: string; }> = ({ children, closeDialog, className }) => ( - +
{children} diff --git a/app/assets/javascripts/preferences/panes/account/changeEmail/index.tsx b/app/assets/javascripts/preferences/panes/account/changeEmail/index.tsx index 10e787053..18d28d29f 100644 --- a/app/assets/javascripts/preferences/panes/account/changeEmail/index.tsx +++ b/app/assets/javascripts/preferences/panes/account/changeEmail/index.tsx @@ -154,10 +154,7 @@ export const ChangeEmail: FunctionalComponent = ({ return (
- + Change Email From f6ca7ef2b1f358f145e9123372f714557dd4d65a Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 12 Nov 2021 22:51:29 +0530 Subject: [PATCH 4/5] feat: Use new design for signed out pane in preferences (#734) --- .../panes/account/Authentication.tsx | 41 ++++++++----------- app/assets/stylesheets/_sn.scss | 4 ++ app/assets/svg/il-account.svg | 25 +++++++++++ 3 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 app/assets/svg/il-account.svg diff --git a/app/assets/javascripts/preferences/panes/account/Authentication.tsx b/app/assets/javascripts/preferences/panes/account/Authentication.tsx index 72e1e27f6..42a5050d0 100644 --- a/app/assets/javascripts/preferences/panes/account/Authentication.tsx +++ b/app/assets/javascripts/preferences/panes/account/Authentication.tsx @@ -3,7 +3,6 @@ import { Button } from '@/components/Button'; import { PreferencesGroup, PreferencesSegment, - Subtitle, Text, Title, } from '@/preferences/components'; @@ -11,6 +10,7 @@ import { WebApplication } from '@/ui_models/application'; import { AppState } from '@/ui_models/app_state'; import { observer } from 'mobx-react-lite'; import { FunctionComponent } from 'preact'; +import AccountIllustration from '../../../../svg/il-account.svg'; export const Authentication: FunctionComponent<{ application: WebApplication; @@ -32,32 +32,27 @@ export const Authentication: FunctionComponent<{
+ You're not signed in - + Sign in to sync your notes and preferences across all your devices and enable end-to-end encryption. - -
-
-
-
- - Standard Notes is free on every platform, and comes standard with - sync and encryption. + +
diff --git a/app/assets/stylesheets/_sn.scss b/app/assets/stylesheets/_sn.scss index 86134d453..8d827f80e 100644 --- a/app/assets/stylesheets/_sn.scss +++ b/app/assets/stylesheets/_sn.scss @@ -24,6 +24,10 @@ display: none; } +.underline { + text-decoration: underline; +} + .hover\:underline:hover { text-decoration: underline; } diff --git a/app/assets/svg/il-account.svg b/app/assets/svg/il-account.svg new file mode 100644 index 000000000..0b31b807f --- /dev/null +++ b/app/assets/svg/il-account.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 76258f546202bb933747ed5c44fad7ae92da0337 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Fri, 12 Nov 2021 12:21:04 -0600 Subject: [PATCH 5/5] fix: component expiration for custom extensions --- .../components/ComponentView/IsExpired.tsx | 2 +- .../components/ComponentView/index.tsx | 16 ++++++++-------- package.json | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/components/ComponentView/IsExpired.tsx b/app/assets/javascripts/components/ComponentView/IsExpired.tsx index 31d1faa1f..18acde9b7 100644 --- a/app/assets/javascripts/components/ComponentView/IsExpired.tsx +++ b/app/assets/javascripts/components/ComponentView/IsExpired.tsx @@ -25,7 +25,7 @@ export const IsExpired: FunctionalComponent = ({ rel={'noopener'} target={'_blank'} > - Your Extended subscription expired on {expiredDate} + Your subscription expired on {expiredDate}
Extensions are in a read-only state. diff --git a/app/assets/javascripts/components/ComponentView/index.tsx b/app/assets/javascripts/components/ComponentView/index.tsx index e1670d4ee..39f225f16 100644 --- a/app/assets/javascripts/components/ComponentView/index.tsx +++ b/app/assets/javascripts/components/ComponentView/index.tsx @@ -82,12 +82,12 @@ export const ComponentView: FunctionalComponent = observer( } }(); - setIsExpired(component.valid_until && component.valid_until <= new Date()); + setIsExpired(component.isExpired); - const readonlyState = application.componentManager!.getReadonlyStateForComponent(component); + const readonlyState = application.componentManager.getReadonlyStateForComponent(component); if (!readonlyState.lockReadonly) { - application.componentManager!.setReadonlyStateForComponent(component, isExpired); + application.componentManager.setReadonlyStateForComponent(component, isExpired); } setIsComponentValid(!offlineRestricted && !hasUrlError); @@ -155,7 +155,7 @@ export const ComponentView: FunctionalComponent = observer( } } clearTimeout(loadTimeout); - await application.componentManager!.registerComponentWindow( + await application.componentManager.registerComponentWindow( component, iframe.contentWindow! ); @@ -198,7 +198,7 @@ export const ComponentView: FunctionalComponent = observer( return; } - const iframe = application.componentManager!.iframeForComponent( + const iframe = application.componentManager.iframeForComponent( component.uuid ); if (!iframe) { @@ -218,7 +218,7 @@ export const ComponentView: FunctionalComponent = observer( const expiredDate = isExpired ? component.dateToLocalizedString(component.valid_until) : ''; const getUrl = () => { - const url = component ? application.componentManager!.urlForComponent(component) : ''; + const url = component ? application.componentManager.urlForComponent(component) : ''; return url as string; }; @@ -265,13 +265,13 @@ export const ComponentView: FunctionalComponent = observer( return; } - const unregisterComponentHandler = application.componentManager!.registerHandler({ + const unregisterComponentHandler = application.componentManager.registerHandler({ identifier: 'component-view-' + Math.random(), areas: [component.area], actionHandler: (component, action, data) => { switch (action) { case (ComponentAction.SetSize): - application.componentManager!.handleSetSizeEvent(component, data); + application.componentManager.handleSetSizeEvent(component, data); break; case (ComponentAction.KeyDown): application.io.handleComponentKeyDown(data.keyboardModifier); diff --git a/package.json b/package.json index 692317da1..2318bb4e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "standard-notes-web", - "version": "3.9.2", + "version": "3.9.3", "license": "AGPL-3.0-or-later", "repository": { "type": "git", @@ -72,7 +72,7 @@ "@reach/listbox": "^0.16.2", "@standardnotes/features": "1.8.1", "@standardnotes/sncrypto-web": "1.5.3", - "@standardnotes/snjs": "2.17.6", + "@standardnotes/snjs": "2.17.7", "mobx": "^6.3.5", "mobx-react-lite": "^3.2.1", "preact": "^10.5.15", diff --git a/yarn.lock b/yarn.lock index 7097c1474..e16846dae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,10 +2199,10 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@standardnotes/snjs@2.17.6": - version "2.17.6" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.6.tgz#ce432bd820b565f97e7dbdd096a056f504c1615a" - integrity sha512-UGRgxzVdMlwGX9xTdve/Cq+H/gDeI8OTyrr2mGeMA79JhhfUwSaEGbriLGkmA9moDctUK+/m79oMtXg/r5Kbtw== +"@standardnotes/snjs@2.17.7": + version "2.17.7" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.7.tgz#10f56e46d6a992e84da94fb7b9ec8dfc8a9a8da3" + integrity sha512-7BxEywqhIfYHfkKDlS466vMeWPznXwXrQVj21eKG4ibiAyYhuTXRUYhnCwZKdloNm9Wl0iChJXuiWfev2+tGqg== dependencies: "@standardnotes/auth" "^3.8.1" "@standardnotes/common" "^1.2.1"