diff --git a/domain/page/endpoint.go b/domain/page/endpoint.go index bd3fe0b7..53a4c988 100644 --- a/domain/page/endpoint.go +++ b/domain/page/endpoint.go @@ -119,6 +119,7 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) { model.Page.Status = workflow.ChangePending } } else { + model.Page.RelativeID = "" model.Page.Status = workflow.ChangePublished } diff --git a/gui/app/components/document/view-content.js b/gui/app/components/document/view-content.js index 8c156d71..11bb334c 100644 --- a/gui/app/components/document/view-content.js +++ b/gui/app/components/document/view-content.js @@ -280,16 +280,13 @@ export default Component.extend(TooltipMixin, { return; } - let page = { - documentId: this.get('document.id'), - title: `${block.get('title')}`, - level: 1, - sequence: 1024, - body: block.get('body'), - contentType: block.get('contentType'), - pageType: block.get('pageType'), - blockId: block.get('id') - }; + let page = models.PageModel.create(); + page.set('documentId', this.get('document.id')); + page.set('title', `${block.get('title')}`); + page.set('body', block.get('body')); + page.set('contentType', block.get('contentType')); + page.set('pageType', block.get('pageType')); + page.set('blockId', block.get('id')); let meta = { documentId: this.get('document.id'), diff --git a/gui/app/components/section/markdown/type-editor.js b/gui/app/components/section/markdown/type-editor.js index c7169be2..890187fe 100644 --- a/gui/app/components/section/markdown/type-editor.js +++ b/gui/app/components/section/markdown/type-editor.js @@ -121,7 +121,7 @@ export default Component.extend({ page.set('title', title); meta.set('rawBody', this.getBody()); - let cb = this.get('onCancel'); + let cb = this.get('onAction'); cb(page, meta); } } diff --git a/gui/app/components/section/papertrail/type-editor.js b/gui/app/components/section/papertrail/type-editor.js index 9e3555d7..9a62f2c2 100644 --- a/gui/app/components/section/papertrail/type-editor.js +++ b/gui/app/components/section/papertrail/type-editor.js @@ -52,9 +52,9 @@ export default Component.extend(SectionMixin, NotifierMixin, { displayError(reason) { if (netUtil.isAjaxAccessError(reason)) { - this.showNotification(`Unable to authenticate`); + // this.showNotification(`Unable to authenticate`); } else { - this.showNotification(`Something went wrong, try again!`); + // this.showNotification(`Something went wrong, try again!`); } }, @@ -181,7 +181,7 @@ export default Component.extend(SectionMixin, NotifierMixin, { }, function (reason) { // eslint-disable-line no-unused-vars self.set('authenticated', false); self.set('waiting', false); - self.showNotification(`Something went wrong, try again!`); + // self.showNotification(`Something went wrong, try again!`); }); } } diff --git a/gui/app/components/section/table/type-editor.js b/gui/app/components/section/table/type-editor.js index 0f1454ac..74f7a35e 100644 --- a/gui/app/components/section/table/type-editor.js +++ b/gui/app/components/section/table/type-editor.js @@ -10,7 +10,7 @@ // https://documize.com import $ from 'jquery'; -import { schedule } from 'ember/runloop'; +import { schedule } from '@ember/runloop'; import { computed } from '@ember/object'; import Component from '@ember/component'; diff --git a/gui/app/pods/document/index/controller.js b/gui/app/pods/document/index/controller.js index 3e2d3771..7f8849cf 100644 --- a/gui/app/pods/document/index/controller.js +++ b/gui/app/pods/document/index/controller.js @@ -10,6 +10,7 @@ // https://documize.com import { Promise as EmberPromise } from 'rsvp'; +import { schedule } from '@ember/runloop'; import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; import TooltipMixin from '../../../mixins/tooltip'; @@ -143,7 +144,10 @@ export default Controller.extend(TooltipMixin, { this.get('document.slug'), newPage.id); } else { - resolve(newPage.id); + schedule('afterRender', () => { + this.set('currentPageId', newPage.id); + resolve(newPage.id); + }); } }); });