mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-25 05:21:30 +00:00
We still need to check, per collection element, if the datasource's service type supports adhoc refinements. It can if it's the list rows service type.
This commit is contained in:
parent
dc3b8afac8
commit
03f73322b0
4 changed files with 12 additions and 4 deletions
web-frontend/modules
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<component
|
<component
|
||||||
:is="serviceType.adhocHeaderComponent"
|
:is="serviceType.adhocHeaderComponent"
|
||||||
v-if="dataSource && elementType.adhocFilteringSupported(dataSource)"
|
v-if="dataSource && elementType.adhocRefinementsSupported(dataSource)"
|
||||||
class="collection-element__header margin-bottom-1"
|
class="collection-element__header margin-bottom-1"
|
||||||
:sortable-properties="
|
:sortable-properties="
|
||||||
elementType.adhocSortableProperties(element, dataSource)
|
elementType.adhocSortableProperties(element, dataSource)
|
||||||
|
|
|
@ -62,8 +62,9 @@ export const CollectionElementTypeMixin = (Base) =>
|
||||||
* of records, then it will not.
|
* of records, then it will not.
|
||||||
* @param dataSource
|
* @param dataSource
|
||||||
*/
|
*/
|
||||||
adhocFilteringSupported(dataSource) {
|
adhocRefinementsSupported(dataSource) {
|
||||||
return dataSource.type !== LocalBaserowAggregateRowsServiceType.getType()
|
const serviceType = this.app.$registry.get('service', dataSource.type)
|
||||||
|
return serviceType.adhocRefinementsSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
||||||
return (
|
return (
|
||||||
this.selectedDataSource &&
|
this.selectedDataSource &&
|
||||||
this.selectedDataSourceReturnsList &&
|
this.selectedDataSourceReturnsList &&
|
||||||
elementType.adhocFilteringSupported(this.selectedDataSource)
|
elementType.adhocRefinementsSupported(this.selectedDataSource)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,11 @@ import LocalBaserowAdhocHeader from '@baserow/modules/integrations/localBaserow/
|
||||||
import { DistributionViewAggregationType } from '@baserow/modules/database/viewAggregationTypes'
|
import { DistributionViewAggregationType } from '@baserow/modules/database/viewAggregationTypes'
|
||||||
|
|
||||||
export class LocalBaserowTableServiceType extends ServiceType {
|
export class LocalBaserowTableServiceType extends ServiceType {
|
||||||
|
// Determines whether collection elements with data sources using this
|
||||||
|
// service are allowed to perform adhoc refinements (filtering, sorting, searching).
|
||||||
|
// By default, they cannot, only the list rows service type can.
|
||||||
|
adhocRefinementsSupported = false
|
||||||
|
|
||||||
get integrationType() {
|
get integrationType() {
|
||||||
return this.app.$registry.get(
|
return this.app.$registry.get(
|
||||||
'integration',
|
'integration',
|
||||||
|
@ -112,6 +117,8 @@ export class LocalBaserowGetRowServiceType extends LocalBaserowTableServiceType
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LocalBaserowListRowsServiceType extends LocalBaserowTableServiceType {
|
export class LocalBaserowListRowsServiceType extends LocalBaserowTableServiceType {
|
||||||
|
adhocRefinementsSupported = true
|
||||||
|
|
||||||
static getType() {
|
static getType() {
|
||||||
return 'local_baserow_list_rows'
|
return 'local_baserow_list_rows'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue