mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #12488 from jmchilton/handle_deleted_panel_views
Handle deleted panel views in the UI.
This commit is contained in:
@@ -22,13 +22,20 @@ const getters = {
|
||||
};
|
||||
|
||||
const actions = {
|
||||
initCurrentPanelView: async ({ commit, state }, siteDefaultPanelView) => {
|
||||
initCurrentPanelView: async ({ commit, state, dispatch }, siteDefaultPanelView) => {
|
||||
const panelView = state.currentPanelView || siteDefaultPanelView;
|
||||
if (state.currentPanelView == null) {
|
||||
commit("setCurrentPanelView", { panelView });
|
||||
}
|
||||
const { data } = await axios.get(`${getAppRoot()}api/tools?in_panel=true&view=${panelView}`);
|
||||
commit("savePanelView", { panelView, panel: data });
|
||||
const response = await axios.get(`${getAppRoot()}api/tools?in_panel=true&view=${panelView}`).catch((error) => {
|
||||
if (error.response && error.response.status == 400) {
|
||||
// Assume the stored panelView disappeared, revert to the panel default for this site.
|
||||
dispatch("setCurrentPanelView", siteDefaultPanelView);
|
||||
}
|
||||
});
|
||||
if (response !== undefined) {
|
||||
commit("savePanelView", { panelView, panel: response.data });
|
||||
}
|
||||
},
|
||||
setCurrentPanelView: async ({ commit }, panelView) => {
|
||||
commit("setCurrentPanelView", { panelView });
|
||||
|
||||
@@ -96,6 +96,8 @@ class ToolsController(BaseGalaxyAPIController, UsesVisualizationMixin):
|
||||
# Return everything.
|
||||
try:
|
||||
return self.app.toolbox.to_dict(trans, in_panel=in_panel, trackster=trackster, tool_help=tool_help, view=view)
|
||||
except exceptions.MessageException:
|
||||
raise
|
||||
except Exception:
|
||||
raise exceptions.InternalServerError("Error: Could not convert toolbox to dictionary")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user