Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v13.10 LTS #111

Merged
merged 5 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "2sxc-ui",
"version": "13.06.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",
Expand Down
5 changes: 3 additions & 2 deletions projects/$2sxc/src/sxc-instance/web-api/sxc-web-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>, method?: string): Promise<Response> {
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);
}


Expand Down
54 changes: 28 additions & 26 deletions projects/inpage/src/manage/edit-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('<div class="dnnFormMessage dnnFormWarning sc-element"></div>')[0];
let msg = '';
const toolbar = NoJQ.domFromString('<ul class="sc-menu"></ul>')[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('<div class="dnnFormMessage dnnFormWarning sc-element"></div>')[0];
// let msg = '';
// const toolbar = NoJQ.domFromString('<ul class="sc-menu"></ul>')[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);
// }
4 changes: 3 additions & 1 deletion projects/inpage/src/manage/manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down