diff --git a/.env.sample b/.env.sample index 100b7cc5d..03888379e 100644 --- a/.env.sample +++ b/.env.sample @@ -9,7 +9,6 @@ SECRET_KEY_BASE=test APP_HOST=http://localhost:3001 EXTENSIONS_MANAGER_LOCATION=extensions/extensions-manager/dist/index.html -BATCH_MANAGER_LOCATION=extensions/batch-manager/dist/index.min.html SF_DEFAULT_SERVER=http://localhost:3000 SF_NEXT_VERSION_SERVER=http://localhost:3000 @@ -17,7 +16,6 @@ SF_NEXT_VERSION_SERVER=http://localhost:3000 DEV_DEFAULT_SYNC_SERVER=https://sync.standardnotes.org DEV_NEXT_VERSION_SYNC_SERVER=https://api.standardnotes.com DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html -DEV_BATCH_MANAGER_LOCATION=public/extensions/batch-manager/dist/index.min.html # NewRelic (Optional) NEW_RELIC_ENABLED=false diff --git a/.gitmodules b/.gitmodules index 86c55fdbd..adb7eaeaa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,4 @@ [submodule "public/extensions/extensions-manager"] path = public/extensions/extensions-manager url = https://github.com/sn-extensions/extensions-manager.git -[submodule "public/extensions/batch-manager"] - path = public/extensions/batch-manager - url = https://github.com/sn-extensions/batch-manager.git + diff --git a/README.md b/README.md index 44f760c09..2e6ea90fa 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,6 @@ The web app makes use of two optional native extensions, which, when running the 1. Set the following environment variables in the .env file: ``` EXTENSIONS_MANAGER_LOCATION=extensions/extensions-manager/dist/index.html - BATCH_MANAGER_LOCATION=extensions/batch-manager/dist/index.min.html ``` You can also set the `SF_DEFAULT_SERVER` and `SF_NEXT_VERSION_SERVER` environment variables to set the default servers for login and registration. diff --git a/app/assets/javascripts/services/nativeExtManager.ts b/app/assets/javascripts/services/nativeExtManager.ts index 42e52b6d8..64d728987 100644 --- a/app/assets/javascripts/services/nativeExtManager.ts +++ b/app/assets/javascripts/services/nativeExtManager.ts @@ -8,15 +8,12 @@ import { FillItemContent, ComponentMutator, Copy, - dictToArray -, PayloadContent , ComponentPermission } from '@standardnotes/snjs'; - - + PayloadContent, + ComponentPermission } from '@standardnotes/snjs'; /** A class for handling installation of system extensions */ export class NativeExtManager extends ApplicationService { extManagerId = 'org.standardnotes.extensions-manager'; - batchManagerId = 'org.standardnotes.batch-manager'; /** @override */ async onAppLaunch() { @@ -32,14 +29,6 @@ export class NativeExtManager extends ApplicationService { ]); } - get batchManagerPred() { - const batchMgrId = 'org.standardnotes.batch-manager'; - return SNPredicate.CompoundPredicate([ - new SNPredicate('content_type', '=', ContentType.Component), - new SNPredicate('package_info.identifier', '=', batchMgrId) - ]); - } - get extMgrUrl() { return (window as any)._extensions_manager_location; } @@ -50,9 +39,7 @@ export class NativeExtManager extends ApplicationService { reload() { this.application!.singletonManager!.registerPredicate(this.extManagerPred); - this.application!.singletonManager!.registerPredicate(this.batchManagerPred); this.resolveExtensionsManager(); - this.resolveBatchManager(); } async resolveExtensionsManager() { @@ -132,75 +119,4 @@ export class NativeExtManager extends ApplicationService { } return content; } - - async resolveBatchManager() { - const batchManager = (await this.application!.singletonManager!.findOrCreateSingleton( - this.batchManagerPred, - ContentType.Component, - this.batchManagerTemplateContent() - )) as SNComponent; - let needsSync = false; - if (isDesktopApplication()) { - if (!batchManager.local_url) { - await this.application!.changeItem(batchManager.uuid, (m) => { - const mutator = m as ComponentMutator; - mutator.local_url = this.batchMgrUrl; - }); - needsSync = true; - } - } else { - if (!batchManager.hosted_url) { - await this.application!.changeItem(batchManager.uuid, (m) => { - const mutator = m as ComponentMutator; - mutator.hosted_url = this.batchMgrUrl; - }); - needsSync = true; - } - } - // Handle addition of SN|ExtensionRepo permission - const permissions = Copy(batchManager!.permissions) as ComponentPermission[]; - const permission = permissions.find((p) => { - return p.name === ComponentAction.StreamItems; - }); - if (permission && !permission.content_types!.includes(ContentType.ExtensionRepo)) { - permission.content_types!.push(ContentType.ExtensionRepo); - await this.application!.changeItem(batchManager.uuid, (m) => { - const mutator = m as ComponentMutator; - mutator.permissions = permissions; - }); - needsSync = true; - } - if (needsSync) { - this.application!.saveItem(batchManager.uuid); - } - } - - batchManagerTemplateContent() { - const url = this.batchMgrUrl; - if (!url) { - throw Error('window._batch_manager_location must be set.'); - } - const packageInfo = { - name: 'Batch Manager', - identifier: this.batchManagerId - }; - const allContentType = dictToArray(ContentType); - const content = FillItemContent({ - name: packageInfo.name, - area: 'modal', - package_info: packageInfo, - permissions: [ - { - name: ComponentAction.StreamItems, - content_types: allContentType - } - ] - }); - if (isDesktopApplication()) { - content.local_url = this.batchMgrUrl; - } else { - content.hosted_url = this.batchMgrUrl; - } - return content; - } } diff --git a/app/assets/javascripts/ui_models/application.ts b/app/assets/javascripts/ui_models/application.ts index 0803b531b..3577b4703 100644 --- a/app/assets/javascripts/ui_models/application.ts +++ b/app/assets/javascripts/ui_models/application.ts @@ -213,11 +213,6 @@ export class WebApplication extends SNApplication { async openModalComponent(component: SNComponent): Promise { switch (component.package_info?.identifier) { - case 'org.standardnotes.batch-manager': - if (!await this.authorizeBatchManagerAccess()) { - return; - } - break; case 'org.standardnotes.cloudlink': if (!await this.authorizeCloudLinkAccess()) { return; diff --git a/index.html b/index.html index c91af2be3..1c0798bc1 100644 --- a/index.html +++ b/index.html @@ -32,14 +32,12 @@ data-default-sync-server="<%= env.DEV_DEFAULT_SYNC_SERVER %>" data-next-version-sync-server="<%= env.DEV_NEXT_VERSION_SYNC_SERVER %>" data-extensions-manager-location="<%= env.DEV_EXTENSIONS_MANAGER_LOCATION %>" - data-batch-manager-location="<%= env.DEV_BATCH_MANAGER_LOCATION %>" data-bugsnag-api-key="<%= env.DEV_BUGSNAG_API_KEY %>" > diff --git a/public/extensions/batch-manager b/public/extensions/batch-manager deleted file mode 160000 index 2d1ba6ac9..000000000 --- a/public/extensions/batch-manager +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d1ba6ac9f09193e40c4241a70605ecb3c15d3c7