Skip to content

Commit 4af4857

Browse files
authored
Merge pull request #21037 from guerler/remove_jquery
Remove History Panel proxy
2 parents a55f2a1 + f78c83d commit 4af4857

31 files changed

+121
-281
lines changed

client/src/bundleEntries.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* tagging_common.mako: show_in_overlay
1515
*/
1616

17-
/* jquery and _ are exposed via expose-loader while several external plugins rely on these */
18-
import $ from "jquery"; // eslint-disable-line no-unused-vars
19-
import _ from "underscore"; // eslint-disable-line no-unused-vars
20-
2117
export { getGalaxyInstance, setGalaxyInstance } from "app";
2218
export { default as LegacyGridView } from "legacy/grid/grid-view";
2319
export { createTabularDatasetChunkedView } from "mvc/dataset/data";

client/src/components/Collections/BuildFileSetWizard.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BCardGroup } from "bootstrap-vue";
33
import { computed, ref } from "vue";
44
55
import { GalaxyApi } from "@/api";
6-
import { getGalaxyInstance } from "@/app";
6+
import { buildCollectionFromRules } from "@/components/Collections/common/buildCollectionModal";
77
import { attemptCreate, type CollectionCreatorComponent } from "@/components/Collections/common/useCollectionCreator";
88
import { useWorkbookDropHandling } from "@/components/Collections/common/useWorkbooks";
99
import { rawToTable } from "@/components/Collections/tables";
@@ -172,9 +172,8 @@ const ruleBuilderElements = computed(() => {
172172
});
173173
174174
function launchRuleBuilder() {
175-
const Galaxy = getGalaxyInstance();
176175
const entry = ruleBuilderModalEntryProps.value;
177-
Galaxy.currHistoryPanel.buildCollectionFromRules(entry, null, true);
176+
buildCollectionFromRules(entry, null, true);
178177
}
179178
180179
function submit() {

client/src/components/Collections/CollectionCreatorIndex.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import localize from "@/utils/localization";
1414
import { orList } from "@/utils/strings";
1515
import { stateIsTerminal } from "@/utils/utils";
1616
17-
import type { CollectionBuilderType } from "../History/adapters/buildCollectionModal";
17+
import type { CollectionBuilderType } from "../Collections/common/buildCollectionModal";
1818
import type { SupportedPairedOrPairedBuilderCollectionTypes } from "./common/useCollectionCreator";
1919
2020
import ListCollectionCreator from "./ListCollectionCreator.vue";

client/src/components/Collections/PairedOrUnpairedListCollectionCreator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useAgGrid } from "@/composables/useAgGrid";
1212
import { usePairingDatasetTargetsStore } from "@/stores/collectionBuilderItemsStore";
1313
import localize from "@/utils/localization";
1414
15-
import type { GenericPair } from "../History/adapters/buildCollectionModal";
15+
import type { GenericPair } from "../Collections/common/buildCollectionModal";
1616
import { stripExtension, useUpdateIdentifiersForRemoveExtensions } from "./common/stripExtension";
1717
import {
1818
type SupportedPairedOrPairedBuilderCollectionTypes,

client/src/components/Collections/common/CollectionCreator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BTab, BTabs } from "bootstrap-vue";
55
import { computed, ref, watch } from "vue";
66
77
import type { HDASummary } from "@/api";
8-
import { COLLECTION_TYPE_TO_LABEL } from "@/components/History/adapters/buildCollectionModal";
8+
import { COLLECTION_TYPE_TO_LABEL } from "@/components/Collections/common/buildCollectionModal";
99
import { useUploadConfigurations } from "@/composables/uploadConfigurations";
1010
import localize from "@/utils/localization";
1111

client/src/components/History/adapters/buildCollectionModal.ts renamed to client/src/components/Collections/common/buildCollectionModal.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import jQuery from "jquery";
1414
import type { HDASummary, HistoryItemSummary } from "@/api";
1515
import type { CollectionType } from "@/api/datasetCollections";
1616
import RULE_BASED_COLLECTION_CREATOR from "@/components/Collections/RuleBasedCollectionCreatorModal";
17+
import { createDatasetCollection } from "@/components/History/model/queries";
18+
import { useHistoryStore } from "@/stores/historyStore";
1719

1820
// This is type describes builders we know about - not valid "collection type"s
1921
// as the backend/model layer of Galaxy would understand them. Rules is a collection
@@ -52,6 +54,32 @@ export const COLLECTION_TYPE_TO_LABEL: Record<string, string> = {
5254

5355
export type DatasetPair = GenericPair<HDASummary>;
5456

57+
export async function buildCollectionFromRules(
58+
selection: any,
59+
historyId: string | null = null,
60+
fromRulesInput = false,
61+
) {
62+
let selectionContent: any = null;
63+
const { loadCurrentHistoryId } = useHistoryStore();
64+
historyId = historyId || (await loadCurrentHistoryId());
65+
66+
if (fromRulesInput) {
67+
selectionContent = selection;
68+
} else {
69+
selectionContent = new Map();
70+
selection.models.forEach((obj: any) => {
71+
selectionContent.set(obj.id, obj);
72+
});
73+
}
74+
if (historyId) {
75+
const modalResult = await buildRuleCollectionModal(selectionContent, historyId, fromRulesInput);
76+
if (modalResult) {
77+
console.debug("Submitting collection build request.", modalResult);
78+
await createDatasetCollection({ id: historyId } as any, modalResult);
79+
}
80+
}
81+
}
82+
5583
// stand-in for buildCollection from history-view-edit.js
5684
export async function buildRuleCollectionModal(
5785
selectedContent: HistoryItemSummary[],

client/src/components/Collections/pairing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GenericPair } from "@/components/History/adapters/buildCollectionModal";
1+
import type { GenericPair } from "@/components/Collections/common/buildCollectionModal";
22

33
export const COMMON_FILTERS = {
44
illumina: ["_1", "_2"] as [string, string],

client/src/components/Collections/usePairing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ref } from "vue";
22

3-
import type { GenericPair } from "@/components/History/adapters/buildCollectionModal";
3+
import type { GenericPair } from "@/components/Collections/common/buildCollectionModal";
44

55
import { autoPairWithCommonFilters, type HasName } from "./pairing";
66

client/src/components/Form/Elements/FormData/FormData.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { getGalaxyInstance } from "@/app";
2020
import {
2121
COLLECTION_TYPE_TO_LABEL,
2222
type CollectionBuilderType,
23-
} from "@/components/History/adapters/buildCollectionModal";
23+
} from "@/components/Collections/common/buildCollectionModal";
2424
import { useDatatypesMapper } from "@/composables/datatypesMapper";
2525
import { useUid } from "@/composables/utils/uid";
2626
import { type EventData, useEventStore } from "@/stores/eventStore";

client/src/components/Form/Elements/FormData/FormDataContextButtons.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { CollectionType } from "@/api/datasetCollections";
99
import {
1010
COLLECTION_TYPE_TO_LABEL,
1111
type CollectionBuilderType,
12-
} from "@/components/History/adapters/buildCollectionModal";
12+
} from "@/components/Collections/common/buildCollectionModal";
1313
import { capitalizeFirstLetter } from "@/utils/strings";
1414
1515
import { buildersForCollectionTypes, unconstrainedCollectionTypeBuilders } from "./collections";

0 commit comments

Comments
 (0)