From dee60e0fae4237414ef36cb1d168d90325316b6c Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sun, 14 Nov 2021 11:26:57 -0600 Subject: [PATCH 1/3] fix: extension url validation --- .../components/ComponentView/UrlMissing.tsx | 11 +++++++---- .../javascripts/components/ComponentView/index.tsx | 1 + package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/components/ComponentView/UrlMissing.tsx b/app/assets/javascripts/components/ComponentView/UrlMissing.tsx index c2dd6072c..fa6a56af2 100644 --- a/app/assets/javascripts/components/ComponentView/UrlMissing.tsx +++ b/app/assets/javascripts/components/ComponentView/UrlMissing.tsx @@ -11,12 +11,15 @@ export const UrlMissing: FunctionalComponent = ({ componentName }) => {
- This extension is not installed correctly. + This extension is missing its URL property.
-

Please uninstall {componentName}, then re-install it.

- This issue can occur if you access Standard Notes using an older version of the app.{' '} - Ensure you are running at least version 2.1 on all platforms. + In order to access your note immediately, + please switch from {componentName} to the Plain Editor. +

+
+

+ Please contact help@standardnotes.com to remedy this issue.

diff --git a/app/assets/javascripts/components/ComponentView/index.tsx b/app/assets/javascripts/components/ComponentView/index.tsx index 39f225f16..a6c140b3e 100644 --- a/app/assets/javascripts/components/ComponentView/index.tsx +++ b/app/assets/javascripts/components/ComponentView/index.tsx @@ -189,6 +189,7 @@ export const ComponentView: FunctionalComponent = observer( }, [component, handleIframeLoadTimeout, loadTimeout]); useEffect(() => { + reloadStatus(); if (!iframeRef.current) { return; } diff --git a/package.json b/package.json index 2318bb4e1..05d70a239 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.7", + "@standardnotes/snjs": "2.17.8", "mobx": "^6.3.5", "mobx-react-lite": "^3.2.1", "preact": "^10.5.15", diff --git a/yarn.lock b/yarn.lock index e16846dae..c967266a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,10 +2199,10 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@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== +"@standardnotes/snjs@2.17.8": + version "2.17.8" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.8.tgz#b701e36de871cf44de461bab9e10c215228b0cd1" + integrity sha512-n9xLdYWA2wHLxdXO6Bree9A30A30D8Ci+s/3plnD1xGSl/u/w0K51jmhNrJNnjr2NWfRHWBz746U0hx1JcWqnw== dependencies: "@standardnotes/auth" "^3.8.1" "@standardnotes/common" "^1.2.1" From 893615157bb0c934e92832b867d98ae5e7e6e114 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sun, 14 Nov 2021 11:46:41 -0600 Subject: [PATCH 2/3] fix: update snjs --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 05d70a239..20e156fa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "standard-notes-web", - "version": "3.9.3", + "version": "3.9.4", "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.8", + "@standardnotes/snjs": "2.17.9", "mobx": "^6.3.5", "mobx-react-lite": "^3.2.1", "preact": "^10.5.15", diff --git a/yarn.lock b/yarn.lock index c967266a8..487bae42e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,10 +2199,10 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@standardnotes/snjs@2.17.8": - version "2.17.8" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.8.tgz#b701e36de871cf44de461bab9e10c215228b0cd1" - integrity sha512-n9xLdYWA2wHLxdXO6Bree9A30A30D8Ci+s/3plnD1xGSl/u/w0K51jmhNrJNnjr2NWfRHWBz746U0hx1JcWqnw== +"@standardnotes/snjs@2.17.9": + version "2.17.9" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.9.tgz#9e7402252c6acda6471cc9d887516f17b6bd2cb2" + integrity sha512-Hi57vIByRD5qEOFfQrq/qILH5qRgngyn57qhHE2yKDsX//CTDsdqKGKVZbG0W54rQ+JxYUfjAuBPR/pxIVTi6w== dependencies: "@standardnotes/auth" "^3.8.1" "@standardnotes/common" "^1.2.1" From 04136159dcb19c09f83b2fbcfdec510863684278 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sun, 14 Nov 2021 14:27:26 -0600 Subject: [PATCH 3/3] feat: ability to uninstall any extension --- .../preferences/panes/Extensions.tsx | 97 +++++++++++-------- .../extensions-segments/ExtensionItem.tsx | 35 +++---- 2 files changed, 72 insertions(+), 60 deletions(-) diff --git a/app/assets/javascripts/preferences/panes/Extensions.tsx b/app/assets/javascripts/preferences/panes/Extensions.tsx index 5bf8b8f01..9fdb73d12 100644 --- a/app/assets/javascripts/preferences/panes/Extensions.tsx +++ b/app/assets/javascripts/preferences/panes/Extensions.tsx @@ -1,4 +1,4 @@ -import { ContentType, SNComponent } from '@standardnotes/snjs'; +import { ButtonType, ContentType, SNComponent } from '@standardnotes/snjs'; import { Button } from '@/components/Button'; import { DecoratedInput } from '@/components/DecoratedInput'; import { WebApplication } from '@/ui_models/application'; @@ -35,8 +35,22 @@ export const Extensions: FunctionComponent<{ }, [confirmableExtension, confirmableEnd]); const uninstallExtension = async (extension: SNComponent) => { - await application.deleteItem(extension); - setExtensions(loadExtensions(application)); + application.alertService.confirm( + 'Are you sure you want to uninstall this extension? Note that extensions managed by your subscription will automatically be re-installed on application restart.', + 'Uninstall Extension?', + 'Uninstall', + ButtonType.Danger, + 'Cancel' + ) + .then(async (shouldRemove: boolean) => { + if (shouldRemove) { + await application.deleteItem(extension); + setExtensions(loadExtensions(application)); + } + }) + .catch((err: string) => { + application.alertService.alert(err); + }); }; const submitExtensionUrl = async (url: string) => { @@ -72,50 +86,51 @@ export const Extensions: FunctionComponent<{ return (
{visibleExtensions.length > 0 && -
- { - visibleExtensions - .sort((e1, e2) => e1.name.toLowerCase().localeCompare(e2.name.toLowerCase())) - .map((extension, i) => ( - - )) - } -
+
+ { + visibleExtensions + .sort((e1, e2) => e1.name.toLowerCase().localeCompare(e2.name.toLowerCase())) + .map((extension, i) => ( + + )) + } +
}
{!confirmableExtension && - - Install Custom Extension -
- { setCustomUrl(value); }} - /> -
-
- - } + <> +
+
+ {isToggleable && ( + <> + {(extension.active ? ( +
+ ); };