From 8d2dcf376fe79ed8ec9414cc00c3e02ee45105f8 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Sat, 4 Mar 2017 16:54:04 +0000 Subject: [PATCH] add section empty state --- app/app/components/document/document-page.js | 2 +- app/app/components/document/document-view.js | 44 +++++++----- app/app/components/document/page-wizard.js | 67 ------------------ app/app/pods/document/index/template.hbs | 2 +- app/app/pods/document/zwizard/controller.js | 54 -------------- app/app/pods/document/zwizard/route.js | 21 ------ app/app/pods/document/zwizard/template.hbs | 1 - app/app/styles/view/document/view.scss | 7 +- .../components/document/document-view.hbs | 62 ++++++++++------ .../components/document/page-wizard.hbs | 63 ---------------- .../assets/img/empty-state-document.gif | Bin 13047 -> 0 bytes core/api/endpoint/sections_endpoint.go | 5 ++ 12 files changed, 80 insertions(+), 248 deletions(-) delete mode 100644 app/app/components/document/page-wizard.js delete mode 100644 app/app/pods/document/zwizard/controller.js delete mode 100644 app/app/pods/document/zwizard/route.js delete mode 100644 app/app/pods/document/zwizard/template.hbs delete mode 100644 app/app/templates/components/document/page-wizard.hbs delete mode 100644 app/public/assets/img/empty-state-document.gif diff --git a/app/app/components/document/document-page.js b/app/app/components/document/document-page.js index 88729821..ca895655 100644 --- a/app/app/components/document/document-page.js +++ b/app/app/components/document/document-page.js @@ -21,7 +21,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { didReceiveAttrs() { let toEdit = this.get('toEdit'); - if (toEdit === this.get('page.id')) { + if (toEdit === this.get('page.id') && this.get('isEditor')) { this.send('onEdit'); } }, diff --git a/app/app/components/document/document-view.js b/app/app/components/document/document-view.js index 46584c5b..9d6a3563 100644 --- a/app/app/components/document/document-view.js +++ b/app/app/components/document/document-view.js @@ -22,7 +22,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { sectionService: Ember.inject.service('section'), appMeta: Ember.inject.service(), link: Ember.inject.service(), - + hasPages: computed.notEmpty('pages'), newSectionName: '', newSectionNameMissing: computed.empty('newSectionName'), newSectionLocation: '', @@ -38,6 +38,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('blocks', blocks); this.set('hasBlocks', blocks.get('length') > 0); + // to test blocks.forEach((b) => { b.set('deleteId', `delete-block-button-${b.id}`); }); @@ -54,12 +55,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }, didInsertElement() { - $(".start-section").hoverIntent({interval: 100, over: function() { + $(".start-section:not(.start-section-empty-state)").hoverIntent({interval: 100, over: function() { // in - $(this).find('.start-button').css("display", "block").removeClass('fadeOut').addClass('fadeIn'); + $(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300}); }, out: function() { - //out - $(this).find('.start-button').css("display", "none").removeClass('fadeIn').addClass('fadeOut'); + // out + $(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300}); } }); }, @@ -109,12 +110,15 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { if (is.not.null(beforePage)) { // get any page before the beforePage so we can insert this new section between them let index = _.findIndex(this.get('pages'), function(p) { return p.get('id') === beforePage.get('id'); }); - let beforeBeforePage = this.get('pages')[index-1]; - if (is.not.undefined(beforeBeforePage)) { - sequence = (beforePage.get('sequence') + beforeBeforePage.get('sequence')) / 2; - } else { - sequence = beforePage.get('sequence') / 2; + if (index !== -1) { + let beforeBeforePage = this.get('pages')[index-1]; + + if (is.not.undefined(beforeBeforePage)) { + sequence = (beforePage.get('sequence') + beforeBeforePage.get('sequence')) / 2; + } else { + sequence = beforePage.get('sequence') / 2; + } } } @@ -124,7 +128,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { const promise = this.get('onInsertSection')(model); promise.then((id) => { - if (model.page.contentType === 'section') { + if (model.page.pageType === 'section') { this.set('toEdit', id); } else { this.get('onEditSection')(id); @@ -154,17 +158,26 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }, // Section wizard related - onShowSectionWizard(page) { - let beforePage = this.get('beforePage'); + if (is.undefined(page)) { + page = { id: '0' }; + } + let beforePage = this.get('beforePage'); if (is.not.null(beforePage) && $("#new-section-wizard").is(':visible') && beforePage.get('id') === page.id) { this.send('onHideSectionWizard'); return; } this.set('newSectionLocation', page.id); - this.set('beforePage', page); + + if (page.id === '0') { + // this handles add section at the end of the document + // because we are not before another page + this.set('beforePage', null); + } else { + this.set('beforePage', page); + } $("#new-section-wizard").insertAfter(`#add-section-button-${page.id}`); $("#new-section-wizard").velocity("transition.slideDownIn", {duration: 300, complete: @@ -250,7 +263,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { // to test onDeleteBlock(id) { this.attrs.onDeleteBlock(id); - }, - + } } }); diff --git a/app/app/components/document/page-wizard.js b/app/app/components/document/page-wizard.js deleted file mode 100644 index 7c8848da..00000000 --- a/app/app/components/document/page-wizard.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import NotifierMixin from '../../mixins/notifier'; - -export default Ember.Component.extend(NotifierMixin, { - display: 'section', // which CSS to use - hasTemplates: false, - hasBlocks: false, - blockMode: false, - - didReceiveAttrs() { - let blocks = this.get('blocks'); - let blockMode = is.not.undefined(blocks); - - this.set('blockMode', blockMode); - if (!blockMode) { - return; - } - - this.set('hasBlocks', blocks.get('length') > 0); - - blocks.forEach((b) => { - b.set('deleteId', `delete-block-button-${b.id}`); - }); - }, - - didRender() { - let self = this; - - Mousetrap.bind('esc', function () { - if (self.get('isDestroyed') || self.get('isDestroying')) { - return; - } - - self.send('onCancel'); - return false; - }); - }, - - actions: { - onCancel() { - this.attrs.onCancel(); - }, - - addSection(section) { - this.attrs.onAddSection(section); - }, - - onDeleteBlock(id) { - this.attrs.onDeleteBlock(id); - }, - - onInsertBlock(block) { - this.attrs.onInsertBlock(block); - } - } -}); diff --git a/app/app/pods/document/index/template.hbs b/app/app/pods/document/index/template.hbs index 13ba291b..d81065c8 100644 --- a/app/app/pods/document/index/template.hbs +++ b/app/app/pods/document/index/template.hbs @@ -40,7 +40,7 @@
-
+
{{#if toggled}} diff --git a/app/app/pods/document/zwizard/controller.js b/app/app/pods/document/zwizard/controller.js deleted file mode 100644 index db12c927..00000000 --- a/app/app/pods/document/zwizard/controller.js +++ /dev/null @@ -1,54 +0,0 @@ -import Ember from 'ember'; -import NotifierMixin from '../../../mixins/notifier'; - -export default Ember.Controller.extend(NotifierMixin, { - documentService: Ember.inject.service('document'), - - actions: { - onCancel() { - this.transitionToRoute('document'); - }, - - onAddSection(section) { - this.audit.record("added-section-" + section.get('contentType')); - - let page = { - documentId: this.get('model.document.id'), - title: `${section.get('title')}`, - level: 1, - sequence: 0, - body: "", - contentType: section.get('contentType'), - pageType: section.get('pageType') - }; - - let meta = { - documentId: this.get('model.document.id'), - rawBody: "", - config: "", - externaleSource: true - }; - - let model = { - page: page, - meta: meta - }; - - this.get('documentService').addPage(this.get('model.document.id'), model).then((newPage) => { - let data = this.get('store').normalize('page', newPage); - this.get('store').push(data); - - this.get('documentService').getPages(this.get('model.document.id')).then((pages) => { - this.set('model.pages', pages.filterBy('pageType', 'section')); - this.set('model.tabs', pages.filterBy('pageType', 'tab')); - - this.get('documentService').getPageMeta(this.get('model.document.id'), newPage.id).then(() => { - let options = {}; - options['mode'] = 'edit'; - this.transitionToRoute('document.section', newPage.id, { queryParams: options }); - }); - }); - }); - } - } -}); diff --git a/app/app/pods/document/zwizard/route.js b/app/app/pods/document/zwizard/route.js deleted file mode 100644 index 465717f6..00000000 --- a/app/app/pods/document/zwizard/route.js +++ /dev/null @@ -1,21 +0,0 @@ -import Ember from 'ember'; -import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; - -export default Ember.Route.extend(AuthenticatedRouteMixin, { - documentService: Ember.inject.service('document'), - folderService: Ember.inject.service('folder'), - sectionService: Ember.inject.service('section'), - - model() { - return Ember.RSVP.hash({ - folders: this.modelFor('document').folders, - folder: this.modelFor('document').folder, - document: this.modelFor('document').document, - pages: this.modelFor('document').pages, - tabs: this.modelFor('document').tabs, - sections: this.get('sectionService').getAll().then(function (sections) { - return sections.filterBy('pageType', 'tab'); - }) - }); - } -}); diff --git a/app/app/pods/document/zwizard/template.hbs b/app/app/pods/document/zwizard/template.hbs deleted file mode 100644 index 37c5e05b..00000000 --- a/app/app/pods/document/zwizard/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAddSection=(action 'onAddSection')}} diff --git a/app/app/styles/view/document/view.scss b/app/app/styles/view/document/view.scss index fc0da62f..de2dfc35 100644 --- a/app/app/styles/view/document/view.scss +++ b/app/app/styles/view/document/view.scss @@ -151,7 +151,6 @@ } .start-section { - @include ease-in(); @extend .no-select; height: 60px; background-color: transparent; @@ -194,6 +193,12 @@ } } + .start-section-empty-state { + > .start-button { + display: block; + } + } + .new-section-wizard { @include border-radius(2px); margin: 0 0 30px 0; diff --git a/app/app/templates/components/document/document-view.hbs b/app/app/templates/components/document/document-view.hbs index 9a9e6da9..dbbd92be 100644 --- a/app/app/templates/components/document/document-view.hbs +++ b/app/app/templates/components/document/document-view.hbs @@ -1,35 +1,51 @@
- {{#each pages key="id" as |page index|}} + {{#if hasPages}} + {{#each pages key="id" as |page index|}} + {{#if isEditor}} +
+
+
+ add +
+
section
+
+
+ {{else}} +
+ {{/if}} + {{#if (is-equal page.pageType 'section')}} + {{#document/document-page document=document folder=folder page=page isEditor=isEditor toEdit=toEdit + onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') + onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{/document/document-page}} + {{/if}} + {{#if (is-equal page.pageType 'tab')}} + {{#document/document-tab document=document folder=folder page=page isEditor=isEditor + onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') + onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{/document/document-tab}} + {{/if}} + {{/each}} +
+
+
+ add +
+
section
+
+
+ {{else}} {{#if isEditor}} -
-
+
+
add
section
- {{else}} -
{{/if}} - {{#if (is-equal page.pageType 'section')}} - {{#document/document-page document=document folder=folder page=page isEditor=isEditor toEdit=toEdit - onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') - onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} - {{/document/document-page}} - {{/if}} - {{#if (is-equal page.pageType 'tab')}} - {{#document/document-tab document=document folder=folder page=page isEditor=isEditor - onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') - onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} - {{/document/document-tab}} - {{/if}} - {{else}} - no sections! -
- -
- {{/each}} + {{/if}}
diff --git a/app/app/templates/components/document/page-wizard.hbs b/app/app/templates/components/document/page-wizard.hbs deleted file mode 100644 index caf91168..00000000 --- a/app/app/templates/components/document/page-wizard.hbs +++ /dev/null @@ -1,63 +0,0 @@ -
-
-
    - {{#each sections as |section|}} -
  • -
    - -
    -
    -
    - {{section.title}} - {{#if section.preview}} -
    coming soon
    - {{/if}} -
    -
    {{section.description}}
    -
    -
    -
  • - {{/each}} -
- {{#if blockMode}} - {{#if hasBlocks}} -
-
Reusable content
-
    - {{#each blocks as |block|}} -
  • -
    -
    - view_agenda -
    -
    - {{#link-to 'document.block' folder.id folder.slug document.id document.slug block.id}} - mode_edit - {{/link-to}} - delete -
    -
    -
    -
    - {{block.title}} -
    -
    {{block.excerpt}}
    -
    By {{block.firstname}} {{block.lastname}}, {{time-ago block.created}} (used: {{ block.used }})
    -
    -
    - {{#dropdown-dialog target=block.deleteId position="bottom left" button="Delete" color="flat-red" onAction=(action 'onDeleteBlock' block.id)}} -

    - Are you sure you want to delete block
    - {{block.title}}? -

    - {{/dropdown-dialog}} -
  • - {{/each}} -
- {{else}} -
-
Reusable content appears below
- {{/if}} - {{/if}} -
-
diff --git a/app/public/assets/img/empty-state-document.gif b/app/public/assets/img/empty-state-document.gif deleted file mode 100644 index 523b76a0b0ee9a55906fe220d478e059378fa5e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13047 zcmdU#cUV(fx380skPsjVEfj$y)Xv+0v9E zYA7loND&oK5do#xXwu7#-#L4K`#kr2_y5b{c}Nzsu6O>%9AmCwVrHzN>FNda0)8O@ zUjNt~__jAa{b_4!Yhhub>GOWxhlBSkdmlbdcQ5Tz-W>k?x%~C(*UAr@cV_l8-W?=P z9DMusZD)6Ha&mHNYU=0DpB2;lJA3;Z8yk-n_E$ExyC**{FR%RC*>9a#B)&du`?CN2 z*UsnprLpCMmF@jct2?h}mlikoKX2@B?e5R5?o3QfeBauSf3rKizQ44-)AV8G)w`*h z@gD_m)@B#KznETn_-QTc?MA`G#=ykK&e`>??VXLy?dZ3M8(TY_U$*8xf1dxjzP+=% zwY~dtetmOm=iuPr@bED8&DPwP`SJHtzc#mbcXy}f=IcNHT3ub;-ro80<;(l`?{{`~ zXJ=>k_V(7-*Z21JXJ%$LH@8+-*Y@`hc6OK(+W+w31GA<1`T6bb-7jC}zkmO}zOnuJ z^Ow!7?X8{Nm6g@?&Fz_)*|oK`^^L9lgM(ii+sv*O7Z>N(cE%^)?dJfy!CS4ZsU!zW@`Z+9KBv&T*;pYk{G@bWed4fL=JwX$~$ zz3QgvE_PBEs~w^h;^Xh*5#)*u@ww)ET`NRK%+=lRl7|-a^Y7bAV%UEb3A(ByM)>^? z?C(Ae`~p3&#}w5S+*FRLVvlPosvOf))lieisw%6fD=Difsc0&w9Mxj}swrdt`$vq~ zTcEqAmaU=jfA_`wrX%JR6y&d^q;&J75xG)GwW(6y5xMltNtn zl~fd!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oDH$iS4;HkN(QR;GuO*?&7c49 zmM}h@E>?@uJ(BJO=EpQNG@^k`a!4h0cfpznc42##H@t0+~|zlY+_zo zK}l4088z;9a#l4n_co~{wyrQImzjH8oXX6-O?lXnb}v7IQPM?u^0c$Lx2ONvK;Ka6 z$jeuG_hR0b<&3`jlQi{_nm9Sz`epvb;!;Y&x9_x{Z&p@`%fBdV+Z&r(E1wVUmrGiU z5JG=7^6g1o`=svqNm%y;S_RkR2@|~7;+;h diff --git a/core/api/endpoint/sections_endpoint.go b/core/api/endpoint/sections_endpoint.go index eaaf8045..8e6e5fbd 100644 --- a/core/api/endpoint/sections_endpoint.go +++ b/core/api/endpoint/sections_endpoint.go @@ -12,6 +12,7 @@ package endpoint import ( + "database/sql" "encoding/json" "io/ioutil" "net/http" @@ -121,6 +122,10 @@ func RefreshSections(w http.ResponseWriter, r *http.Request) { // Grab the page because we need content type and page, err2 := p.GetPage(pm.PageID) + if err2 == sql.ErrNoRows { + continue + } + if err2 != nil { writeGeneralSQLError(w, method, err2) log.IfErr(tx.Rollback())