lint changes

This commit is contained in:
Mitch-Budibase 2022-01-21 13:12:16 +00:00
parent 7e834f3aa5
commit 9fe8a8c687
4 changed files with 35 additions and 21 deletions

1
.gitignore vendored
View File

@ -95,3 +95,4 @@ hosting/.generated-envoy.dev.yaml
*.sublime-workspace *.sublime-workspace
bin/ bin/
packages/builder/cypress.env.json

View File

@ -1,6 +1,6 @@
import filterTests from "../support/filterTests" import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => { filterTests(["smoke", "all"], () => {
context("Screen Tests", () => { context("Screen Tests", () => {
before(() => { before(() => {
cy.login() cy.login()

View File

@ -1,16 +1,16 @@
const filterTests = (testTags, runTest) => { const filterTests = (testTags, runTest) => {
// testTags is an array of tags // testTags is an array of tags
// runTest is all tests // runTest is all tests
if (Cypress.env('TEST_TAGS')) { if (Cypress.env("TEST_TAGS")) {
const tags = Cypress.env('TEST_TAGS').split('/'); const tags = Cypress.env("TEST_TAGS").split("/")
const found = testTags.some(($testTags) => tags.includes($testTags)); const found = testTags.some($testTags => tags.includes($testTags))
if (found) { if (found) {
runTest(); runTest()
} }
} else { } else {
runTest(); runTest()
} }
}; }
export default filterTests; export default filterTests

View File

@ -153,8 +153,15 @@ export function isIsoDateString(str: string) {
* @param column The column to check, to see if it is a valid relationship. * @param column The column to check, to see if it is a valid relationship.
* @param tableIds The IDs of the tables which currently exist. * @param tableIds The IDs of the tables which currently exist.
*/ */
function shouldCopyRelationship(column: { type: string, tableId?: string }, tableIds: [string]) { function shouldCopyRelationship(
return column.type === FieldTypes.LINK && column.tableId && tableIds.includes(column.tableId) 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 column The column to check for options or boolean type.
* @param fetchedColumn The fetched column to check for the type in the external database. * @param fetchedColumn The fetched column to check for the type in the external database.
*/ */
function shouldCopySpecialColumn(column: { type: string }, fetchedColumn: { type: string } | undefined) { function shouldCopySpecialColumn(
return column.type === FieldTypes.OPTIONS || column: { type: string },
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && column.type === FieldTypes.BOOLEAN) fetchedColumn: { type: string } | undefined
) {
return (
column.type === FieldTypes.OPTIONS ||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
column.type === FieldTypes.BOOLEAN)
)
} }
/** /**