Merge pull request #12677 from mvdbeek/fix_toolshed_console_alerts

[21.09] Don't change panel view after installing repositories, clean up provider
This commit is contained in:
Dannon
2021-10-08 19:44:21 -04:00
committed by GitHub
5 changed files with 24 additions and 17 deletions
@@ -2,7 +2,7 @@
<ConfigProvider class="d-flex flex-column" v-slot="{ config }">
<ToolPanelViewProvider
v-slot="{ currentPanel, currentPanelView }"
:site-default-panel-view="config.default_panel_view"
:panel-view="config.default_panel_view"
v-if="config.default_panel_view"
>
<ToolBox
@@ -2,7 +2,7 @@
<ConfigProvider class="d-flex flex-column" v-slot="{ config }">
<ToolPanelViewProvider
v-slot="{ currentPanel, currentPanelView }"
:site-default-panel-view="config.default_panel_view"
:panel-view="config.default_panel_view"
v-if="config.default_panel_view"
>
<ToolBoxWorkflow
@@ -37,11 +37,7 @@
</template>
</b-table>
<ConfigProvider v-slot="{ config }">
<ToolPanelViewProvider
v-slot="{ currentPanel }"
site-default-panel-view="default"
:set-default-panel-view="true"
>
<ToolPanelViewProvider v-slot="{ currentPanel }" :panel-view="`default`" :set-default="false">
<InstallationSettings
v-if="showSettings"
:repo="repo"
@@ -2,32 +2,39 @@ import { mapGetters, mapActions } from "vuex";
export default {
props: {
siteDefaultPanelView: {
panelView: {
type: String,
required: true,
},
setDefaultPanelView: {
setDefault: {
type: Boolean,
default: false,
required: false,
default: true,
},
},
computed: {
...mapGetters("panels", ["currentPanel", "currentPanelView"]),
...mapGetters("panels", ["currentPanel", "currentPanelView", "panel"]),
localPanelView() {
return this.setDefault ? this.currentPanelView : this.panelView;
},
localPanel() {
return this.setDefault ? this.currentPanel : this.panel(this.panelView);
},
},
methods: {
...mapActions("panels", ["initCurrentPanelView", "setCurrentPanelView"]),
...mapActions("panels", ["initCurrentPanelView", "fetchPanel"]),
},
created() {
if (this.setDefaultPanelView) {
this.setCurrentPanelView(this.siteDefaultPanelView);
if (this.setDefault) {
this.initCurrentPanelView(this.panelView);
} else {
this.initCurrentPanelView(this.siteDefaultPanelView);
this.fetchPanel(this.panelView);
}
},
render() {
return this.$scopedSlots.default({
currentPanel: this.currentPanel,
currentPanelView: this.currentPanelView,
currentPanel: this.localPanel,
currentPanelView: this.localPanelView,
});
},
};
+4
View File
@@ -42,6 +42,10 @@ const actions = {
const { data } = await axios.get(`${getAppRoot()}api/tools?in_panel=true&view=${panelView}`);
commit("savePanelView", { panelView, panel: data });
},
fetchPanel: async ({ commit }, panelView) => {
const { data } = await axios.get(`${getAppRoot()}api/tools?in_panel=true&view=${panelView}`);
commit("savePanelView", { panelView, panel: data });
},
};
const mutations = {