Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observation/FOUR-13274: Improve assets assignment without need of reload page #1783

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/inspectors/InspectorPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export default {
'highlightedNode.definition.assignmentRules'(current, previous) { this.handleAssignmentChanges(current, previous); },
'highlightedNode.definition.allowInterstitial'(current, previous) { this.handleAssignmentChanges(current, previous); },
'highlightedNode.definition.interstitialScreenRef'(current, previous) { this.handleAssignmentChanges(current, previous); },
'highlightedNode.definition.screenRef'(current, previous) { this.handleAssignmentChanges(current, previous); },
'highlightedNode.definition.scriptRef'(current, previous) { this.handleAssignmentChanges(current, previous); },
},
computed: {
inspectorHeaderTitle() {
Expand Down
29 changes: 26 additions & 3 deletions src/components/modeler/Modeler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@
}
},
registerStatusBar(component) {
this.owner.validationBar.push(component);

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (0)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (0)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (4)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (4)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (5)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (5)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (10)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (10)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (3)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (3)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (7)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (7)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (1)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (1)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (6)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (6)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (8)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (8)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (2)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (2)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (9)

Unexpected mutation of "owner" prop

Check warning on line 986 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / ci (9)

Unexpected mutation of "owner" prop
},
/**
* Register a mixin into a node component.
Expand Down Expand Up @@ -2215,9 +2215,8 @@
streamCompletedEvent,
(response) => {
if (response.data) {
setTimeout(() => {
window.location.replace(window.location.href.split('?')[0]);
}, 1500);
this.updateScreenRefs(response.data.screenIds);
this.updateScriptRefs(response.data.scriptIds);
}
},
);
Expand All @@ -2241,6 +2240,30 @@
this.loadingAI = false;
}
},
updateScreenRefs(elements) {
elements.forEach(el => {
const node = this.nodes.find(n => n.definition.id === el.node_id);
let definition = node.definition;

if (node.type === 'processmaker-modeler-task') {
definition.screenRef = el.screen_id;
store.commit('updateNodeProp', { node, key: 'definition', value: definition });
this.$emit('save-state');
}
});
},
updateScriptRefs(elements) {
elements.forEach(el => {
const node = this.nodes.find(n => n.definition.id === el.node_id);
let definition = node.definition;

if (node.type === 'processmaker-modeler-script-task') {
definition.scriptRef = el.script_id;
store.commit('updateNodeProp', { node, key: 'definition', value: definition });
this.$emit('save-state');
}
});
},
},
created() {
if (runningInCypressTest()) {
Expand Down
Loading