Skip to content

Commit

Permalink
fix to restore and support standalone again
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Quelca committed Oct 18, 2023
1 parent 7892f98 commit 8b436cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nodeTypesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default new Vuex.Store({
},
actions: {
getUserPinnedObjects({ commit }) {
if (!window.ProcessMaker.user) {
if (window.ProcessMaker?.user?.id === 'standalone') {
// For standalone version of Modeler
const pinnedNodes = localStorage.pinnedNodes ? JSON.parse(localStorage.pinnedNodes) : [] ;
pinnedNodes.forEach(node => {
Expand All @@ -137,7 +137,7 @@ export default new Vuex.Store({
addUserPinnedObject({ commit, state }, pinnedNode) {
commit('setPinnedNodes', pinnedNode);
const pinnedNodes = state.pinnedNodeTypes;
if (!window.ProcessMaker.user) {
if (window.ProcessMaker?.user?.id === 'standalone') {
// For standalone version of Modeler
localStorage.pinnedNodes = JSON.stringify(pinnedNodes);
return;
Expand All @@ -152,7 +152,7 @@ export default new Vuex.Store({
removeUserPinnedObject({ commit, state }, nodeToUnpin) {
commit('setUnpinNode', nodeToUnpin);
const pinnedNodes = state.pinnedNodeTypes;
if (!window.ProcessMaker.user) {
if (window.ProcessMaker?.user?.id === 'standalone') {
// For standalone version of Modeler
localStorage.pinnedNodes = JSON.stringify(pinnedNodes);
return;
Expand Down
6 changes: 6 additions & 0 deletions src/setup/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import MockAdapter from 'axios-mock-adapter';
import mockProcesses from './mockProcesses.json';
import mockSignals from './mockSignals.json';
import mockProcessSvg from './mockProcessSvg';
import { faker } from '@faker-js/faker';

axios.defaults.baseURL = 'https://bpm4.local.processmaker.com/api/1.0/';
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Expand Down Expand Up @@ -57,5 +58,10 @@ window.ProcessMaker = {
id: 1,
},
},
user: {
id: 'standalone',
fullName: faker.person.fullName(),
avatar: null,
},

};

0 comments on commit 8b436cd

Please sign in to comment.