mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-14 09:08:32 +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>
|
||||
<component
|
||||
:is="serviceType.adhocHeaderComponent"
|
||||
v-if="dataSource && elementType.adhocFilteringSupported(dataSource)"
|
||||
v-if="dataSource && elementType.adhocRefinementsSupported(dataSource)"
|
||||
class="collection-element__header margin-bottom-1"
|
||||
:sortable-properties="
|
||||
elementType.adhocSortableProperties(element, dataSource)
|
||||
|
|
|
@ -62,8 +62,9 @@ export const CollectionElementTypeMixin = (Base) =>
|
|||
* of records, then it will not.
|
||||
* @param dataSource
|
||||
*/
|
||||
adhocFilteringSupported(dataSource) {
|
||||
return dataSource.type !== LocalBaserowAggregateRowsServiceType.getType()
|
||||
adhocRefinementsSupported(dataSource) {
|
||||
const serviceType = this.app.$registry.get('service', dataSource.type)
|
||||
return serviceType.adhocRefinementsSupported
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
|||
return (
|
||||
this.selectedDataSource &&
|
||||
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'
|
||||
|
||||
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() {
|
||||
return this.app.$registry.get(
|
||||
'integration',
|
||||
|
@ -112,6 +117,8 @@ export class LocalBaserowGetRowServiceType extends LocalBaserowTableServiceType
|
|||
}
|
||||
|
||||
export class LocalBaserowListRowsServiceType extends LocalBaserowTableServiceType {
|
||||
adhocRefinementsSupported = true
|
||||
|
||||
static getType() {
|
||||
return 'local_baserow_list_rows'
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue