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

[24.0] Improve workflow creating/saving UX #18657

Merged
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
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
Loading