Merge pull request #12488 from jmchilton/handle_deleted_panel_views

Handle deleted panel views in the UI.
This commit is contained in:
Dannon
2021-09-19 19:27:07 -04:00
committed by GitHub
2 changed files with 12 additions and 3 deletions
+10 -3
View File
@@ -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 });
+2
View File
@@ -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")