Skip to content

Commit

Permalink
change history on invocation success without reloading
Browse files Browse the repository at this point in the history
Also, change the `href` for multiview in this view to a <router-link> (to prevent reload).
  • Loading branch information
ahmedhamidawan committed Apr 26, 2024
1 parent 33f0645 commit 0d9fd32
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions client/src/components/Workflow/Run/WorkflowRunSuccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

<p v-if="multipleHistoryTargets">
This workflow will generate results in multiple histories. You can observe progress in the
<a :href="multiHistoryView">history multi-view</a>.
<router-link to="/histories/view_multiple">history multi-view</router-link>.
</p>
<p v-else-if="wasNewHistoryTarget">
This workflow will generate results in a new history.
<a class="workflow-new-history-target-link" :href="newHistoryTarget">Switch to that history now</a>.
<a class="workflow-new-history-target-link" href="javascript:void(0)" @click="switchHistory"
>Switch to that history now</a
>.
</p>
<p v-else>You can check the status of queued jobs and view the resulting data the History panel.</p>
<p>
Expand All @@ -33,7 +35,7 @@
<script>
import WorkflowInvocationState from "components/WorkflowInvocationState/WorkflowInvocationState";
import { getAppRoot } from "onload/loadConfig";
import { mapState } from "pinia";
import { mapActions, mapState } from "pinia";
import { refreshContentsWrapper } from "utils/data";
import Webhooks from "utils/webhooks";
Expand Down Expand Up @@ -75,9 +77,6 @@ export default {
multiHistoryView() {
return `${getAppRoot()}histories/view_multiple`;
},
newHistoryTarget() {
return `${getAppRoot()}history/switch_to_history?hist_id=${this.invocations[0].history_id}`;
},
wasNewHistoryTarget() {
if (this.invocations.length < 1) {
return false;
Expand All @@ -93,5 +92,11 @@ export default {
});
refreshContentsWrapper();
},
methods: {
...mapActions(useHistoryStore, ["setCurrentHistory"]),
async switchHistory() {
await this.setCurrentHistory(this.invocations[0].history_id);
},
},
};
</script>

0 comments on commit 0d9fd32

Please sign in to comment.