diff --git a/packages/builder/cypress/support/queryLevelTransformerFunction.js b/packages/builder/cypress/support/queryLevelTransformerFunction.js deleted file mode 100644 index 8ad3e573d8..0000000000 --- a/packages/builder/cypress/support/queryLevelTransformerFunction.js +++ /dev/null @@ -1,14 +0,0 @@ -// eslint-disable-next-line no-undef -const breweries = data -const totals = {} - -for (let brewery of breweries) { - const state = brewery.state - if (totals[state] == null) { - totals[state] = 1 - } else { - totals[state]++ - } -} -const entries = Object.entries(totals) -return entries.map(([state, count]) => ({ state, count })) diff --git a/packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js b/packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js deleted file mode 100644 index 50f3da7099..0000000000 --- a/packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js +++ /dev/null @@ -1,31 +0,0 @@ -// eslint-disable-next-line no-undef -const breweries = data -const totals = {} -for (let brewery of breweries) { - const state = brewery.state - if (totals[state] == null) { - totals[state] = 1 - } else { - totals[state]++ - } -} -const stateCodes = { - texas: "tx", - colorado: "co", - florida: "fl", - iwoa: "ia", - louisiana: "la", - california: "ca", - pennsylvania: "pa", - georgia: "ga", - "new hampshire": "nh", - virginia: "va", - michigan: "mi", - maryland: "md", - ohio: "oh", -} -const entries = Object.entries(totals) -return entries.map(([state, count]) => { - stateCodes[state.toLowerCase()] - return { state, count, flag: "http://flags.ox3.in/svg/us/${stateCode}.svg" } -}) diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts index b8c96efffe..b9e643e26a 100644 --- a/packages/server/src/integrations/utils.ts +++ b/packages/server/src/integrations/utils.ts @@ -153,8 +153,15 @@ export function isIsoDateString(str: string) { * @param column The column to check, to see if it is a valid relationship. * @param tableIds The IDs of the tables which currently exist. */ -function shouldCopyRelationship(column: { type: string, tableId?: string }, tableIds: [string]) { - return column.type === FieldTypes.LINK && column.tableId && tableIds.includes(column.tableId) +function shouldCopyRelationship( + column: { type: string; tableId?: string }, + tableIds: [string] +) { + return ( + column.type === FieldTypes.LINK && + column.tableId && + tableIds.includes(column.tableId) + ) } /** @@ -165,9 +172,15 @@ function shouldCopyRelationship(column: { type: string, tableId?: string }, tabl * @param column The column to check for options or boolean type. * @param fetchedColumn The fetched column to check for the type in the external database. */ -function shouldCopySpecialColumn(column: { type: string }, fetchedColumn: { type: string } | undefined) { - return column.type === FieldTypes.OPTIONS || - ((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && column.type === FieldTypes.BOOLEAN) +function shouldCopySpecialColumn( + column: { type: string }, + fetchedColumn: { type: string } | undefined +) { + return ( + column.type === FieldTypes.OPTIONS || + ((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && + column.type === FieldTypes.BOOLEAN) + ) } /**