diff --git a/ui/src/components/flows/blueprints/BlueprintDetail.vue b/ui/src/components/flows/blueprints/BlueprintDetail.vue index 109f5363b91..7f253e13ae7 100644 --- a/ui/src/components/flows/blueprints/BlueprintDetail.vue +++ b/ui/src/components/flows/blueprints/BlueprintDetail.vue @@ -121,14 +121,10 @@ type: Boolean, default: false }, - tab: { + blueprintType: { type: String, default: "community" }, - blueprintBaseUri: { - type: String, - default: undefined, - }, kind: { type: String, default: "flow", @@ -205,9 +201,6 @@ source: this.blueprint.source } }, - blueprintType() { - return this.tab ?? this?.$route?.params?.tab ?? "community"; - }, blueprintKind() { return this.blueprintType === "community" ? this.kind : undefined; }, diff --git a/ui/src/components/namespace/Namespace.vue b/ui/src/components/namespace/Namespace.vue index 1ee93bf350a..84dbd8a081e 100644 --- a/ui/src/components/namespace/Namespace.vue +++ b/ui/src/components/namespace/Namespace.vue @@ -53,7 +53,6 @@ import Flows from "./Flows.vue"; import EditorView from "../inputs/EditorView.vue"; import BlueprintsBrowser from "../../override/components/flows/blueprints/BlueprintsBrowser.vue"; - import {apiUrl} from "override/utils/route"; export default { mixins: [RouteContext], @@ -103,10 +102,9 @@ component: BlueprintsBrowser, title: this.$t("blueprints.title"), props: { - blueprintBaseUri: `${apiUrl(this.$store)}/blueprints/community`, - tab: "community", embed: this.embed, - system: true + system: true, + tab: "community" } }) } diff --git a/ui/src/override/components/flows/blueprints/Blueprints.vue b/ui/src/override/components/flows/blueprints/Blueprints.vue index a8ba33a384f..d47ef97d2f5 100644 --- a/ui/src/override/components/flows/blueprints/Blueprints.vue +++ b/ui/src/override/components/flows/blueprints/Blueprints.vue @@ -8,13 +8,19 @@ :image-dark="headerImageDark" >
- +
@@ -26,7 +32,6 @@ import DottedLayout from "../../../../components/layout/DottedLayout.vue"; import BlueprintDetail from "../../../../components/flows/blueprints/BlueprintDetail.vue"; import BlueprintsBrowser from "./BlueprintsBrowser.vue"; - import {apiUrl} from "override/utils/route"; import headerImage from "../../../../assets/icons/blueprint.svg"; import headerImageDark from "../../../../assets/icons/blueprint-dark.svg"; @@ -61,9 +66,6 @@ return { title: this.$t("blueprints.title") }; - }, - blueprintUri() { - return `${apiUrl(this.$store)}/blueprints/community` } } }; diff --git a/ui/src/override/components/flows/blueprints/BlueprintsBrowser.vue b/ui/src/override/components/flows/blueprints/BlueprintsBrowser.vue index 3c7ae523ea7..ba50d10063d 100644 --- a/ui/src/override/components/flows/blueprints/BlueprintsBrowser.vue +++ b/ui/src/override/components/flows/blueprints/BlueprintsBrowser.vue @@ -48,7 +48,7 @@
@@ -110,7 +110,6 @@ import Utils from "../../../../utils/utils"; import Errors from "../../../../components/errors/Errors.vue"; import {editorViewTypes} from "../../../../utils/constants"; - import {apiUrl} from "override/utils/route.js"; import KestraFilter from "../../../../components/filter/KestraFilter.vue"; export default { @@ -118,13 +117,9 @@ components: {TaskIcon, DataTable, Errors, KestraFilter}, emits: ["goToDetail", "loaded"], props: { - blueprintBaseUri: { + blueprintType: { type: String, - required: true - }, - tab: { - type: String, - default: undefined, + default: "community" }, blueprintKind: { type: String, @@ -168,7 +163,7 @@ async blueprintToEditor(blueprintId) { localStorage.setItem(editorViewTypes.STORAGE_KEY, editorViewTypes.SOURCE_TOPOLOGY); const query = this.blueprintKind === "flow" ? - {blueprintId: blueprintId, blueprintSource: this.embedFriendlyBlueprintBaseUri.includes("community") ? "community" : "custom"} : + {blueprintId: blueprintId, blueprintSource: this.blueprintType} : {blueprintId: blueprintId}; this.$router.push({ name: `${this.blueprintKind}s/create`, @@ -183,7 +178,7 @@ this.$emit("goToDetail", blueprintId); } }, - loadTags(beforeLoadBlueprintBaseUri) { + loadTags(beforeLoadBlueprintType) { const query = {} if (this.$route.query.q || this.q) { query.q = this.$route.query.q || this.q; @@ -191,12 +186,12 @@ return this.$store.dispatch("blueprints/getBlueprintTagsForQuery", {type: this.blueprintType, kind: this.blueprintKind, ...query}) .then(data => { // Handle switch tab while fetching data - if (this.embedFriendlyBlueprintBaseUri === beforeLoadBlueprintBaseUri) { + if (this.blueprintType === beforeLoadBlueprintType) { this.tags = this.tagsResponseMapper(data); } }); }, - loadBlueprints(beforeLoadBlueprintBaseUri) { + loadBlueprints(beforeLoadBlueprintType) { const query = {} if (this.$route.query.page || this.internalPageNumber) { @@ -221,18 +216,18 @@ .dispatch("blueprints/getBlueprintsForQuery", {type: this.blueprintType, kind: this.blueprintKind, params: query}) .then(data => { // Handle switch tab while fetching data - if (this.embedFriendlyBlueprintBaseUri === beforeLoadBlueprintBaseUri) { + if (this.blueprintType === beforeLoadBlueprintType) { this.total = data.total; this.blueprints = data.results; } }); }, loadData(callback) { - const beforeLoadBlueprintBaseUri = this.embedFriendlyBlueprintBaseUri; + const beforeLoadBlueprintType = this.blueprintType; Promise.all([ - this.loadTags(beforeLoadBlueprintBaseUri), - this.loadBlueprints(beforeLoadBlueprintBaseUri) + this.loadTags(beforeLoadBlueprintType), + this.loadBlueprints(beforeLoadBlueprintType) ]).then(() => { this.$emit("loaded"); }).catch(() => { @@ -243,7 +238,7 @@ } }).finally(() => { // Handle switch tab while fetching data - if (this.embedFriendlyBlueprintBaseUri === beforeLoadBlueprintBaseUri && callback) { + if (this.blueprintType === beforeLoadBlueprintType && callback) { callback(); } }) @@ -261,17 +256,6 @@ userCanCreateFlow() { return this.user.hasAnyAction(permission.FLOW, action.CREATE); }, - embedFriendlyBlueprintBaseUri() { - const tab = this.tab ?? this?.$route?.params?.tab ?? "community"; - let base = this.blueprintBaseUri; - - return base - ? (base.endsWith("/undefined") ? base.replace("/undefined", `/${tab}`) : base) - : `${apiUrl(this.$store)}/blueprints/${tab}`; - }, - blueprintType() { - return this.tab ?? this?.$route?.params?.tab ?? "community"; - } }, watch: { $route(newValue, oldValue) { @@ -307,10 +291,7 @@ this.selectedTag = 0; } }, - blueprintBaseUri() { - this.loadData(); - }, - tab() { + blueprintType() { this.loadData(); }, blueprintKind() {