diff --git a/src/components/modeler/Modeler.vue b/src/components/modeler/Modeler.vue index dcab037e0..025bf6010 100644 --- a/src/components/modeler/Modeler.vue +++ b/src/components/modeler/Modeler.vue @@ -343,6 +343,12 @@ export default { return false; }, }, + forPrinting: { + type: Boolean, + default() { + return false; + }, + }, }, mixins: [hotkeys, cloneSelection, linkEditing, transparentDragging], data() { @@ -540,9 +546,19 @@ export default { }, }, methods: { + getSvg() { + const svg = document.querySelector('.mini-paper svg'); + const css = 'text { font-family: sans-serif; }'; + const style = document.createElement('style'); + style.appendChild(document.createTextNode(css)); + svg.appendChild(style); + const svgString = (new XMLSerializer()).serializeToString(svg); + return svgString; + }, mountedInit() { store.commit('setReadOnly', this.readOnly); store.commit('setForDocumenting', this.forDocumenting); + store.commit('setForPrinting', this.forPrinting); this.graph = new dia.Graph(); store.commit('setGraph', this.graph); this.graph.set('interactiveFunc', cellView => { @@ -1466,6 +1482,7 @@ export default { if (emitChangeEvent) { window.ProcessMaker.EventBus.$emit('modeler-change'); } + window.ProcessMaker.EventBus.$emit('modeler-xml-loaded'); }, getBoundaryEvents(process) { return process.get('flowElements').filter(({ $type }) => $type === 'bpmn:BoundaryEvent'); diff --git a/src/store.js b/src/store.js index 0a131a6a9..be4c8ce3d 100644 --- a/src/store.js +++ b/src/store.js @@ -39,6 +39,7 @@ export default new Vuex.Store({ clientLeftPaper: false, readOnly: false, forDocumenting: false, + forPrinting: false, isMultiplayer: false, }, getters: { @@ -62,6 +63,7 @@ export default new Vuex.Store({ clientLeftPaper: state => state.clientLeftPaper, isReadOnly: state => state.readOnly, isForDocumenting: state => state.forDocumenting, + isForPrinting: state => state.forPrinting, showComponent: state => !state.readOnly, showPanTool: state => state.forDocumenting, isMultiplayer: state => state.isMultiplayer, @@ -73,6 +75,9 @@ export default new Vuex.Store({ setForDocumenting(state, value) { state.forDocumenting = value; }, + setForPrinting(state, value) { + state.forPrinting = value; + }, preventSavingElementPosition(state) { state.allowSavingElementPosition = false; }, diff --git a/tests/e2e/support/utils.js b/tests/e2e/support/utils.js index cdbf5fb6e..e4bc21faa 100644 --- a/tests/e2e/support/utils.js +++ b/tests/e2e/support/utils.js @@ -2,7 +2,7 @@ import { saveDebounce } from '../../../src/components/inspectors/inspectorConsta import path from 'path'; import { boundaryEventSelector, nodeTypes, taskSelector } from './constants'; -const renderTime = 300; +const renderTime = 5000; export function getTinyMceEditor() { return cy