Skip to content

Commit

Permalink
Fixes/enhancements to simplified workflow landing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 6, 2024
1 parent 9dfde30 commit af1a0da
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 41 deletions.
2 changes: 1 addition & 1 deletion client/src/components/ActivityBar/ActivityBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function onToggleSidebar(toggle: string = "", to: string | null = null) {
const syncActivities = () => {
activityStore.sync();
if (config.value && config.value.client_mode == "minimal_workflow") {
if (config.value && ["workflow_centric", "workflow_runner"].indexOf(config.value.client_mode) >= 0) {
userStore.untoggleToolbarIfNeeded();
}
};
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/Workflow/List/WorkflowCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ interface Props {
workflow: any;
gridView?: boolean;
publishedView?: boolean;
allowWorkflowManagement?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
gridView: false,
publishedView: false,
allowWorkflowManagement: true,
});
const emit = defineEmits<{
Expand Down Expand Up @@ -134,6 +136,7 @@ async function onTagClick(tag: string) {
<WorkflowActions
:workflow="workflow"
:published="publishedView"
:allow-workflow-management="allowWorkflowManagement"
@refreshList="emit('refreshList', true)"
@toggleShowPreview="toggleShowPreview" />
</div>
Expand Down Expand Up @@ -185,7 +188,7 @@ async function onTagClick(tag: string) {

<div class="workflow-edit-run-buttons">
<BButton
v-if="!isAnonymous && !shared"
v-if="!isAnonymous && !shared && allowWorkflowManagement"
v-b-tooltip.hover.noninteractive
:disabled="workflow.deleted"
size="sm"
Expand All @@ -198,7 +201,7 @@ async function onTagClick(tag: string) {
</BButton>

<AsyncButton
v-else
v-else-if="allowWorkflowManagement"
v-b-tooltip.hover.noninteractive
size="sm"
:disabled="isAnonymous"
Expand Down
13 changes: 7 additions & 6 deletions client/src/components/Workflow/List/WorkflowList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ type WorkflowsList = Record<string, never>[];
interface Props {
activeList?: "my" | "shared_with_me" | "published";
advancedOptions?: boolean;
clientMode?: "full" | "workflow_centric" | "workflow_runner";
initialFilterText?: string;
}
const props = withDefaults(defineProps<Props>(), {
activeList: "my",
advancedOptions: true,
clientMode: "full",
initialFilterText: "",
});
Expand Down Expand Up @@ -89,6 +89,7 @@ const validFilters = computed(() => workflowFilters.value.getValidFilters(rawFil
const invalidFilters = computed(() => workflowFilters.value.getValidFilters(rawFilters.value, true).invalidFilters);
const isSurroundedByQuotes = computed(() => /^["'].*["']$/.test(filterText.value));
const hasInvalidFilters = computed(() => !isSurroundedByQuotes.value && Object.keys(invalidFilters.value).length > 0);
const allowWorkflowManagement = computed(() => props.clientMode == "full");
function updateFilterValue(filterKey: string, newValue: any) {
const currentFilterText = filterText.value;
Expand Down Expand Up @@ -222,18 +223,17 @@ onMounted(() => {
<div class="d-flex flex-gapx-1">
<Heading h1 separator inline size="xl" class="flex-grow-1 mb-2">Workflows</Heading>

<WorkflowListActions :advanced-options="advancedOptions" />
<WorkflowListActions v-if="allowWorkflowManagement" />
</div>

<BNav pills justified class="mb-2">
<BNav pills justified class="mb-2" v-if="allowWorkflowManagement">

Check failure on line 229 in client/src/components/Workflow/List/WorkflowList.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Attribute "v-if" should go before "class"
<BNavItem id="my" :active="activeList === 'my'" :disabled="userStore.isAnonymous" to="/workflows/list">
My workflows
<LoginRequired v-if="userStore.isAnonymous" target="my" title="Manage your workflows" />
</BNavItem>

<BNavItem
id="shared-with-me"
v-if="advancedOptions"
:active="sharedWithMe"
:disabled="userStore.isAnonymous"
to="/workflows/list_shared_with_me">
Expand Down Expand Up @@ -262,7 +262,7 @@ onMounted(() => {
</template>
</FilterMenu>

<ListHeader ref="listHeader" :show-view-toggle="advancedOptions">
<ListHeader ref="listHeader" :show-view-toggle="allowWorkflowManagement">
<template v-slot:extra-filter>
<div v-if="activeList === 'my'">
Filter:
Expand Down Expand Up @@ -346,6 +346,7 @@ onMounted(() => {
:published-view="published"
:grid-view="view === 'grid'"
:class="view === 'grid' ? 'grid-view' : 'list-view'"
:allow-workflow-management="allowWorkflowManagement"
@refreshList="load"
@tagClick="(tag) => updateFilterValue('tag', `'${tag}'`)"
@update-filter="updateFilterValue" />
Expand Down
5 changes: 0 additions & 5 deletions client/src/entry/analysis/modules/Analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ const showHistoryPanel = computed(() => {
return showPanels.value && config.value && config.value.client_mode == "full";
});
const showWorkflowCenter = computed(() => {
console.log(config.value && config.value.client_mode);
return config.value && config.value.client_mode == "minimal_workflow";
});
// methods
function hideCenter() {
showCenter.value = false;
Expand Down
8 changes: 4 additions & 4 deletions client/src/entry/analysis/modules/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<ToolForm v-if="isTool && !isUpload" v-bind="toolParams" />
<WorkflowRun v-else-if="isWorkflow" v-bind="workflowParams" />
<div v-else-if="isController" :src="controllerParams" />
<div v-else-if="isWorkflowLanding">
<WorkflowLanding initial-filter-text="config.simplified_workflow_landing_initial_tags" />
<div v-else-if="isWorkflowCentric">
<WorkflowLanding :client-mode="config.client_mode" :initial-filter-text="config.simplified_workflow_landing_initial_filter_text" />
</div>
<CenterFrame v-else src="/welcome" />
</div>
Expand Down Expand Up @@ -35,8 +35,8 @@ export default {
},
},
computed: {
isWorkflowLanding() {
return this.config.client_mode == "minimal_workflow";
isWorkflowCentric() {
return ["workflow_centric", "workflow_runner"].indexOf(this.config.client_mode) >= 0;
},
isController() {
return this.query.m_c && this.query.m_a;
Expand Down
5 changes: 4 additions & 1 deletion client/src/entry/analysis/modules/WorkflowLanding.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script setup lang="ts">
interface Props {
initialFilterText: string;
clientMode: string;
}
defineProps<Props>()
import WorkflowList from "@/components/Workflow/WorkflowList.vue";

Check failure on line 9 in client/src/entry/analysis/modules/WorkflowLanding.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Import in body of module; reorder to top
</script>

<template>
<div>
<WorkflowList active-list="published" :advanced-options="false" :initial-filter-text="initialFilterText" />
<WorkflowList active-list="published" :client-mode="clientMode" :initial-filter-text="initialFilterText" />
</div>
</template>
42 changes: 27 additions & 15 deletions client/src/stores/activitySetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@
import { type ClientMode, type Activity, type RawActivity } from "@/stores/activityStore";

Check failure on line 4 in client/src/stores/activitySetup.ts

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Run autofix to sort these imports!
import { type EventData } from "@/stores/eventStore";

function unlessMinimalWorkflow(clientMode: ClientMode): boolean {
return !(clientMode == "minimal_workflow");
function isWorkflowCentric(clientMode: ClientMode) : boolean {
return ["workflow_centric", "workflow_runner"].indexOf(clientMode) >= 0;
}

function ifMinimalWorkflow(clientMode: ClientMode): boolean {
return !(clientMode == "minimal_workflow");
function unlessWorkflowCentric(clientMode: ClientMode): boolean {
if (isWorkflowCentric(clientMode)) {
return false;
} else {
return true;
}
}

function ifWorkflowCentric(clientMode: ClientMode): boolean {
if (isWorkflowCentric(clientMode)) {
return true;
} else {
return false;
}
}

export const ActivitiesRaw: RawActivity[] = [
Expand All @@ -19,38 +31,38 @@ export const ActivitiesRaw: RawActivity[] = [
icon: "fa-laptop",
id: "interactivetools",
mutable: false,
optional: ifMinimalWorkflow,
optional: ifWorkflowCentric,
panel: false,
title: "Interactive Tools",
tooltip: "Show active interactive tools",
to: "/interactivetool_entry_points/list",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: true,
description: "Opens a data dialog, allowing uploads from URL, pasted content or disk.",
icon: "upload",
id: "upload",
mutable: false,
optional: ifMinimalWorkflow,
optional: ifWorkflowCentric,
panel: false,
title: "Upload",
to: null,
tooltip: "Download from URL or upload files from disk",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: true,
description: "Displays the tool panel to search and access all available tools.",
icon: "wrench",
id: "tools",
mutable: false,
optional: ifMinimalWorkflow,
optional: ifWorkflowCentric,
panel: true,
title: "Tools",
to: "/tools",
tooltip: "Search and run tools",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: true,
Expand Down Expand Up @@ -89,7 +101,7 @@ export const ActivitiesRaw: RawActivity[] = [
title: "Visualization",
to: null,
tooltip: "Visualize datasets",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: true,
Expand All @@ -102,7 +114,7 @@ export const ActivitiesRaw: RawActivity[] = [
title: "Histories",
tooltip: "Show all histories",
to: "/histories/list",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: false,
Expand All @@ -115,7 +127,7 @@ export const ActivitiesRaw: RawActivity[] = [
title: "History Multiview",
tooltip: "Select histories to show in History Multiview",
to: "/histories/view_multiple",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: false,
Expand All @@ -128,7 +140,7 @@ export const ActivitiesRaw: RawActivity[] = [
title: "Datasets",
tooltip: "Show all datasets",
to: "/datasets/list",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: true,
Expand All @@ -141,7 +153,7 @@ export const ActivitiesRaw: RawActivity[] = [
title: "Pages",
tooltip: "Show all pages",
to: "/pages/list",
visible: unlessMinimalWorkflow,
visible: unlessWorkflowCentric,
},
{
anonymous: false,
Expand Down
2 changes: 1 addition & 1 deletion client/src/stores/activityStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface Activity {
visible: boolean;
}

export type ClientMode = "full" | "minimal_workflow";
export type ClientMode = "full" | "workflow_centric" | "workflow_runner";

// config materializes a RawActivity into an Activity
export interface RawActivity {
Expand Down
20 changes: 15 additions & 5 deletions lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3137,20 +3137,30 @@ mapping:
client_mode:
type: str
default: 'full'
enum: ['full', 'minimal_workflow']
enum: ['full', 'workflow_centric', 'workflow_runner']
required: false
per_host: true
desc: |
Set this to 'minimal_workflow' to turn on the simplified Galaxy workflow
UI.
This will change the modality and focus on the client UI. The traditional
full Galaxy with default activity bar is the default of 'full'.
'workflow_centric' & 'workflow_runner' yield client applications
that are geared to center a collection of workflows in Galaxy and attempts
to hide the concept of histories from users. The 'workflow_centric' view
still allows the user to manage & edit a collection of their own workflows.
'workflow_runner' is a mode that disables workflow management to even further
simplify the UI - this may be appropriate for instances that really just want
enable particular workflows as-is.
simplified_workflow_landing_initial_tags:
simplified_workflow_landing_initial_filter_text:
type: str
default: null
required: false
per_host: true
desc: |
I will write this in later.
If the Galaxy client is in 'workflow_centric' or 'workflow_runner' "client mode",
this controls the initial filtering of the workflow search textbox. This can
be used to foreground workflows in the published workflow list by tar (e.g. 'tag:XXX')
or username (e.g. 'username:XXXX').
simplified_workflow_run_ui:
type: str
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _config_is_truthy(item, key, **context):
"enable_beta_markdown_export": _use_config,
"enable_beacon_integration": _use_config,
"client_mode": _use_config,
"simplified_workflow_landing_initial_tags": _use_config,
"simplified_workflow_landing_initial_filter_text": _use_config,
"simplified_workflow_run_ui": _use_config,
"simplified_workflow_run_ui_target_history": _use_config,
"simplified_workflow_run_ui_job_cache": _use_config,
Expand Down

0 comments on commit af1a0da

Please sign in to comment.