Skip to content

Commit

Permalink
fix(blueprints): now loading icons from Kestra's API as well
Browse files Browse the repository at this point in the history
closes #1817
  • Loading branch information
brian-mulier-p committed Jul 27, 2023
1 parent a23bb94 commit 4e8c1ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ui/src/stores/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default {
counter: counter++,
}
});
},
pluginIcons(_, __) {
return axios.get(API_URL + "/v1/plugins/icons", {})
}
},
mutations: {
Expand Down
16 changes: 11 additions & 5 deletions ui/src/stores/plugins.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import _merge from "lodash/merge";

export default {
namespaced: true,
state: {
Expand Down Expand Up @@ -25,7 +27,7 @@ export default {
}

return this.$http.get(`/api/v1/plugins/${options.cls}`, {params: options}).then(response => {
if(options.all === true) {
if (options.all === true) {
commit("setPluginAllProps", response.data)
} else {
commit("setPlugin", response.data)
Expand All @@ -34,11 +36,15 @@ export default {
})
},
icons({commit}) {
return this.$http.get("/api/v1/plugins/icons", {}).then(response => {
commit("setIcons", response.data)
return Promise.all([
this.$http.get("/api/v1/plugins/icons", {}),
this.dispatch("api/pluginIcons")
]).then(responses => {
const icons = _merge(responses[0].data, responses[1].data);
commit("setIcons", icons);

return response.data;
})
return icons;
});
},
loadInputsType({commit}) {
return this.$http.get(`/api/v1/plugins/inputs`, {}).then(response => {
Expand Down

0 comments on commit 4e8c1ae

Please sign in to comment.