Lint
This commit is contained in:
parent
d89f486d71
commit
dd793eb6a1
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import dayjs, { Dayjs } from "dayjs"
|
||||
import dayjs, { type Dayjs } from "dayjs"
|
||||
import { memo } from "@budibase/frontend-core"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import CoreDatePicker from "./DatePicker/DatePicker.svelte"
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
import { Select } from "@budibase/bbui"
|
||||
import { componentStore, selectedScreen } from "@/stores/builder"
|
||||
|
||||
import {
|
||||
findAllComponents,
|
||||
findComponent,
|
||||
getComponentContexts,
|
||||
} from "@/helpers/components"
|
||||
import { findAllComponents, getComponentContexts } from "@/helpers/components"
|
||||
import { makePropSafe as safe } from "@budibase/string-templates"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { extractLiteralHandlebarsID } from "@/dataBinding"
|
||||
|
@ -18,17 +14,12 @@
|
|||
|
||||
let providersComps: Component[]
|
||||
let providers: { label: string; value: string; subtitle: string }[]
|
||||
let targetComponent: Component | null
|
||||
|
||||
// Load the component for processing
|
||||
$: targetId = extractLiteralHandlebarsID(value)
|
||||
|
||||
// Refresh datasources if the target is altered
|
||||
$: {
|
||||
targetComponent =
|
||||
$selectedScreen && targetId
|
||||
? findComponent($selectedScreen?.props, targetId)
|
||||
: null
|
||||
$: if (targetId) {
|
||||
providersComps = loadProviderComponents()
|
||||
providers = buildProviders()
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
extractLiteralHandlebarsID,
|
||||
getDatasourceForProvider,
|
||||
} from "@/dataBinding"
|
||||
import { selectedScreen, datasources, tables } from "@/stores/builder"
|
||||
import { selectedScreen } from "@/stores/builder"
|
||||
import DraggableList from "../DraggableList/DraggableList.svelte"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import FilterSetting from "./FilterSetting.svelte"
|
||||
|
@ -72,6 +72,8 @@
|
|||
FieldType.ATTACHMENT_SINGLE,
|
||||
FieldType.ATTACHMENTS,
|
||||
FieldType.AI,
|
||||
FieldType.LINK,
|
||||
FieldType.SIGNATURE_SINGLE,
|
||||
]
|
||||
|
||||
const filteredSchema = Object.entries(schema || {}).filter(
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// because it functions similarly to one
|
||||
import { getContext, onMount } from "svelte"
|
||||
import { get, derived, readable } from "svelte/store"
|
||||
import { featuresStore, componentStore } from "@/stores"
|
||||
import { featuresStore } from "@/stores"
|
||||
import { Grid } from "@budibase/frontend-core"
|
||||
import { processStringSync } from "@budibase/string-templates"
|
||||
import { UILogicalOperator, EmptyFilterOption } from "@budibase/types"
|
||||
|
@ -86,7 +86,6 @@
|
|||
/**
|
||||
*
|
||||
* @param componentId Originating Component id
|
||||
* @param datasourceId Underlying datasource id
|
||||
* @param extension Filter extension
|
||||
*/
|
||||
const addFilterExtension = (componentId, extension) => {
|
||||
|
@ -99,10 +98,9 @@
|
|||
/**
|
||||
*
|
||||
* @param componentId Originating Component id
|
||||
* @param datasourceId Underlying datasource id
|
||||
* @param extension Filter extension
|
||||
*/
|
||||
const removeFilterExtension = (componentId, datasourceId) => {
|
||||
const removeFilterExtension = componentId => {
|
||||
if (!componentId) {
|
||||
return
|
||||
}
|
||||
|
@ -123,7 +121,7 @@
|
|||
}
|
||||
|
||||
// Process and aggregate all filters.
|
||||
let groups = Object.entries(extensions).map(([key, entry]) => {
|
||||
let groups = Object.entries(extensions).map(([_, entry]) => {
|
||||
// Assuming there should only ever be 1
|
||||
return entry
|
||||
})
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import {
|
||||
type FilterConfig,
|
||||
type FieldSchema,
|
||||
type Row,
|
||||
type SearchFilter,
|
||||
type SearchFilterGroup,
|
||||
type TableSchema,
|
||||
|
@ -61,17 +60,10 @@
|
|||
let filters: Record<string, SearchFilter> = {}
|
||||
|
||||
let schema: TableSchema | null
|
||||
let schemaLoaded = false
|
||||
|
||||
// Target component being filtered
|
||||
let dataComponent: Component | null = null
|
||||
|
||||
// componentId > componentInstance
|
||||
let mountedInstances: Record<string, any> | undefined
|
||||
|
||||
// Used in dev app to make the init more reactive
|
||||
$: mountedInstances = $componentStore?.mounted || {}
|
||||
|
||||
// Update the memo when the filters are updated
|
||||
$: memoFilters.set(filters)
|
||||
|
||||
|
@ -136,7 +128,6 @@
|
|||
dataComponent = null
|
||||
filters = {}
|
||||
schema = null
|
||||
schemaLoaded = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,10 +247,8 @@
|
|||
}
|
||||
)
|
||||
schema = Object.fromEntries(filteredSchema)
|
||||
schemaLoaded = true
|
||||
} else {
|
||||
schema = null
|
||||
schemaLoaded = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -221,13 +221,6 @@
|
|||
border: 1px dashed var(--spectrum-global-color-gray-200);
|
||||
}
|
||||
|
||||
/* .spectrum-Button-label {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 200px;
|
||||
} */
|
||||
|
||||
.spectrum-Button-label.truncate {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
} from "@budibase/types"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import BbReferenceField from "../forms/BBReferenceField.svelte"
|
||||
import RelationshipField from "../forms/RelationshipField.svelte"
|
||||
import { type Writable } from "svelte/store"
|
||||
import { getContext } from "svelte"
|
||||
import { isArrayOperator } from "@/utils/filtering"
|
||||
|
@ -63,8 +62,6 @@
|
|||
$: editableFilter = getDefaultFilter(filter, schema, config)
|
||||
$: fieldSchema = config ? schema?.[config?.field] : undefined
|
||||
$: options = getOptions(fieldSchema)
|
||||
$: fieldTableId =
|
||||
fieldSchema?.type === FieldType.LINK ? fieldSchema?.tableId : undefined
|
||||
|
||||
$: if (fieldSchema?.type === FieldType.DATETIME) {
|
||||
enableTime = !fieldSchema?.dateOnly
|
||||
|
|
Loading…
Reference in New Issue