Also rename LuceneUtils -> QueryUtils
This commit is contained in:
parent
bc8791e91e
commit
6363965a8b
|
@ -41,7 +41,7 @@
|
|||
EditorModes,
|
||||
} from "components/common/CodeEditor"
|
||||
import FilterBuilder from "components/design/settings/controls/FilterEditor/FilterBuilder.svelte"
|
||||
import { LuceneUtils, Utils } from "@budibase/frontend-core"
|
||||
import { QueryUtils, Utils } from "@budibase/frontend-core"
|
||||
import {
|
||||
getSchemaForDatasourcePlus,
|
||||
getEnvironmentBindings,
|
||||
|
@ -343,7 +343,7 @@
|
|||
}
|
||||
|
||||
function saveFilters(key) {
|
||||
const filters = LuceneUtils.buildQuery(tempFilters)
|
||||
const filters = QueryUtils.buildQuery(tempFilters)
|
||||
const defKey = `${key}-def`
|
||||
onChange({ detail: filters }, key)
|
||||
// need to store the builder definition in the automation
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
} from "@budibase/bbui"
|
||||
import download from "downloadjs"
|
||||
import { API } from "api"
|
||||
import { LuceneUtils } from "@budibase/frontend-core"
|
||||
import { QueryUtils } from "@budibase/frontend-core"
|
||||
import { utils } from "@budibase/shared-core"
|
||||
import { ROW_EXPORT_FORMATS } from "constants/backend"
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
|||
exportFormat = Array.isArray(options) ? options[0]?.key : []
|
||||
}
|
||||
|
||||
$: luceneFilter = LuceneUtils.buildQuery(appliedFilters)
|
||||
$: luceneFilter = QueryUtils.buildQuery(appliedFilters)
|
||||
$: exportOpDisplay = buildExportOpDisplay(
|
||||
sorting,
|
||||
filterDisplay,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import { dndzone } from "svelte-dnd-action"
|
||||
import { generate } from "shortid"
|
||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||
import { LuceneUtils, Constants } from "@budibase/frontend-core"
|
||||
import { QueryUtils, Constants } from "@budibase/frontend-core"
|
||||
import { selectedComponent, componentStore } from "stores/builder"
|
||||
import { getComponentForSetting } from "components/design/settings/componentSettings"
|
||||
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
|
||||
|
@ -119,7 +119,7 @@
|
|||
}
|
||||
|
||||
const getOperatorOptions = condition => {
|
||||
return LuceneUtils.getValidOperatorsForType({ type: condition.valueType })
|
||||
return QueryUtils.getValidOperatorsForType({ type: condition.valueType })
|
||||
}
|
||||
|
||||
const onOperatorChange = (condition, newOperator) => {
|
||||
|
@ -138,7 +138,7 @@
|
|||
condition.referenceValue = null
|
||||
|
||||
// Ensure a valid operator is set
|
||||
const validOperators = LuceneUtils.getValidOperatorsForType({
|
||||
const validOperators = QueryUtils.getValidOperatorsForType({
|
||||
type: newType,
|
||||
}).map(x => x.value)
|
||||
if (!validOperators.includes(condition.operator)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { getContext } from "svelte"
|
||||
import { Pagination, ProgressCircle } from "@budibase/bbui"
|
||||
import { fetchData, LuceneUtils } from "@budibase/frontend-core"
|
||||
import { fetchData, QueryUtils } from "@budibase/frontend-core"
|
||||
|
||||
export let dataSource
|
||||
export let filter
|
||||
|
@ -19,7 +19,7 @@
|
|||
|
||||
// We need to manage our lucene query manually as we want to allow components
|
||||
// to extend it
|
||||
$: defaultQuery = LuceneUtils.buildQuery(filter)
|
||||
$: defaultQuery = QueryUtils.buildQuery(filter)
|
||||
$: query = extendQuery(defaultQuery, queryExtensions)
|
||||
$: fetch = createFetch(dataSource)
|
||||
$: fetch.update({
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import { getContext, onDestroy } from "svelte"
|
||||
import { ModalContent, Modal } from "@budibase/bbui"
|
||||
import FilterModal from "./FilterModal.svelte"
|
||||
import { LuceneUtils } from "@budibase/frontend-core"
|
||||
import { QueryUtils } from "@budibase/frontend-core"
|
||||
import Button from "../Button.svelte"
|
||||
|
||||
export let dataProvider
|
||||
|
@ -36,7 +36,7 @@
|
|||
// Add query extension to data provider
|
||||
$: {
|
||||
if (filters?.length) {
|
||||
const queryExtension = LuceneUtils.buildQuery(filters)
|
||||
const queryExtension = QueryUtils.buildQuery(filters)
|
||||
addExtension?.($component.id, queryExtension)
|
||||
} else {
|
||||
removeExtension?.($component.id)
|
||||
|
|
|
@ -31,7 +31,7 @@ import { enrichButtonActions } from "./utils/buttonActions.js"
|
|||
import { processStringSync, makePropSafe } from "@budibase/string-templates"
|
||||
import {
|
||||
fetchData,
|
||||
LuceneUtils,
|
||||
QueryUtils,
|
||||
Constants,
|
||||
RowUtils,
|
||||
memo,
|
||||
|
@ -65,7 +65,7 @@ export default {
|
|||
getAction,
|
||||
fetchDatasourceSchema,
|
||||
fetchData,
|
||||
LuceneUtils,
|
||||
QueryUtils,
|
||||
ContextScopes: Constants.ContextScopes,
|
||||
getAPIKey,
|
||||
enrichButtonActions,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { LuceneUtils } from "@budibase/frontend-core"
|
||||
import { QueryUtils } from "@budibase/frontend-core"
|
||||
|
||||
export const getActiveConditions = conditions => {
|
||||
if (!conditions?.length) {
|
||||
|
@ -33,8 +33,8 @@ export const getActiveConditions = conditions => {
|
|||
value: condition.referenceValue,
|
||||
}
|
||||
|
||||
const query = LuceneUtils.buildQuery([luceneCondition])
|
||||
const result = LuceneUtils.runQuery([luceneCondition], query)
|
||||
const query = QueryUtils.buildQuery([luceneCondition])
|
||||
const result = QueryUtils.runQuery([luceneCondition], query)
|
||||
return result.length > 0
|
||||
})
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
} from "@budibase/bbui"
|
||||
import { FieldType, SearchFilterOperator } from "@budibase/types"
|
||||
import { generate } from "shortid"
|
||||
import { LuceneUtils, Constants } from "@budibase/frontend-core"
|
||||
import { QueryUtils, Constants } from "@budibase/frontend-core"
|
||||
import { getContext } from "svelte"
|
||||
import FilterUsers from "./FilterUsers.svelte"
|
||||
import { getFields } from "../utils/searchFields"
|
||||
|
@ -112,7 +112,7 @@
|
|||
return []
|
||||
}
|
||||
|
||||
return LuceneUtils.getValidOperatorsForType(
|
||||
return QueryUtils.getValidOperatorsForType(
|
||||
filter,
|
||||
filter.field || filter.name,
|
||||
datasource
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { writable, derived, get } from "svelte/store"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import { LuceneUtils } from "../utils"
|
||||
import { QueryUtils } from "../utils"
|
||||
import { convertJSONSchemaToTableSchema } from "../utils/json"
|
||||
|
||||
const { buildQuery, luceneLimit, runQuery, luceneSort } = LuceneUtils
|
||||
const { buildQuery, luceneLimit, runQuery, luceneSort } = QueryUtils
|
||||
|
||||
/**
|
||||
* Parent class which handles the implementation of fetching data from an
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { get } from "svelte/store"
|
||||
import DataFetch from "./DataFetch.js"
|
||||
import { TableNames } from "../constants"
|
||||
import { LuceneUtils } from "../utils"
|
||||
import { QueryUtils } from "../utils"
|
||||
|
||||
export default class UserFetch extends DataFetch {
|
||||
constructor(opts) {
|
||||
|
@ -33,7 +33,7 @@ export default class UserFetch extends DataFetch {
|
|||
let finalQuery
|
||||
// convert old format to new one - we now allow use of the lucene format
|
||||
const { appId, paginated, ...rest } = query
|
||||
if (!LuceneUtils.hasFilters(query) && rest.email != null) {
|
||||
if (!QueryUtils.hasFilters(query) && rest.email != null) {
|
||||
finalQuery = { string: { email: rest.email } }
|
||||
} else {
|
||||
finalQuery = rest
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export { dataFilters as LuceneUtils } from "@budibase/shared-core"
|
||||
export { dataFilters as QueryUtils } from "@budibase/shared-core"
|
||||
export * as JSONUtils from "./json"
|
||||
export * as CookieUtils from "./cookies"
|
||||
export * as RoleUtils from "./roles"
|
||||
|
|
Loading…
Reference in New Issue