Skip to content

Commit

Permalink
Merge pull request #18657 from ahmedhamidawan/improve_wf_save_ux
Browse files Browse the repository at this point in the history
[24.0] Improve workflow creating/saving UX
  • Loading branch information
mvdbeek authored Aug 8, 2024
2 parents c3738ad + 76cbfbe commit 6a7a889
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 6 additions & 4 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
<div class="unified-panel-header" unselectable="on">
<div class="unified-panel-header-inner">
<span class="sr-only">Workflow Editor</span>
<span v-if="!isNewTempWorkflow || name">{{ name }}</span>
<i v-else>Create New Workflow</i>
<span>
{{ name || "..." }}
<i v-if="hasChanges" class="text-muted"> (unsaved changes) </i>
</span>
</div>
</div>
<WorkflowGraph
Expand Down Expand Up @@ -389,12 +391,12 @@ export default {
}
},
annotation(newAnnotation, oldAnnotation) {
if (newAnnotation != oldAnnotation && !this.isNewTempWorkflow) {
if (newAnnotation != oldAnnotation) {
this.hasChanges = true;
}
},
name(newName, oldName) {
if (newName != oldName && !this.isNewTempWorkflow) {
if (newName != oldName) {
this.hasChanges = true;
}
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Workflow/Editor/Options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { confirm } = useConfirmDialog();
const saveHover = computed(() => {
if (props.isNewTempWorkflow) {
return "Create a new workflow";
return "Save Workflow";
} else if (!props.hasChanges) {
return "Workflow has no changes";
} else if (props.hasInvalidConnections) {
Expand Down Expand Up @@ -81,7 +81,7 @@ async function onSave() {
<BButton
id="workflow-save-button"
role="button"
variant="link"
:variant="isNewTempWorkflow ? 'primary' : 'link'"
aria-label="Save Workflow"
class="editor-button-save"
:disabled="!isNewTempWorkflow && !hasChanges"
Expand Down
16 changes: 15 additions & 1 deletion client/src/entry/analysis/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { getAppRoot } from "onload";
import { storeToRefs } from "pinia";
import { withPrefix } from "utils/redirect";
import { ref, watch } from "vue";
import { useRoute } from "vue-router/composables";
import short from "@/components/plugins/short";
import { useRouteQueryBool } from "@/composables/route";
Expand Down Expand Up @@ -116,7 +117,21 @@ export default {
{ immediate: true }
);
const confirmation = ref(null);
const route = useRoute();
watch(
() => route.fullPath,
(newVal, oldVal) => {
// sometimes, the confirmation is not cleared when the route changes
// and the confirmation alert is shown needlessly
if (confirmation.value) {
confirmation.value = null;
}
}
);
return {
confirmation,
toastRef,
confirmDialogRef,
uploadModal,
Expand All @@ -128,7 +143,6 @@ export default {
data() {
return {
config: getGalaxyInstance().config,
confirmation: null,
resendUrl: `${getAppRoot()}user/resend_verification`,
windowManager: null,
};
Expand Down

0 comments on commit 6a7a889

Please sign in to comment.