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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
0 additions and
11 deletions
-
packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte
-
packages/builder/src/constants/backend/index.js
|
|
@ -22,10 +22,8 @@ |
|
|
RelationshipTypes, |
|
|
RelationshipTypes, |
|
|
ALLOWABLE_STRING_OPTIONS, |
|
|
ALLOWABLE_STRING_OPTIONS, |
|
|
ALLOWABLE_NUMBER_OPTIONS, |
|
|
ALLOWABLE_NUMBER_OPTIONS, |
|
|
ALLOWABLE_JSON_OPTIONS, |
|
|
|
|
|
ALLOWABLE_STRING_TYPES, |
|
|
ALLOWABLE_STRING_TYPES, |
|
|
ALLOWABLE_NUMBER_TYPES, |
|
|
ALLOWABLE_NUMBER_TYPES, |
|
|
ALLOWABLE_JSON_TYPES, |
|
|
|
|
|
SWITCHABLE_TYPES, |
|
|
SWITCHABLE_TYPES, |
|
|
} from "constants/backend" |
|
|
} from "constants/backend" |
|
|
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils" |
|
|
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils" |
|
|
@ -255,11 +253,6 @@ |
|
|
ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1 |
|
|
ALLOWABLE_NUMBER_TYPES.indexOf(field.type) !== -1 |
|
|
) { |
|
|
) { |
|
|
return ALLOWABLE_NUMBER_OPTIONS |
|
|
return ALLOWABLE_NUMBER_OPTIONS |
|
|
} else if ( |
|
|
|
|
|
originalName && |
|
|
|
|
|
ALLOWABLE_JSON_TYPES.indexOf(field.type) !== -1 |
|
|
|
|
|
) { |
|
|
|
|
|
return ALLOWABLE_JSON_OPTIONS |
|
|
|
|
|
} else if (!external) { |
|
|
} else if (!external) { |
|
|
return [ |
|
|
return [ |
|
|
...Object.values(fieldDefinitions), |
|
|
...Object.values(fieldDefinitions), |
|
|
|
|
|
@ -158,13 +158,9 @@ export const ALLOWABLE_NUMBER_TYPES = ALLOWABLE_NUMBER_OPTIONS.map( |
|
|
opt => opt.type |
|
|
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 = [ |
|
|
export const SWITCHABLE_TYPES = [ |
|
|
...ALLOWABLE_STRING_TYPES, |
|
|
...ALLOWABLE_STRING_TYPES, |
|
|
...ALLOWABLE_NUMBER_TYPES, |
|
|
...ALLOWABLE_NUMBER_TYPES, |
|
|
...ALLOWABLE_JSON_TYPES, |
|
|
|
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
export const IntegrationTypes = { |
|
|
export const IntegrationTypes = { |
|
|
|