Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f068189
Rewrite modal wrapper without backbone
guerler Oct 10, 2025
0d5fae7
Remove container option, always attach to body but just once
guerler Oct 10, 2025
d6ece66
Add a modal utility without backbone and jquery
guerler Oct 10, 2025
34515a8
Migrate to update modal module
guerler Oct 10, 2025
a3e538a
Remove backbone/jquery modal, remove global modal from galaxy object
guerler Oct 10, 2025
2276f2d
Remove legacy modal import from app
guerler Oct 10, 2025
13f71fb
Fix import order, avoid console error in libraries if user is not ava…
guerler Oct 10, 2025
a98c18b
Fix linting
guerler Oct 10, 2025
d0fa39e
Simplify usage, fix button disable condition
guerler Oct 10, 2025
699a520
Refactor modal module, remove unused options
guerler Oct 11, 2025
49bf0a3
Remove more unused options, refactor backdrop event disposal
guerler Oct 11, 2025
56687b4
Remove unused closing callback option
guerler Oct 11, 2025
c4d0fe7
Refactor rule collection build modal interface
guerler Oct 11, 2025
cd09fbc
Update comment
guerler Oct 11, 2025
8d2972f
Update collection modal unit test
guerler Oct 11, 2025
dbad8bc
Switch test decorator
guerler Oct 13, 2025
3d713bf
Properly close collection dialog when clicking continue
guerler Oct 13, 2025
a953f31
Linting
guerler Oct 13, 2025
96e8832
Remove loading indicator and highlight
guerler Oct 14, 2025
8d72c92
Remove legacy ies helper
guerler Oct 14, 2025
46401ad
Fix lint
guerler Oct 14, 2025
1a70e67
Drop transition in modal module
guerler Oct 15, 2025
2188518
Consolidate rule builder modal wrapper
guerler Oct 15, 2025
ecaee8b
Remove jquery from rule builder promises
guerler Oct 15, 2025
76d73e4
Remove unused legacy jquery variant model from workflow editor
guerler Oct 15, 2025
1769ae0
Remove legacy modal use from page editor
guerler Oct 15, 2025
8e0141c
Remove second legacy jquery modal
guerler Oct 15, 2025
e7608d4
No need to show modal in legacy tagging mako
guerler Oct 15, 2025
8bb6bd2
Move window-manager, rename storage route module for consistency
guerler Oct 15, 2025
c483441
Update window-manager path in test, adjust for missing hid in collect…
guerler Oct 15, 2025
b2b650c
Remove unused dependency
guerler Oct 15, 2025
bc3eda4
Fix lint
guerler Oct 15, 2025
1ddf054
Move dataset states to utilities, remove unused backbone dataset models
guerler Oct 15, 2025
a9da583
Linting
guerler Oct 15, 2025
97af8b7
Remove unused bundleEntries exports, verified via grep on the templat…
guerler Oct 15, 2025
d731e25
Remove unused ajax-queue
guerler Oct 15, 2025
d2584d3
Remove legacy onload plugins
guerler Oct 15, 2025
dfc26f2
Linting
guerler Oct 15, 2025
23f9d8d
Remove unused jquery rating css
guerler Oct 15, 2025
0c5c513
Remove refresh handler from legacy grid module used only by reports
guerler Oct 15, 2025
668d9e0
Remove legacy grids used in reports
guerler Oct 16, 2025
fa512a0
Remove reports client utilities
guerler Oct 16, 2025
94503e6
Remove Reports makos
guerler Oct 16, 2025
892e440
Remove legacy grid makos
guerler Oct 16, 2025
f6c771b
Remove tool shed rating mako
guerler Oct 16, 2025
aec0db0
Remove reports starter script
guerler Oct 16, 2025
63d98a7
Remove reports app
guerler Oct 16, 2025
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
22 changes: 6 additions & 16 deletions client/src/bundleEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,12 @@
* to exist until such time as we replace the overall application with a Vue component which
* will handle initializations for components individually.
*
* legacy/grid_base.mako: window.bundleEntries.LegacyGridView
* webapps/galaxy/dataset/tabular_chunked.mako: window.bundleEntries.createTabularDatasetChunkedView
* webapps/galaxy/dataset/display.mako: window.bundleEntries.createTabularDatasetChunkedView
* webapps/reports/run_stats.mako: window.bundleEntries.create_chart
* webapps/reports/run_stats.mako: window.bundleEntries.create_histogram
* tagging_common.mako: show_in_overlay
*/
import { replaceChildrenWithComponent } from "utils/mountVueComponent";

export { getGalaxyInstance, setGalaxyInstance } from "app";
export { default as LegacyGridView } from "legacy/grid/grid-view";
export { createTabularDatasetChunkedView } from "mvc/dataset/data";
export { create_chart, create_histogram } from "reports/run_stats";
export { Toast } from "ui/toast"; // TODO: remove when external consumers are updated/gone (IES right now)
import TabularChunkedView from "components/Visualizations/Tabular/TabularChunkedView.vue";

// Previously wandering around as window.thing = thing in the onload script
export { show_in_overlay } from "layout/modal";

// Used in common.mako
export { default as store } from "storemodern";
// webapps/galaxy/dataset/{ display | tabular_chunked }.mako
export const createTabularDatasetChunkedView = (options) => {
return replaceChildrenWithComponent(options.parent_elt, TabularChunkedView, { options });
};
2 changes: 0 additions & 2 deletions client/src/components/Collections/ListCollectionCreator.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import "ui/hoverhighlight";

import { faSquare } from "@fortawesome/free-regular-svg-icons";
import { faMinus, faSortAlphaDown, faTimes, faUndo } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
Expand Down
112 changes: 67 additions & 45 deletions client/src/components/Collections/RuleBasedCollectionCreatorModal.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,78 @@
import _l from "utils/localization";
import Modal from "utils/modal";
import Vue from "vue";

import { rawToTable } from "@/components/Collections/tables";

import { collectionCreatorModalSetup } from "./common/modal";
const modal = new Modal();

function ruleBasedCollectionCreatorModal(elements, elementsType, importType, options) {
async function ruleBasedCollectionCreatorModal(elements, elementsType, importType, options) {
// importType in [datasets, collection]
// elementsType in [raw, ftp, datasets]
let title;
if (importType == "datasets") {
if (importType === "datasets") {
title = _l("Build Rules for Uploading Datasets");
} else if (elementsType == "collection_contents") {
} else if (elementsType === "collection_contents") {
title = _l("Build Rules for Applying to Existing Collection");
} else if (elementsType == "datasets" || elementsType == "library_datasets") {
} else if (elementsType === "datasets" || elementsType === "library_datasets") {
title = _l("Build Rules for Creating Collection(s)");
} else {
title = _l("Build Rules for Uploading Collections");
}
options.title = title;
// Prevents user from accidentally closing the modal by clicking outside the bounds
options.closing_events = false;
const { promise, showEl } = collectionCreatorModalSetup(options);
return import(/* webpackChunkName: "ruleCollectionBuilder" */ "components/RuleCollectionBuilder.vue").then(
(module) => {
var ruleCollectionBuilderInstance = Vue.extend(module.default);
var vm = document.createElement("div");
showEl(vm);
new ruleCollectionBuilderInstance({
propsData: {
initialElements: elements,
elementsType: elementsType,
importType: importType,
ftpUploadSite: options.ftpUploadSite,
creationFn: options.creationFn,
oncancel: options.oncancel,
oncreate: options.oncreate,
defaultHideSourceItems: options.defaultHideSourceItems,
saveRulesFn: options.saveRulesFn,
initialRules: options.initialRules,
},
}).$mount(vm);
return promise;

const promise = new Promise((resolve, reject) => {
options.oncancel = function () {
modal.hide();
resolve();
};
options.oncreate = function (response) {
modal.hide();
resolve(response);
};
});

const module = await import(/* webpackChunkName: "ruleCollectionBuilder" */ "components/RuleCollectionBuilder.vue");
const ruleCollectionBuilderInstance = Vue.extend(module.default);
const vm = document.createElement("div");

// Prepare modal
const titleSuffix = options.historyName ? `From history: <b>${options.historyName}</b>` : "";
const titleHtml = `<div class='d-flex justify-content-between unselectable'>
<span>${title}</span>
<span>${titleSuffix}</span>
</div>`;
modal.show({
title: titleHtml,
body: vm,
width: "85%",
height: "100%",
});

// Inject rule builder component
new ruleCollectionBuilderInstance({
propsData: {
initialElements: elements,
elementsType: elementsType,
importType: importType,
ftpUploadSite: options.ftpUploadSite,
creationFn: options.creationFn,
oncancel: options.oncancel,
oncreate: options.oncreate,
defaultHideSourceItems: options.defaultHideSourceItems,
saveRulesFn: options.saveRulesFn,
initialRules: options.initialRules,
},
);
}).$mount(vm);

return promise;
}
function createCollectionViaRules(selection, defaultHideSourceItems = true) {

export async function createCollectionViaRules(selection, defaultHideSourceItems = true) {
let elements;
let elementsType;
let importType;
const selectionType = selection.selectionType;
if (!selectionType) {
// Have HDAs from the history panel.
elements = selection.toJSON();
elementsType = "datasets";
importType = "collections";
Expand All @@ -64,17 +85,18 @@ function createCollectionViaRules(selection, defaultHideSourceItems = true) {
elementsType = selection.selectionType;
importType = selection.dataType || "collections";
}
const promise = ruleBasedCollectionCreatorModal(elements, elementsType, importType, {
ftpUploadSite: selection.ftpUploadSite,
defaultHideSourceItems: defaultHideSourceItems,
creationFn: function (elements, collectionType, name, hideSourceItems) {
return selection.createHDCA(elements, collectionType, name, hideSourceItems);
},
});
return promise;
}

export default {
ruleBasedCollectionCreatorModal: ruleBasedCollectionCreatorModal,
createCollectionViaRules: createCollectionViaRules,
};
try {
const result = await ruleBasedCollectionCreatorModal(elements, elementsType, importType, {
ftpUploadSite: selection.ftpUploadSite,
defaultHideSourceItems: defaultHideSourceItems,
creationFn: async (elements, collectionType, name, hideSourceItems) => {
return selection.createHDCA(elements, collectionType, name, hideSourceItems);
},
});
return result;
} catch (error) {
console.error("Error in rule-based collection creation:", error);
throw error;
}
}
46 changes: 9 additions & 37 deletions client/src/components/Collections/common/buildCollectionModal.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
/**
* TODO: Update this description...
* Temporary adapter to launch bootstrap modals from Vue components, for use with
* the collection assembly modals. i.e. With selected..... create dataset collection,
* create paired collection, etc.
*
* The goal is to use the existing "createListCollection", etc. functions but doctor
* the content parameter to have the API of a backbone model which requires a
* deprecated jquery Deferred object.
* Launch bootstrap modals with Vue components, for use with the collection assembly modals.
* i.e. With selected..... create dataset collection, create paired collection, etc.
*/

import jQuery from "jquery";

import type { HDASummary, HistoryItemSummary } from "@/api";
import type { CollectionType } from "@/api/datasetCollections";
import RULE_BASED_COLLECTION_CREATOR from "@/components/Collections/RuleBasedCollectionCreatorModal";
import { createCollectionViaRules } from "@/components/Collections/RuleBasedCollectionCreatorModal";
import { createDatasetCollection } from "@/components/History/model/queries";
import { useHistoryStore } from "@/stores/historyStore";

Expand Down Expand Up @@ -55,7 +47,7 @@
export type DatasetPair = GenericPair<HDASummary>;

export async function buildCollectionFromRules(
selection: any,

Check warning on line 50 in client/src/components/Collections/common/buildCollectionModal.ts

View workflow job for this annotation

GitHub Actions / client-unit-test

Unexpected any. Specify a different type
historyId: string | null = null,
fromRulesInput = false,
) {
Expand All @@ -72,54 +64,34 @@
});
}
if (historyId) {
const modalResult = await buildRuleCollectionModal(selectionContent, historyId, fromRulesInput);
const content = fromRulesInput ? selectionContent : createContent(historyId, selectionContent);
const modalResult = await createCollectionViaRules(content);
if (modalResult) {
console.debug("Submitting collection build request.", modalResult);
await createDatasetCollection({ id: historyId } as any, modalResult);
}
}
}

// stand-in for buildCollection from history-view-edit.js
export async function buildRuleCollectionModal(
selectedContent: HistoryItemSummary[],
historyId: string,
fromRulesInput = false,
defaultHideSourceItems = true,
) {
// select legacy function
const createFunc = RULE_BASED_COLLECTION_CREATOR.createCollectionViaRules;
// pull up cached content by type_ids;
if (fromRulesInput) {
return await createFunc(selectedContent);
} else {
const fakeBackboneContent = createBackboneContent(historyId, selectedContent, defaultHideSourceItems);
return await createFunc(fakeBackboneContent);
}
}

const createBackboneContent = (historyId: string, selection: HistoryItemSummary[], defaultHideSourceItems: boolean) => {
const createContent = (historyId: string, selection: HistoryItemSummary[], defaultHideSourceItems: boolean = true) => {
const selectionJson = Array.from(selection.values());
return {
historyId,
toJSON: () => selectionJson,
// result must be a $.Deferred object instead of a promise because
// that's the kind of deprecated data format that backbone likes to use.
createHDCA(
async createHDCA(
element_identifiers: any,
collection_type: CollectionType,
name: string,
hide_source_items: boolean,
options = {},
) {
const def = jQuery.Deferred();
return def.resolve(null, {
return {
collection_type,
name,
hide_source_items,
element_identifiers,
options,
});
};
},
defaultHideSourceItems,
};
Expand Down
36 changes: 0 additions & 36 deletions client/src/components/Collections/common/modal.js

This file was deleted.

61 changes: 0 additions & 61 deletions client/src/components/Collections/common/modal.test.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { computed, type Ref, ref, unref, watch } from "vue";

import type { CollectionElementIdentifiers, CreateNewCollectionPayload, HistoryItemSummary } from "@/api";
import type RuleCollectionBuilder from "@/components/RuleCollectionBuilder.vue";
import STATES from "@/mvc/dataset/states";
import STATES from "@/utils/datasetStates";
import localize from "@/utils/localization";

import type ListCollectionCreator from "./ListCollectionCreator.vue";
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/History/Content/ContentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,19 @@ function onDisplay() {
// vue-router 4 supports a native force push with clean URLs,
// but we're using a __vkey__ bit as a workaround
// Only conditionally force to keep urls clean most of the time.
const hidInfo = props.item.hid ? `${props.item.hid}: ` : "";
if (route.path === itemUrls.value.display) {
const options: RouterPushOptions = {
force: true,
preventWindowManager: !isWindowManagerActive,
title: isWindowManagerActive ? `${props.item.hid}: ${props.name}` : undefined,
title: isWindowManagerActive ? `${hidInfo} ${props.name}` : undefined,
};
// @ts-ignore - monkeypatched router, drop with migration.
router.push(displayUrl, options);
} else if (displayUrl) {
const options: RouterPushOptions = {
preventWindowManager: !isWindowManagerActive,
title: isWindowManagerActive ? `${props.item.hid}: ${props.name}` : undefined,
title: isWindowManagerActive ? `${hidInfo} ${props.name}` : undefined,
};
// @ts-ignore - monkeypatched router, drop with migration.
router.push(displayUrl, options);
Expand Down
Loading
Loading