Add open in chart builder button to chart page block configurator
This commit is contained in:
@@ -5,11 +5,20 @@
|
||||
>
|
||||
<b-form-select
|
||||
v-model="block.options.chartID"
|
||||
:options="options"
|
||||
:options="chartOptions"
|
||||
text-field="name"
|
||||
value-field="chartID"
|
||||
/>
|
||||
</b-form-group>
|
||||
|
||||
<b-button
|
||||
v-if="selectedChart"
|
||||
:disabled="!selectedChart.canUpdateChart && !selectedChart.canDeleteChart"
|
||||
variant="light"
|
||||
:to="{ name: 'admin.charts.edit', params: { chartID: selectedChart.chartID }, query: null }"
|
||||
>
|
||||
{{ $t('chart.openInBuilder') }}
|
||||
</b-button>
|
||||
</b-tab>
|
||||
</template>
|
||||
<script>
|
||||
@@ -31,12 +40,20 @@ export default {
|
||||
charts: 'chart/set',
|
||||
}),
|
||||
|
||||
options () {
|
||||
chartOptions () {
|
||||
return [
|
||||
{ chartID: NoID, name: this.$t('chart.pick') },
|
||||
...this.charts,
|
||||
]
|
||||
},
|
||||
|
||||
selectedChart () {
|
||||
if (!this.options.chartID || this.options.chartID === NoID) {
|
||||
return
|
||||
}
|
||||
|
||||
return this.chartOptions.find(({ chartID }) => chartID === this.options.chartID)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -97,6 +97,7 @@ chart:
|
||||
preview:
|
||||
chartId: Chart preview (ID {{0}})
|
||||
searchPlaceholder: Type here to search all charts in this namespace
|
||||
openInBuilder: Open in chart builder
|
||||
content:
|
||||
ok: Ok
|
||||
label: Content
|
||||
|
||||
Reference in New Issue
Block a user