mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* feat: set up dashboard filters from a table and create the widgets they filter * feat: refine dashboard filter setup and widget association Support multi-table filters, guided widget configuration, same-table condition copying in display order, and automatic linking defaults. Preserve independent target settings and undo/redo behavior. * fix: show copied filter conditions after widget association * test: cover guided dashboard widget creation from a filter * test: cover dashboard filter copying across tables * refactor: simplify dashboard filter configuration * fix: restore dashboard filter links exactly on undo and redo * feat: set up a new widget and how a filter narrows it down in one modal * feat: fold the add-widget modal into collapsible sections that fit chart settings * fix: cancel queued updates when destroying dashboard charts * fix: reference dashboard option context by table * refactor: rename dashboard table context provider * fix: label dashboard table context as field options * fix: shorten dashboard table options label --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
73 lines
1.5 KiB
Vue
73 lines
1.5 KiB
Vue
<template>
|
|
<ItemPickerCard
|
|
v-tooltip="variation.description"
|
|
:name="variation.name"
|
|
:image="variation.createWidgetImage"
|
|
:disabled="disabled"
|
|
:unavailable="!isWidgetAvailable"
|
|
:locked="!isWidgetAvailable"
|
|
framed
|
|
@click="widgetVariationSelected"
|
|
>
|
|
<component
|
|
:is="deactivatedModal[0]"
|
|
v-if="deactivatedModal != null"
|
|
ref="deactivatedModal"
|
|
v-bind="deactivatedModal[1]"
|
|
:name="widgetType.name"
|
|
:workspace="dashboard.workspace"
|
|
></component>
|
|
</ItemPickerCard>
|
|
</template>
|
|
|
|
<script>
|
|
import ItemPickerCard from '@baserow/modules/core/components/ItemPickerCard'
|
|
|
|
export default {
|
|
name: 'CreateWidgetCard',
|
|
components: { ItemPickerCard },
|
|
props: {
|
|
dashboard: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
widgetType: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
variation: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
},
|
|
emits: ['widget-variation-selected'],
|
|
computed: {
|
|
isWidgetAvailable() {
|
|
return this.widgetType.isAvailable(this.dashboard.workspace.id)
|
|
},
|
|
deactivatedModal() {
|
|
return this.widgetType.getDeactivatedModal()
|
|
},
|
|
},
|
|
methods: {
|
|
widgetVariationSelected() {
|
|
if (this.disabled) {
|
|
return
|
|
}
|
|
|
|
if (!this.isWidgetAvailable) {
|
|
this.$refs.deactivatedModal.show()
|
|
return
|
|
}
|
|
|
|
this.$emit('widget-variation-selected', this.variation)
|
|
},
|
|
},
|
|
}
|
|
</script>
|