From 7d5cd30fac331fcf563c8655d17c7d25786a18a0 Mon Sep 17 00:00:00 2001 From: ijungleboy Date: Wed, 27 Apr 2022 15:57:32 +0200 Subject: [PATCH 1/4] version bump 13.07 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cfbcc40ae..9f0bd4149 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "2sxc-ui", - "version": "13.06.00", + "version": "13.07.00", "description": "2sxc UI - the JS UI of 2sxc", "scripts": { "release-all": "npm run js2sxc && npm run inpage && npm run snippets && npm run quickdialog && npm run turn-on", From e3aa0942a565989ee2eb74ac250b4aba1ee20f60 Mon Sep 17 00:00:00 2001 From: ijungleboy Date: Tue, 3 May 2022 22:16:28 +0200 Subject: [PATCH 2/4] minor error handling now fully to server --- projects/inpage/src/manage/edit-manager.ts | 54 +++++++++++----------- projects/inpage/src/manage/manage.ts | 4 +- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/projects/inpage/src/manage/edit-manager.ts b/projects/inpage/src/manage/edit-manager.ts index af1f40c99..12aa8f1ab 100644 --- a/projects/inpage/src/manage/edit-manager.ts +++ b/projects/inpage/src/manage/edit-manager.ts @@ -95,34 +95,36 @@ export class EditManager implements SxcInstanceManage { this.editContext.contentBlock.Guid = newGuid; } - /** - * init this object - */ - init(): void { - const tag = SxcEdit.getTag(this.sxc); - // enhance UI in case there are known errors / issues - const isErrorState = this.editContext && this.editContext.error && this.editContext.error.type; - if (isErrorState) - handleErrors(this.editContext.error.type, tag); - } + // /** + // * init this object + // */ + // init(): void { + // // const tag = SxcEdit.getTag(this.sxc); + // // enhance UI in case there are known errors / issues + // // const isErrorState = this.editContext && this.editContext.error && this.editContext.error.type; + // // 2022-05-02 2dm - not sure if this is actually needed any more... + // // it only handled a single error + // // if (isErrorState) + // // handleErrors(this.editContext.error.type, tag); + // } } -/** - * private: show error when the app-data hasn't been installed yet for this imported-module - */ -function handleErrors(errType: string, cbTag: HTMLElement): void { - const errWrapper = NoJQ.domFromString('
')[0]; - let msg = ''; - const toolbar = NoJQ.domFromString('')[0]; - if (errType === 'DataIsMissing') { - msg = - 'Error: System.Exception: Data is missing - usually when a site is copied but the content / apps have not been imported yet - check 2sxc.org/help?tag=export-import'; - toolbar.setAttribute('data-toolbar', '[{\"action\": \"zone\"}, {\"action\": \"more\"}]'); - } - errWrapper.append(msg); - errWrapper.append(toolbar); - cbTag.append(errWrapper); -} +// /** +// * private: show error when the app-data hasn't been installed yet for this imported-module +// */ +// function handleErrors(errType: string, cbTag: HTMLElement): void { +// const errWrapper = NoJQ.domFromString('
')[0]; +// let msg = ''; +// const toolbar = NoJQ.domFromString('')[0]; +// if (errType === 'DataIsMissing') { +// msg = +// 'Error: System.Exception: Data is missing - usually when a site is copied but the content / apps have not been imported yet - check 2sxc.org/help?tag=export-import'; +// toolbar.setAttribute('data-toolbar', '[{\"action\": \"zone\"}, {\"action\": \"more\"}]'); +// } +// errWrapper.append(msg); +// errWrapper.append(toolbar); +// cbTag.append(errWrapper); +// } diff --git a/projects/inpage/src/manage/manage.ts b/projects/inpage/src/manage/manage.ts index b5738f8bd..03d64aab5 100644 --- a/projects/inpage/src/manage/manage.ts +++ b/projects/inpage/src/manage/manage.ts @@ -38,7 +38,9 @@ export class Manage { return new Cms().run({ ...runParams, context: sxc }); }; - editManager.init(); + // Init to handle special errors + // 2022-05-02 2dm disabled, don't think we need it any more + // editManager.init(); return editManager; } catch (e) { console.error('error in 2sxc - will log but not throw', e); From 1381367c7365e2d89547f73a51c5368307a539c0 Mon Sep 17 00:00:00 2001 From: ijungleboy Date: Wed, 4 May 2022 12:59:03 +0200 Subject: [PATCH 3/4] version bump 13.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f0bd4149..d1aadd1e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "2sxc-ui", - "version": "13.07.00", + "version": "13.10.00", "description": "2sxc UI - the JS UI of 2sxc", "scripts": { "release-all": "npm run js2sxc && npm run inpage && npm run snippets && npm run quickdialog && npm run turn-on", From c875395a58ddab43719fae9184065406161ca47f Mon Sep 17 00:00:00 2001 From: ijungleboy Date: Wed, 4 May 2022 14:00:18 +0200 Subject: [PATCH 4/4] minor fetch adjustment --- projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts b/projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts index 731c82391..c84d61f90 100644 --- a/projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts +++ b/projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts @@ -150,10 +150,11 @@ export class SxcWebApi implements Public.SxcWebApi { // Note: fetch was documented in v12.10 (December 2021) but will probably never be used externally // So we rename it to fetchRaw and later will make fetch just be the json implementation. // Renamed and added this warning in 13.04 (2022-03-14), will drop in v14 and probably make it do fetchJson by default + // Changed functionality in 13.10 (2022-05-04) to make it do fetchJson by default // Important: Do not document, as it shouldn't be used fetch(url: string, data?: string | Record, method?: string): Promise { - console.warn(`You are calling 'fetch' on the sxc.webApi. This is deprecated will stop in 2sxc v14, please use fetchRaw(...) or fetchJson(...) instead.`) - return this.fetchRaw(url, data, method); + // console.warn(`You are calling 'fetch' on the sxc.webApi. This is deprecated will stop in 2sxc v14, please use fetchRaw(...) or fetchJson(...) instead.`) + return this.fetchJson(url, data, method); }