mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-13 08:51:38 +08:00
Merge pull request #14832 from guerler/remove_mount_helpers
Remove legacy js mount-helpers for makos
This commit is contained in:
@@ -43,12 +43,7 @@ export function chart(options) {
|
||||
return new Client(options);
|
||||
}
|
||||
|
||||
export { initMasthead } from "components/Masthead/initMasthead";
|
||||
export { mountHistory } from "components/History/mount";
|
||||
export { mountMakoTags } from "components/Tags";
|
||||
export { mountWorkflowEditor } from "components/Workflow/Editor/mount";
|
||||
export { mountPageEditor } from "components/PageEditor/mount";
|
||||
export { mountPageDisplay } from "components/PageDisplay";
|
||||
|
||||
// Used in common.mako
|
||||
export { default as store } from "storemodern";
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting dataset components from non-Vue environment.
|
||||
*/
|
||||
import $ from "jquery";
|
||||
import DatasetLink from "./DatasetLink/DatasetLink";
|
||||
import { mountVueComponent } from "utils/mountVueComponent";
|
||||
import DatasetIndex from "./DatasetIndex/DatasetIndex";
|
||||
import DatasetAsImage from "./DatasetAsImage/DatasetAsImage";
|
||||
|
||||
export const mountDatasetAsImage = () => {
|
||||
return mountDatasetComponent(".dataset-as-image", ["history_dataset_id", "path"], DatasetAsImage);
|
||||
};
|
||||
export const mountDatasetIndex = () => {
|
||||
return mountDatasetComponent(".dataset-index", ["history_dataset_id", "path"], DatasetIndex);
|
||||
};
|
||||
export const mountDatasetLink = () => {
|
||||
return mountDatasetComponent(".dataset-link", ["history_dataset_id", "path", "label"], DatasetLink);
|
||||
};
|
||||
|
||||
export const mountDatasetComponents = () => {
|
||||
const all = [mountDatasetAsImage, mountDatasetIndex, mountDatasetLink];
|
||||
all.forEach((func) => func());
|
||||
};
|
||||
|
||||
const mountDatasetComponent = (selector, props, component, propsData = {}) => {
|
||||
$(selector).each((index, el) => {
|
||||
props.forEach((prop) => {
|
||||
propsData[prop] = $(el).attr(prop);
|
||||
});
|
||||
mountVueComponent(component)(propsData, el);
|
||||
});
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting History in non-Vue environment.
|
||||
*/
|
||||
import Vue from "vue";
|
||||
import VueRouter from "vue-router";
|
||||
import HistoryView from "./HistoryView";
|
||||
import store from "store";
|
||||
import { safePath } from "utils/redirect";
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
export const mountHistory = (el, propsData) => {
|
||||
const component = Vue.extend(HistoryView);
|
||||
const router = new VueRouter();
|
||||
router.push = (url) => {
|
||||
window.location.href = safePath(url);
|
||||
};
|
||||
return new component({
|
||||
el: el,
|
||||
propsData: propsData,
|
||||
router: router,
|
||||
store: store,
|
||||
});
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Temporary function used to mount the masthead inside the current application.
|
||||
* This function is exposed with the rest of the page-globals in bundledEntries.
|
||||
*/
|
||||
import { mountMasthead } from "layout/masthead";
|
||||
import $ from "jquery";
|
||||
|
||||
export function initMasthead(config, container) {
|
||||
console.log("initMasthead");
|
||||
const $masthead = $("#masthead");
|
||||
if (config.hide_masthead) {
|
||||
$masthead.remove();
|
||||
} else {
|
||||
if (container) {
|
||||
mountMasthead(container, config);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export { default as PageDisplay } from "./PageDisplay";
|
||||
|
||||
// function for mounting page display in non-Vue environments
|
||||
export { mountPageDisplay } from "./mount";
|
||||
@@ -1,16 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting PageDisplay from non-Vue environment (annotated DOMs).
|
||||
*/
|
||||
import $ from "jquery";
|
||||
import Vue from "vue";
|
||||
import store from "store";
|
||||
import PageDisplay from "./PageDisplay.vue";
|
||||
|
||||
export const mountPageDisplay = (propsData = {}) => {
|
||||
$("#page-display-content").each((index, el) => {
|
||||
const pageId = $(el).attr("page_id");
|
||||
const component = Vue.extend(PageDisplay);
|
||||
propsData.pageId = pageId;
|
||||
return new component({ store: store, propsData: propsData }).$mount(el);
|
||||
});
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
export { default as PageEditor } from "./PageEditor.vue";
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting WorkflowEditor from non-Vue environment (editor.mako).
|
||||
*/
|
||||
import Vue from "vue";
|
||||
import PageEditor from "./PageEditor";
|
||||
|
||||
export const mountPageEditor = (propsData) => {
|
||||
const component = Vue.extend(PageEditor);
|
||||
return new component({
|
||||
propsData: propsData,
|
||||
el: "#columns",
|
||||
});
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting WorkflowEditor from non-Vue environment (editor.mako).
|
||||
*/
|
||||
import Vue from "vue";
|
||||
import Index from "./Index";
|
||||
import store from "store";
|
||||
|
||||
export const mountWorkflowEditor = (propsData) => {
|
||||
const component = Vue.extend(Index);
|
||||
return new component({
|
||||
store: store,
|
||||
propsData: propsData,
|
||||
el: "#columns",
|
||||
});
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import Invocations from "../Workflow/Invocations";
|
||||
import Invocations from "./Invocations";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
import { getAppRoot } from "onload/loadConfig";
|
||||
import { getGalaxyInstance } from "app";
|
||||
import { invocationsProvider } from "components/providers/InvocationsProvider";
|
||||
import { WorkflowInvocationState } from "components/WorkflowInvocationState";
|
||||
import WorkflowInvocationState from "components/WorkflowInvocationState/WorkflowInvocationState";
|
||||
import WorkflowRunButton from "./WorkflowRunButton.vue";
|
||||
import UtcDate from "components/UtcDate";
|
||||
import { mapCacheActions } from "vuex-cache";
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { WorkflowInvocationState } from "components/WorkflowInvocationState";
|
||||
import WorkflowInvocationState from "components/WorkflowInvocationState/WorkflowInvocationState";
|
||||
import Webhooks from "utils/webhooks";
|
||||
import { getAppRoot } from "onload/loadConfig";
|
||||
import { refreshContentsWrapper } from "utils/data";
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export { default as WorkflowInvocationState } from "./WorkflowInvocationState";
|
||||
|
||||
// functions for mounting display in non-Vue environments
|
||||
export { mountWorkflowInvocationState } from "./mount";
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Endpoint for mounting workflow invocation state from non-Vue environment.
|
||||
*/
|
||||
import $ from "jquery";
|
||||
import WorkflowInvocationState from "./WorkflowInvocationState.vue";
|
||||
import { mountVueComponent } from "utils/mountVueComponent";
|
||||
|
||||
export const mountWorkflowInvocationState = (propsData = {}) => {
|
||||
$(".workflow-invocation-state").each((index, el) => {
|
||||
const invocationId = $(el).attr("workflow_invocation_id");
|
||||
propsData.invocationId = invocationId;
|
||||
mountVueComponent(WorkflowInvocationState)(propsData, el);
|
||||
});
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
import Masthead from "components/Masthead/Masthead";
|
||||
import { mountVueComponent } from "utils/mountVueComponent";
|
||||
import { fetchMenu } from "entry/analysis/menu";
|
||||
import { safePath } from "utils/redirect";
|
||||
|
||||
export function mountMasthead(el, options) {
|
||||
const mounted = mountVueComponent(Masthead)(
|
||||
{
|
||||
el: el,
|
||||
displayGalaxyBrand: options.display_galaxy_brand,
|
||||
tabs: fetchMenu(options),
|
||||
brand: options.brand,
|
||||
logoUrl: options.logo_url,
|
||||
logoSrc: options.logo_src,
|
||||
logoSrcSecondary: options.logo_src_secondary,
|
||||
},
|
||||
el
|
||||
);
|
||||
mounted.$on("open-url", (options) => {
|
||||
window.location = safePath(options.url);
|
||||
});
|
||||
return mounted;
|
||||
}
|
||||
Reference in New Issue
Block a user