Import refactoring and some review updates.
This commit is contained in:
parent
7fe99448f7
commit
ce1ddb4458
|
@ -42,4 +42,3 @@ exports.Config = {
|
|||
|
||||
exports.MAX_VALID_DATE = new Date(2147483647000)
|
||||
exports.DEFAULT_TENANT_ID = "default"
|
||||
exports.BUDIBASE_DATASOURCE_TYPE = "budibase"
|
||||
|
|
|
@ -42,4 +42,3 @@ export enum Config {
|
|||
|
||||
export const MAX_VALID_DATE = new Date(2147483647000)
|
||||
export const DEFAULT_TENANT_ID = "default"
|
||||
export const BUDIBASE_DATASOURCE_TYPE = "budibase"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
let modal
|
||||
|
||||
let internalTablesBySourceId = $tables.list.filter(
|
||||
$: internalTablesBySourceId = $tables.list.filter(
|
||||
table =>
|
||||
table.type !== "external" && $datasources.selected === table.sourceId
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { goto } from "@roxi/routify"
|
||||
|
||||
let modal
|
||||
let internalTablesBySourceId = $tables.list.filter(
|
||||
$: internalTablesBySourceId = $tables.list.filter(
|
||||
table =>
|
||||
table.type !== "external" && $datasources.selected === table.sourceId
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@ const { getDatasourceAndQuery } = require("./row/utils")
|
|||
const { invalidateDynamicVariables } = require("../../threads/utils")
|
||||
const { getAppDB } = require("@budibase/backend-core/context")
|
||||
const { events } = require("@budibase/backend-core")
|
||||
const { BUDIBASE_DATASOURCE_TYPE } = require("@budibase/backend-core/constants")
|
||||
const { db: dbCore } = require("@budibase/backend-core")
|
||||
|
||||
exports.fetch = async function (ctx) {
|
||||
// Get internal tables
|
||||
|
@ -52,7 +52,7 @@ exports.fetch = async function (ctx) {
|
|||
delete datasource.config.auth
|
||||
}
|
||||
|
||||
if (datasource.type === BUDIBASE_DATASOURCE_TYPE) {
|
||||
if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) {
|
||||
datasource.entities = internal[datasource._id]
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ exports.destroy = async function (ctx) {
|
|||
const datasource = await db.get(datasourceId)
|
||||
// Delete all queries for the datasource
|
||||
|
||||
if (datasource.type === BUDIBASE_DATASOURCE_TYPE) {
|
||||
if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) {
|
||||
await destroyInternalTablesBySourceId(datasourceId)
|
||||
} else {
|
||||
const queries = await db.allDocs(getQueryParams(datasourceId, null))
|
||||
|
|
|
@ -10,7 +10,7 @@ const { inventoryImport } = require("./inventoryImport")
|
|||
const { employeeImport } = require("./employeeImport")
|
||||
const { jobsImport } = require("./jobsImport")
|
||||
const { expensesImport } = require("./expensesImport")
|
||||
const { BUDIBASE_DATASOURCE_TYPE } = require("@budibase/backend-core/constants")
|
||||
const { db: dbCore } = require("@budibase/backend-core")
|
||||
|
||||
exports.DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs"
|
||||
exports.DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory"
|
||||
|
@ -19,7 +19,7 @@ exports.DEFAULT_EMPLOYEE_TABLE_ID = "ta_bb_employee"
|
|||
exports.DEFAULT_BB_DATASOURCE_ID = "datasource_internal_bb_default"
|
||||
exports.DEFAULT_BB_DATASOURCE = {
|
||||
_id: this.DEFAULT_BB_DATASOURCE_ID,
|
||||
type: BUDIBASE_DATASOURCE_TYPE,
|
||||
type: dbCore.BUDIBASE_DATASOURCE_TYPE,
|
||||
name: "Sample Data",
|
||||
source: "BUDIBASE",
|
||||
config: {},
|
||||
|
|
Loading…
Reference in New Issue