Import lodash modules

This commit is contained in:
Adria Navarro 2023-07-27 21:36:32 +02:00
parent 6d5eef4e42
commit b9820f94e6
15 changed files with 19 additions and 18 deletions

@ -1 +1 @@
Subproject commit 628ea63036ece71f25d6f754a259bb4255b23325 Subproject commit 6fa0bb7738b72d322ca10e63ed7fe8c4f07b7c68

View File

@ -9,7 +9,7 @@ import { context } from "@budibase/backend-core"
import { Table, Row } from "@budibase/types" import { Table, Row } from "@budibase/types"
import * as linkRows from "../../../db/linkedRows" import * as linkRows from "../../../db/linkedRows"
import sdk from "../../../sdk" import sdk from "../../../sdk"
import { isEqual } from "lodash" import isEqual from "lodash/isEqual"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
/** /**

View File

@ -2,7 +2,8 @@ import { FieldTypes, FormulaTypes } from "../../../constants"
import { clearColumns } from "./utils" import { clearColumns } from "./utils"
import { doesContainStrings } from "@budibase/string-templates" import { doesContainStrings } from "@budibase/string-templates"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { isEqual, uniq } from "lodash" import isEqual from "lodash/isEqual"
import uniq from "lodash/uniq"
import { updateAllFormulasInTable } from "../row/staticFormula" import { updateAllFormulasInTable } from "../row/staticFormula"
import { context } from "@budibase/backend-core" import { context } from "@budibase/backend-core"
import { FieldSchema, Table } from "@budibase/types" import { FieldSchema, Table } from "@budibase/types"

View File

@ -11,7 +11,7 @@ import {
import { runStaticFormulaChecks } from "./bulkFormula" import { runStaticFormulaChecks } from "./bulkFormula"
import { Table } from "@budibase/types" import { Table } from "@budibase/types"
import { quotas } from "@budibase/pro" import { quotas } from "@budibase/pro"
import { isEqual } from "lodash" import isEqual from "lodash/isEqual"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import sdk from "../../../sdk" import sdk from "../../../sdk"

View File

@ -1,6 +1,6 @@
import { parse, isSchema, isRows } from "../../../utilities/schema" import { parse, isSchema, isRows } from "../../../utilities/schema"
import { getRowParams, generateRowID, InternalTables } from "../../../db/utils" import { getRowParams, generateRowID, InternalTables } from "../../../db/utils"
import { isEqual } from "lodash" import isEqual from "lodash/isEqual"
import { import {
AutoFieldSubTypes, AutoFieldSubTypes,
FieldTypes, FieldTypes,

View File

@ -17,7 +17,8 @@ import {
} from "@budibase/types" } from "@budibase/types"
import { builderSocket } from "../../../websockets" import { builderSocket } from "../../../websockets"
const { cloneDeep, isEqual } = require("lodash") const cloneDeep = require("lodash/cloneDeep")
import isEqual from "lodash/isEqual"
export async function fetch(ctx: Ctx) { export async function fetch(ctx: Ctx) {
ctx.body = await getViews() ctx.body = await getViews()

View File

@ -1,4 +1,4 @@
import { merge } from "lodash" import merge from "lodash/merge"
import env from "../environment" import env from "../environment"
export const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1" export const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1"

View File

@ -8,10 +8,10 @@ import {
getLinkedTableIDs, getLinkedTableIDs,
getLinkedTable, getLinkedTable,
} from "./linkUtils" } from "./linkUtils"
import { flatten } from "lodash" import flatten from "lodash/flatten"
import { FieldTypes } from "../../constants" import { FieldTypes } from "../../constants"
import { getMultiIDParams, USER_METDATA_PREFIX } from "../utils" import { getMultiIDParams, USER_METDATA_PREFIX } from "../utils"
import { partition } from "lodash" import partition from "lodash/partition"
import { getGlobalUsersFromMetadata } from "../../utilities/global" import { getGlobalUsersFromMetadata } from "../../utilities/global"
import { processFormulas } from "../../utilities/rowProcessor" import { processFormulas } from "../../utilities/rowProcessor"
import { context } from "@budibase/backend-core" import { context } from "@budibase/backend-core"

View File

@ -17,7 +17,7 @@ import oracle from "./oracle"
import { SourceName, Integration, PluginType } from "@budibase/types" import { SourceName, Integration, PluginType } from "@budibase/types"
import { getDatasourcePlugin } from "../utilities/fileSystem" import { getDatasourcePlugin } from "../utilities/fileSystem"
import env from "../environment" import env from "../environment"
import { cloneDeep } from "lodash" import cloneDeep from "lodash/cloneDeep"
import sdk from "../sdk" import sdk from "../sdk"
const DEFINITIONS: Record<SourceName, Integration | undefined> = { const DEFINITIONS: Record<SourceName, Integration | undefined> = {

View File

@ -11,7 +11,7 @@ import {
RestBasicAuthConfig, RestBasicAuthConfig,
RestBearerAuthConfig, RestBearerAuthConfig,
} from "@budibase/types" } from "@budibase/types"
import { get } from "lodash" import get from "lodash/get"
import * as https from "https" import * as https from "https"
import qs from "querystring" import qs from "querystring"
import fetch from "node-fetch" import fetch from "node-fetch"

View File

@ -15,7 +15,7 @@ import {
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { getEnvironmentVariables } from "../../utils" import { getEnvironmentVariables } from "../../utils"
import { getDefinitions, getDefinition } from "../../../integrations" import { getDefinitions, getDefinition } from "../../../integrations"
import _ from "lodash" import merge from "lodash/merge"
import { import {
BudibaseInternalDB, BudibaseInternalDB,
getDatasourceParams, getDatasourceParams,
@ -227,7 +227,7 @@ export function mergeConfigs(update: Datasource, old: Datasource) {
} }
if (old.config?.auth) { if (old.config?.auth) {
update.config = _.merge(old.config, update.config) update.config = merge(old.config, update.config)
} }
// update back to actual passwords for everything else // update back to actual passwords for everything else

View File

@ -14,7 +14,6 @@ import {
import datasources from "../datasources" import datasources from "../datasources"
import { populateExternalTableSchemas, isEditableColumn } from "./validation" import { populateExternalTableSchemas, isEditableColumn } from "./validation"
import sdk from "../../../sdk" import sdk from "../../../sdk"
import _ from "lodash"
async function getAllInternalTables(db?: Database): Promise<Table[]> { async function getAllInternalTables(db?: Database): Promise<Table[]> {
if (!db) { if (!db) {

View File

@ -3,7 +3,7 @@ import { TableSchema, UIFieldMetadata, View, ViewV2 } from "@budibase/types"
import sdk from "../../../sdk" import sdk from "../../../sdk"
import * as utils from "../../../db/utils" import * as utils from "../../../db/utils"
import _ from "lodash" import merge from "lodash/merge"
export async function get(viewId: string): Promise<ViewV2 | undefined> { export async function get(viewId: string): Promise<ViewV2 | undefined> {
const { tableId } = utils.extractViewInfoFromID(viewId) const { tableId } = utils.extractViewInfoFromID(viewId)
@ -103,7 +103,7 @@ function enrichViewV2Schema(
delete tableFieldSchema.order delete tableFieldSchema.order
} }
result[columnName] = _.merge(tableFieldSchema, columnUIMetadata) result[columnName] = merge(tableFieldSchema, columnUIMetadata)
} }
return result return result
} }

View File

@ -6,7 +6,7 @@ import {
getUserMetadataParams, getUserMetadataParams,
InternalTables, InternalTables,
} from "../../db/utils" } from "../../db/utils"
import { isEqual } from "lodash" import isEqual from "lodash/isEqual"
import { ContextUser, UserMetadata, User, Database } from "@budibase/types" import { ContextUser, UserMetadata, User, Database } from "@budibase/types"
export function combineMetadataAndUser( export function combineMetadataAndUser(

View File

@ -9,7 +9,7 @@ import {
import env from "../environment" import env from "../environment"
import { groups } from "@budibase/pro" import { groups } from "@budibase/pro"
import { UserCtx, ContextUser, User, UserGroup } from "@budibase/types" import { UserCtx, ContextUser, User, UserGroup } from "@budibase/types"
import { cloneDeep } from "lodash" import cloneDeep from "lodash/cloneDeep"
export function updateAppRole( export function updateAppRole(
user: ContextUser, user: ContextUser,