Skip to content

Commit

Permalink
fix(ui): add missing use button into blueprin details
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Jan 23, 2025
1 parent 61e0668 commit 9781ff1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ui/src/components/flows/blueprints/BlueprintDetail.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<top-nav-bar v-if="!embed && blueprint" :title="blueprint.title" :breadcrumb="breadcrumb" v-loading="!blueprint">
<template #additional-right>
<ul v-if="userCanCreateFlow && kind === 'flow' ">
<router-link :to="{name: 'flows/create', query: {blueprintId: blueprint.id, blueprintSource: embedFriendlyBlueprintBaseUri.includes('community') ? 'community' : 'custom'}}">
<ul v-if="userCanCreateFlow">
<router-link :to="toEditor()">
<el-button type="primary" v-if="!embed">
{{ $t('use') }}
</el-button>
Expand Down Expand Up @@ -93,8 +93,7 @@
import {mapState} from "vuex";
import permission from "../../../models/permission";
import action from "../../../models/action";
import {apiUrl} from "override/utils/route";
export default {
components: {Markdown, CopyToClipboard},
emits: ["back"],
Expand Down Expand Up @@ -148,6 +147,12 @@
}
})
}
},
toEditor() {
const query = this.blueprintKind === "flow" ?
{blueprintId: this.blueprintId, blueprintSource: this.blueprintType} :
{blueprintId: this.blueprintId};
return {name: `${this.blueprintKind}s/create`, query};
}
},
async created() {
Expand All @@ -156,7 +161,7 @@
this.blueprint = data;
if (this.kind === "flow") {
try {
if (this.embedFriendlyBlueprintBaseUri.endsWith("community")) {
if (this.blueprintType === "community") {
this.$store.dispatch(
"blueprints/getBlueprintGraph",
{
Expand Down Expand Up @@ -200,9 +205,6 @@
source: this.blueprint.source
}
},
embedFriendlyBlueprintBaseUri() {
return this.blueprintBaseUri ?? (`${apiUrl(this.$store)}/blueprints/` + (this?.$route?.params?.tab ?? "community"))
},
blueprintType() {
return this.tab ?? this?.$route?.params?.tab ?? "community";
},
Expand Down

0 comments on commit 9781ff1

Please sign in to comment.