@processmaker/modeler 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modeler.common.js +560 -386
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +560 -386
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +3 -3
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modeler/Modeler.vue +16 -0
- package/src/components/toolbar/ToolBar.vue +87 -11
- package/src/components/toolbar/toolbar.scss +17 -1
- package/src/undoRedoStore.js +45 -0
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
@toggle-panels-compressed="panelsCompressed = !panelsCompressed"
|
|
12
12
|
@toggle-mini-map-open="miniMapOpen = $event"
|
|
13
13
|
@saveBpmn="saveBpmn"
|
|
14
|
+
@close="close"
|
|
14
15
|
@save-state="pushToUndoStack"
|
|
15
16
|
@clearSelection="clearSelection"
|
|
16
17
|
/>
|
|
@@ -314,6 +315,9 @@ export default {
|
|
|
314
315
|
clonedNode.diagram.bounds.y += yOffset;
|
|
315
316
|
this.addNode(clonedNode);
|
|
316
317
|
},
|
|
318
|
+
async close() {
|
|
319
|
+
this.$emit('close');
|
|
320
|
+
},
|
|
317
321
|
async saveBpmn() {
|
|
318
322
|
const svg = document.querySelector('.mini-paper svg');
|
|
319
323
|
const css = 'text { font-family: sans-serif; }';
|
|
@@ -975,6 +979,18 @@ export default {
|
|
|
975
979
|
this.previouslyStackedShape = shape;
|
|
976
980
|
this.paperManager.performAtomicAction(() => ensureShapeIsNotCovered(shape, this.graph));
|
|
977
981
|
},
|
|
982
|
+
showSavedNotification() {
|
|
983
|
+
undoRedoStore.dispatch('saved');
|
|
984
|
+
},
|
|
985
|
+
enableVersions() {
|
|
986
|
+
undoRedoStore.dispatch('enableVersions');
|
|
987
|
+
},
|
|
988
|
+
setVersionIndicator(isDraft) {
|
|
989
|
+
undoRedoStore.dispatch('setVersionIndicator', isDraft);
|
|
990
|
+
},
|
|
991
|
+
setLoadingState(isLoading) {
|
|
992
|
+
undoRedoStore.dispatch('setLoadingState', isLoading);
|
|
993
|
+
},
|
|
978
994
|
clearSelection(){
|
|
979
995
|
this.$refs.selector.clearSelection();
|
|
980
996
|
},
|
|
@@ -85,23 +85,61 @@
|
|
|
85
85
|
<font-awesome-icon :icon="miniMapOpen ? minusIcon : mapIcon" />
|
|
86
86
|
</b-button>
|
|
87
87
|
</div>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
<div class="btn-group btn-group-sm" role="group" aria-label="Publish controls">
|
|
89
|
+
<template v-if="isVersionsInstalled">
|
|
90
|
+
<div class="d-flex justify-content-center align-items-center text-black text-capitalize" :style="{ width: '65px' }">
|
|
91
|
+
<span class="toolbar-item mr-1" :style="{ fontWeight: 600 }">
|
|
92
|
+
{{ versionStatus }}
|
|
93
|
+
</span>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="d-flex justify-content-center align-items-center text-black text-capitalize mx-2" :style="{ width: '60px' }">
|
|
96
|
+
<span class="toolbar-item mr-1" :style="{ fontWeight: 400 }">
|
|
97
|
+
{{ loadingStatus }}
|
|
98
|
+
</span>
|
|
99
|
+
<span>
|
|
100
|
+
<font-awesome-icon class="text-success" :icon="loadingIcon" :spin="isLoading" />
|
|
101
|
+
</span>
|
|
102
|
+
</div>
|
|
103
|
+
<a
|
|
104
|
+
class="btn btn-sm btn-primary mini-map-btn text-uppercase mx-2"
|
|
105
|
+
data-test="publish-btn"
|
|
106
|
+
:title="$t('Publish')"
|
|
107
|
+
@click="$emit('saveBpmn')"
|
|
108
|
+
>
|
|
109
|
+
{{ $t('Publish') }}
|
|
110
|
+
</a>
|
|
111
|
+
<a
|
|
112
|
+
class="btn btn-sm btn-link toolbar-item mini-map-btn text-black text-uppercase"
|
|
113
|
+
data-test="close-btn"
|
|
114
|
+
:title="$t('Close')"
|
|
115
|
+
@click="$emit('close')"
|
|
116
|
+
>
|
|
117
|
+
{{ $t('Close') }}
|
|
118
|
+
</a>
|
|
119
|
+
<EllipsisMenu
|
|
120
|
+
@navigate="onNavigate"
|
|
121
|
+
:actions="ellipsisMenuActions"
|
|
122
|
+
:divider="false"
|
|
123
|
+
/>
|
|
124
|
+
</template>
|
|
125
|
+
<b-button
|
|
126
|
+
v-else
|
|
127
|
+
class="btn btn-sm btn-secondary mini-map-btn mx-1"
|
|
128
|
+
data-test="mini-map-btn"
|
|
129
|
+
v-b-tooltip.hover
|
|
130
|
+
:title="$t('Save')"
|
|
131
|
+
@click="$emit('saveBpmn')"
|
|
132
|
+
>
|
|
133
|
+
<font-awesome-icon :icon="saveIcon" />
|
|
134
|
+
</b-button>
|
|
135
|
+
</div>
|
|
98
136
|
</div>
|
|
99
137
|
</div>
|
|
100
138
|
</b-row>
|
|
101
139
|
</template>
|
|
102
140
|
<script>
|
|
103
141
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
104
|
-
import { faCompress, faExpand, faMapMarked, faMinus, faPlus, faRedo, faSave,
|
|
142
|
+
import { faCompress, faExpand, faMapMarked, faMinus, faPlus, faRedo, faUndo, faSave, faCheckCircle, faSpinner } from '@fortawesome/free-solid-svg-icons';
|
|
105
143
|
import undoRedoStore from '@/undoRedoStore';
|
|
106
144
|
import Breadcrumb from '@/components/toolbar/breadcrumb/Breadcrumb';
|
|
107
145
|
import AlignButtons from '@/components/toolbar/alignButtons/AlignButtons';
|
|
@@ -143,6 +181,26 @@ export default {
|
|
|
143
181
|
canRedo() {
|
|
144
182
|
return undoRedoStore.getters.canRedo;
|
|
145
183
|
},
|
|
184
|
+
saved() {
|
|
185
|
+
return undoRedoStore.getters.saved;
|
|
186
|
+
},
|
|
187
|
+
versionStatus() {
|
|
188
|
+
const status = undoRedoStore.getters.isDraft ? 'Draft' : 'Published';
|
|
189
|
+
return this.$t(status);
|
|
190
|
+
},
|
|
191
|
+
isVersionsInstalled() {
|
|
192
|
+
return undoRedoStore.getters.isVersionsInstalled;
|
|
193
|
+
},
|
|
194
|
+
isLoading() {
|
|
195
|
+
return undoRedoStore.getters.isLoading;
|
|
196
|
+
},
|
|
197
|
+
loadingStatus() {
|
|
198
|
+
const status = this.isLoading ? 'Saving' : 'Saved';
|
|
199
|
+
return this.$t(status);
|
|
200
|
+
},
|
|
201
|
+
loadingIcon() {
|
|
202
|
+
return this.isLoading ? this.spinner : this.savedIcon;
|
|
203
|
+
},
|
|
146
204
|
},
|
|
147
205
|
data() {
|
|
148
206
|
return {
|
|
@@ -159,6 +217,15 @@ export default {
|
|
|
159
217
|
undoIcon: faUndo,
|
|
160
218
|
redoIcon: faRedo,
|
|
161
219
|
saveIcon: faSave,
|
|
220
|
+
savedIcon: faCheckCircle,
|
|
221
|
+
spinner: faSpinner,
|
|
222
|
+
ellipsisMenuActions: [
|
|
223
|
+
{
|
|
224
|
+
value: 'discard-draft',
|
|
225
|
+
content: this.$t('Discard Draft'),
|
|
226
|
+
icon: '',
|
|
227
|
+
},
|
|
228
|
+
],
|
|
162
229
|
};
|
|
163
230
|
},
|
|
164
231
|
methods: {
|
|
@@ -182,6 +249,15 @@ export default {
|
|
|
182
249
|
.then(() => this.$emit('load-xml'))
|
|
183
250
|
.then(() => window.ProcessMaker.EventBus.$emit('modeler-change'));
|
|
184
251
|
},
|
|
252
|
+
onNavigate(action) {
|
|
253
|
+
switch (action.value) {
|
|
254
|
+
case 'discard-draft':
|
|
255
|
+
window.ProcessMaker.EventBus.$emit('open-versions-discard-modal');
|
|
256
|
+
break;
|
|
257
|
+
default:
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
},
|
|
185
261
|
},
|
|
186
262
|
};
|
|
187
263
|
</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$toolbar-background-color: #
|
|
1
|
+
$toolbar-background-color: #fff;
|
|
2
2
|
|
|
3
3
|
.toolbar {
|
|
4
4
|
z-index: 2;
|
|
@@ -11,3 +11,19 @@ $toolbar-background-color: #FFF;
|
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
.toolbar-item {
|
|
16
|
+
font-family: "Open Sans";
|
|
17
|
+
font-style: normal;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
letter-spacing: -0.02em;
|
|
20
|
+
line-height: 21px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text-black {
|
|
24
|
+
color: #000000 !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cursor-default {
|
|
28
|
+
cursor: default !important;
|
|
29
|
+
}
|
package/src/undoRedoStore.js
CHANGED
|
@@ -8,6 +8,10 @@ export default new Vuex.Store({
|
|
|
8
8
|
stack: [],
|
|
9
9
|
position: null,
|
|
10
10
|
disabled: false,
|
|
11
|
+
saved: false,
|
|
12
|
+
isVersionsInstalled: false,
|
|
13
|
+
isDraft: false,
|
|
14
|
+
isLoading: false,
|
|
11
15
|
},
|
|
12
16
|
getters: {
|
|
13
17
|
canUndo(state) {
|
|
@@ -19,6 +23,18 @@ export default new Vuex.Store({
|
|
|
19
23
|
currentState(state) {
|
|
20
24
|
return state.stack[state.position];
|
|
21
25
|
},
|
|
26
|
+
saved(state) {
|
|
27
|
+
return state.saved;
|
|
28
|
+
},
|
|
29
|
+
isVersionsInstalled(state) {
|
|
30
|
+
return state.isVersionsInstalled;
|
|
31
|
+
},
|
|
32
|
+
isDraft(state) {
|
|
33
|
+
return state.isDraft;
|
|
34
|
+
},
|
|
35
|
+
isLoading(state) {
|
|
36
|
+
return state.isLoading;
|
|
37
|
+
},
|
|
22
38
|
},
|
|
23
39
|
mutations: {
|
|
24
40
|
setPosition(state, position) {
|
|
@@ -37,6 +53,18 @@ export default new Vuex.Store({
|
|
|
37
53
|
enableSavingState(state) {
|
|
38
54
|
state.disabled = false;
|
|
39
55
|
},
|
|
56
|
+
savedState(state, payload) {
|
|
57
|
+
state.saved = payload;
|
|
58
|
+
},
|
|
59
|
+
isVersionsInstalled(state, payload) {
|
|
60
|
+
state.isVersionsInstalled = payload;
|
|
61
|
+
},
|
|
62
|
+
isDraft(state, payload) {
|
|
63
|
+
state.isDraft = payload;
|
|
64
|
+
},
|
|
65
|
+
isLoading(state, payload) {
|
|
66
|
+
state.isLoading = payload;
|
|
67
|
+
},
|
|
40
68
|
},
|
|
41
69
|
actions: {
|
|
42
70
|
pushState({ state, getters, commit }, newState) {
|
|
@@ -61,5 +89,22 @@ export default new Vuex.Store({
|
|
|
61
89
|
|
|
62
90
|
commit('setPosition', state.position + 1);
|
|
63
91
|
},
|
|
92
|
+
saved({ commit }) {
|
|
93
|
+
commit('savedState', true);
|
|
94
|
+
|
|
95
|
+
// Automatically remove the notification after 2 seconds.
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
commit('savedState', false);
|
|
98
|
+
}, 2000);
|
|
99
|
+
},
|
|
100
|
+
enableVersions({ commit }) {
|
|
101
|
+
commit('isVersionsInstalled', true);
|
|
102
|
+
},
|
|
103
|
+
setVersionIndicator({ commit }, newState) {
|
|
104
|
+
commit('isDraft', newState);
|
|
105
|
+
},
|
|
106
|
+
setLoadingState({ commit }, newState) {
|
|
107
|
+
commit('isLoading', newState);
|
|
108
|
+
},
|
|
64
109
|
},
|
|
65
110
|
});
|