Browse Source

Merge pull request #6498 from Budibase/bug/sev2/dont-allow-json-to-multiselect

Don't allow json columns to swap to multi-select
master
Martin McKeaveney 4 years ago
committed by GitHub
parent
commit
687e9432f0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
  2. 4
      packages/builder/src/constants/backend/index.js

7
packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte

@ -22,10 +22,8 @@
RelationshipTypes,
ALLOWABLE_STRING_OPTIONS,
ALLOWABLE_NUMBER_OPTIONS,
ALLOWABLE_JSON_OPTIONS,
ALLOWABLE_STRING_TYPES,
ALLOWABLE_NUMBER_TYPES,
ALLOWABLE_JSON_TYPES,
SWITCHABLE_TYPES,
} from "constants/backend"
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils"
@ -255,11 +253,6 @@
ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1
) {
return ALLOWABLE_NUMBER_OPTIONS
} else if (
originalName &&
ALLOWABLE_JSON_TYPES.indexOf(field.type) !== -1
) {
return ALLOWABLE_JSON_OPTIONS
} else if (!external) {
return [
...Object.values(fieldDefinitions),

4
packages/builder/src/constants/backend/index.js

@ -158,13 +158,9 @@ export const ALLOWABLE_NUMBER_TYPES = ALLOWABLE_NUMBER_OPTIONS.map(
opt => opt.type
)
export const ALLOWABLE_JSON_OPTIONS = [FIELDS.JSON, FIELDS.ARRAY]
export const ALLOWABLE_JSON_TYPES = ALLOWABLE_JSON_OPTIONS.map(opt => opt.type)
export const SWITCHABLE_TYPES = [
...ALLOWABLE_STRING_TYPES,
...ALLOWABLE_NUMBER_TYPES,
...ALLOWABLE_JSON_TYPES,
]
export const IntegrationTypes = {

Loading…
Cancel
Save