diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c635e3..e7d121c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,10 @@ version: 2 jobs: build: docker: - - image: circleci/node:lts-browsers + - image: circleci/node:8.10-browsers + environment: + JOBS: 2 + parallelism: 1 working_directory: ~/repo steps: - checkout diff --git a/addon/components/printable-pages.js b/addon/components/printable-pages.js index fa9ecaa..b43b276 100644 --- a/addon/components/printable-pages.js +++ b/addon/components/printable-pages.js @@ -4,6 +4,7 @@ import { inject as service } from "@ember/service"; import { alias } from "@ember/object/computed"; import { next } from "@ember/runloop"; import { task } from "ember-concurrency"; +import { Promise } from "rsvp"; export default Component.extend({ layout, @@ -28,19 +29,34 @@ export default Component.extend({ // TASKS renderStartTask: task(function*(currentPage) { if (this.onRenderStart) { - next(() => this.onRenderStart(currentPage)); + yield new Promise(resolve => { + next(() => { + this.onRenderStart(currentPage); + resolve(); + }); + }); } }).keepLatest(), renderProgressTask: task(function*() { if (this.onRenderProgress) { - next(() => this.onRenderProgress(this.reportObject.lastPage)); + yield new Promise(resolve => { + next(() => { + this.onRenderProgress(this.reportObject.lastPage); + resolve(); + }); + }); } }).keepLatest(), reportIfCompleteTask: task(function*() { if (this.reportObject.isFinishedRendering && this.onRenderComplete) { - next(() => this.onRenderComplete(this.reportObject.lastPage)); + yield new Promise(resolve => { + next(() => { + this.onRenderComplete(this.reportObject.lastPage); + resolve(); + }); + }); } }).keepLatest(), diff --git a/addon/components/printable-pages/section.js b/addon/components/printable-pages/section.js index 8963932..c59cd1e 100644 --- a/addon/components/printable-pages/section.js +++ b/addon/components/printable-pages/section.js @@ -1,7 +1,6 @@ import Component from "@ember/component"; import layout from "../../templates/components/printable-pages/section"; import { getBy, array, sum, raw } from "ember-awesome-macros"; -import { alias } from "@ember/object/computed"; import { htmlSafe } from "@ember/template"; export default Component.extend({ @@ -18,7 +17,10 @@ export default Component.extend({ this._super(...arguments); if (!this.shouldRender) return; - let id = this.register({data: this.data || [], columnCount: this.columnCount}); + let id = this.register({ + data: this.data || [], + columnCount: this.columnCount + }); this.set("id", id); }, diff --git a/addon/services/document-data.js b/addon/services/document-data.js index 6be9f10..59e5427 100644 --- a/addon/services/document-data.js +++ b/addon/services/document-data.js @@ -1,7 +1,7 @@ import Service from "@ember/service"; import EmberObject, { computed } from "@ember/object"; import { A } from "@ember/array"; -import { array, equal, raw, difference } from "ember-awesome-macros"; +import { array, equal, difference } from "ember-awesome-macros"; import { alias } from "@ember/object/computed"; import { run } from "@ember/runloop"; diff --git a/addon/templates/components/printable-pages.hbs b/addon/templates/components/printable-pages.hbs index 904cf98..8c50fb2 100644 --- a/addon/templates/components/printable-pages.hbs +++ b/addon/templates/components/printable-pages.hbs @@ -1,15 +1,15 @@ {{yield (hash - title-page=(component 'printable-pages/title-page' + title-page=(component "printable-pages/title-page" pageLayout=this.pageLayout pageCount=this.reportObject.lastPage ) - chapter=(component 'printable-pages/chapter' + chapter=(component "printable-pages/chapter" chapters=this.chapters lastReportPage=this.reportObject.lastPage pageLayout=this.pageLayout - register=(action 'registerChapter') - registerSection=(action 'registerSection' this.elementId) - addPage=(action 'addPage') + register=(action "registerChapter") + registerSection=(action "registerSection" this.elementId) + addPage=(action "addPage") checkIfComplete=(perform this.reportIfCompleteTask) ) )}} diff --git a/addon/templates/components/printable-pages/chapter-page.hbs b/addon/templates/components/printable-pages/chapter-page.hbs index a1b463e..36e4b9a 100644 --- a/addon/templates/components/printable-pages/chapter-page.hbs +++ b/addon/templates/components/printable-pages/chapter-page.hbs @@ -1,25 +1,27 @@ {{yield (hash - block='header' - meta=@pageMeta + block="header" + meta=pageMeta )}} -