Lint.
This commit is contained in:
parent
822a086666
commit
584784edca
|
@ -58,15 +58,6 @@ export const buildViewV2Endpoints = API => ({
|
|||
return await API.delete({ url: `/api/v2/views/${viewId}` })
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates a row from a view
|
||||
* @param row the row to create
|
||||
|
|
|
@ -27,15 +27,15 @@ export const createActions = context => {
|
|||
row.tableId = $datasource?.tableId
|
||||
row._viewId = $datasource?.id
|
||||
return {
|
||||
...await API.saveRow(row, SuppressErrors),
|
||||
_viewId: row._viewId
|
||||
...(await API.saveRow(row, SuppressErrors)),
|
||||
_viewId: row._viewId,
|
||||
}
|
||||
}
|
||||
|
||||
const updateRow = async row => {
|
||||
const $datasource = get(datasource)
|
||||
return {
|
||||
...await API.patchRow(row, SuppressErrors),
|
||||
...(await API.patchRow(row, SuppressErrors)),
|
||||
_viewId: $datasource.id,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,28 @@
|
|||
import * as linkRows from "../../../db/linkedRows"
|
||||
import {generateRowID, getTableIDFromRowID, InternalTables,} from "../../../db/utils"
|
||||
import {
|
||||
generateRowID,
|
||||
getTableIDFromRowID,
|
||||
InternalTables,
|
||||
} from "../../../db/utils"
|
||||
import * as userController from "../user"
|
||||
import {cleanupAttachments, inputProcessing, outputProcessing,} from "../../../utilities/rowProcessor"
|
||||
import {FieldTypes} from "../../../constants"
|
||||
import {
|
||||
cleanupAttachments,
|
||||
inputProcessing,
|
||||
outputProcessing,
|
||||
} from "../../../utilities/rowProcessor"
|
||||
import { FieldTypes } from "../../../constants"
|
||||
import * as utils from "./utils"
|
||||
import {cloneDeep} from "lodash/fp"
|
||||
import {context} from "@budibase/backend-core"
|
||||
import {finaliseRow, updateRelatedFormula} from "./staticFormula"
|
||||
import {LinkDocumentValue, PatchRowRequest, PatchRowResponse, Row, Table, UserCtx,} from "@budibase/types"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import { context } from "@budibase/backend-core"
|
||||
import { finaliseRow, updateRelatedFormula } from "./staticFormula"
|
||||
import {
|
||||
LinkDocumentValue,
|
||||
PatchRowRequest,
|
||||
PatchRowResponse,
|
||||
Row,
|
||||
Table,
|
||||
UserCtx,
|
||||
} from "@budibase/types"
|
||||
import sdk from "../../../sdk"
|
||||
|
||||
export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
import * as internal from "./internal"
|
||||
import * as external from "./external"
|
||||
import {isRows, isSchema, validate as validateSchema,} from "../../../utilities/schema"
|
||||
import {isExternalTable, isSQL} from "../../../integrations/utils"
|
||||
import {events} from "@budibase/backend-core"
|
||||
import {FetchTablesResponse, SaveTableRequest, SaveTableResponse, Table, TableResponse, UserCtx,} from "@budibase/types"
|
||||
import {
|
||||
isRows,
|
||||
isSchema,
|
||||
validate as validateSchema,
|
||||
} from "../../../utilities/schema"
|
||||
import { isExternalTable, isSQL } from "../../../integrations/utils"
|
||||
import { events } from "@budibase/backend-core"
|
||||
import {
|
||||
FetchTablesResponse,
|
||||
SaveTableRequest,
|
||||
SaveTableResponse,
|
||||
Table,
|
||||
TableResponse,
|
||||
UserCtx,
|
||||
} from "@budibase/types"
|
||||
import sdk from "../../../sdk"
|
||||
import {jsonFromCsvString} from "../../../utilities/csv"
|
||||
import {builderSocket} from "../../../websockets"
|
||||
import { jsonFromCsvString } from "../../../utilities/csv"
|
||||
import { builderSocket } from "../../../websockets"
|
||||
|
||||
function pickApi({ tableId, table }: { tableId?: string; table?: Table }) {
|
||||
if (table && !tableId) {
|
||||
|
|
|
@ -45,7 +45,8 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
|||
}
|
||||
}
|
||||
|
||||
const finalViewSchema = view.schema &&
|
||||
const finalViewSchema =
|
||||
view.schema &&
|
||||
Object.entries(view.schema).reduce((p, [fieldName, schemaValue]) => {
|
||||
const fieldSchema: RequiredKeys<UIFieldMetadata> = {
|
||||
order: schemaValue.order,
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
import {context} from "@budibase/backend-core"
|
||||
import {BudibaseInternalDB, getTableParams} from "../../../db/utils"
|
||||
import {breakExternalTableId, isExternalTable, isSQL,} from "../../../integrations/utils"
|
||||
import {Database, Table, TableResponse, TableViewsResponse,} from "@budibase/types"
|
||||
import { context } from "@budibase/backend-core"
|
||||
import { BudibaseInternalDB, getTableParams } from "../../../db/utils"
|
||||
import {
|
||||
breakExternalTableId,
|
||||
isExternalTable,
|
||||
isSQL,
|
||||
} from "../../../integrations/utils"
|
||||
import {
|
||||
Database,
|
||||
Table,
|
||||
TableResponse,
|
||||
TableViewsResponse,
|
||||
} from "@budibase/types"
|
||||
import datasources from "../datasources"
|
||||
import {isEditableColumn, populateExternalTableSchemas} from "./validation"
|
||||
import { isEditableColumn, populateExternalTableSchemas } from "./validation"
|
||||
import sdk from "../../../sdk"
|
||||
|
||||
async function getAllInternalTables(db?: Database): Promise<Table[]> {
|
||||
|
|
|
@ -79,16 +79,16 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
|
|||
}
|
||||
|
||||
let schema = { ...tableSchema }
|
||||
const anyViewOrder = Object.values(view.schemaUI || {}).some(ui => ui.order != null)
|
||||
const anyViewOrder = Object.values(view.schemaUI || {}).some(
|
||||
ui => ui.order != null
|
||||
)
|
||||
for (const key of Object.keys(schema)) {
|
||||
// if nothing specified in view, then it is not visible
|
||||
const ui = view.schemaUI?.[key] || { visible: false }
|
||||
schema[key] = {
|
||||
...schema[key],
|
||||
...ui,
|
||||
order: anyViewOrder
|
||||
? ui?.order ?? undefined
|
||||
: schema[key].order,
|
||||
order: anyViewOrder ? ui?.order ?? undefined : schema[key].order,
|
||||
}
|
||||
}
|
||||
delete view.schemaUI
|
||||
|
|
Loading…
Reference in New Issue