Merge branch 'master' into BUDI-8122/unify_icon_settings
This commit is contained in:
commit
71d3e37482
|
@ -34,7 +34,7 @@
|
||||||
$selectedScreen,
|
$selectedScreen,
|
||||||
datasource
|
datasource
|
||||||
)?.table?.primaryDisplay
|
)?.table?.primaryDisplay
|
||||||
$: schema = getSchema(selectedScreen, datasource)
|
$: schema = getSchema($selectedScreen, datasource)
|
||||||
$: columns = getColumns({
|
$: columns = getColumns({
|
||||||
columns: value,
|
columns: value,
|
||||||
schema,
|
schema,
|
||||||
|
|
|
@ -6011,7 +6011,7 @@
|
||||||
"block": true,
|
"block": true,
|
||||||
"name": "Repeater Block",
|
"name": "Repeater Block",
|
||||||
"icon": "ViewList",
|
"icon": "ViewList",
|
||||||
"illegalChildren": ["section"],
|
"illegalChildren": ["section", "rowexplorer"],
|
||||||
"hasChildren": true,
|
"hasChildren": true,
|
||||||
"size": {
|
"size": {
|
||||||
"width": 400,
|
"width": 400,
|
||||||
|
|
|
@ -147,7 +147,8 @@
|
||||||
border: 1px solid var(--spectrum-global-color-gray-300);
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-height: 410px;
|
min-height: 230px;
|
||||||
|
height: 410px;
|
||||||
}
|
}
|
||||||
div.in-builder :global(*) {
|
div.in-builder :global(*) {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { tableForDatasource } from "../../../tests/utilities/structures"
|
||||||
import { DatabaseName, getDatasource } from "../../../integrations/tests/utils"
|
import { DatabaseName, getDatasource } from "../../../integrations/tests/utils"
|
||||||
|
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
import { Datasource, FieldType, Table } from "@budibase/types"
|
import { Datasource, FieldType, SearchFilters, Table } from "@budibase/types"
|
||||||
|
|
||||||
jest.unmock("mssql")
|
jest.unmock("mssql")
|
||||||
|
|
||||||
|
@ -53,22 +53,38 @@ describe.each([
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should return rows", async () => {
|
describe("strings", () => {
|
||||||
const rows = await Promise.all([
|
const rows = [{ name: "foo" }, { name: "bar" }]
|
||||||
config.api.row.save(table._id!, { name: "foo" }),
|
|
||||||
config.api.row.save(table._id!, { name: "bar" }),
|
|
||||||
])
|
|
||||||
|
|
||||||
const result = await config.api.row.search(table._id!, {
|
interface StringSearchTest {
|
||||||
tableId: table._id!,
|
query: SearchFilters
|
||||||
query: {},
|
expected: (typeof rows)[number][]
|
||||||
})
|
}
|
||||||
|
|
||||||
expect(result.rows).toEqual(
|
const stringSearchTests: StringSearchTest[] = [
|
||||||
expect.arrayContaining([
|
{ query: {}, expected: rows },
|
||||||
expect.objectContaining({ _id: rows[0]._id }),
|
{ query: { string: { name: "foo" } }, expected: [rows[0]] },
|
||||||
expect.objectContaining({ _id: rows[1]._id }),
|
{ query: { fuzzy: { name: "oo" } }, expected: [rows[0]] },
|
||||||
])
|
{ query: { equal: { name: "foo" } }, expected: [rows[0]] },
|
||||||
|
{ query: { notEqual: { name: "foo" } }, expected: [rows[1]] },
|
||||||
|
{ query: { oneOf: { name: ["foo"] } }, expected: [rows[0]] },
|
||||||
|
// { query: { contains: { name: "f" } }, expected: [0] },
|
||||||
|
// { query: { notContains: { name: ["f"] } }, expected: [1] },
|
||||||
|
// { query: { containsAny: { name: ["f"] } }, expected: [0] },
|
||||||
|
]
|
||||||
|
|
||||||
|
it.each(stringSearchTests)(
|
||||||
|
`should be able to run query: $query`,
|
||||||
|
async ({ query, expected }) => {
|
||||||
|
await Promise.all(rows.map(r => config.api.row.save(table._id!, r)))
|
||||||
|
const { rows: foundRows } = await config.api.row.search(table._id!, {
|
||||||
|
tableId: table._id!,
|
||||||
|
query,
|
||||||
|
})
|
||||||
|
expect(foundRows).toEqual(
|
||||||
|
expect.arrayContaining(expected.map(r => expect.objectContaining(r)))
|
||||||
|
)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue