Skip to content

Commit

Permalink
Merge pull request beekeeper-studio#2170 from beekeeper-studio/fix/bo…
Browse files Browse the repository at this point in the history
…olean-options-tabulator

fix tabulator select options
  • Loading branch information
rathboma authored Apr 29, 2024
2 parents 705eb80 + f2926d0 commit dae1741
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/studio/src/components/tableinfo/TableIndexes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default Vue.extend({
title: 'Columns',
field: 'columns',
editable,
editor: 'select',
editor: 'list',
formatter: this.cellFormatter,
editorParams: {
multiselect: true,
Expand Down
6 changes: 3 additions & 3 deletions apps/studio/src/components/tableinfo/TableRelations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default Vue.extend({
field: 'toColumn',
title: "FK Column",
editable,
editor: 'select',
editor: 'list',
editorParams: {
// @ts-expect-error Incorrectly typed
valuesLookup: this.getColumns
Expand All @@ -233,7 +233,7 @@ export default Vue.extend({
{
field: 'onUpdate',
title: "On Update",
editor: 'select',
editor: 'list',
editable,
editorParams: {
values: this.dialectData.constraintActions,
Expand All @@ -244,7 +244,7 @@ export default Vue.extend({
field: 'onDelete',
title: 'On Delete',
editable,
editor: 'select',
editor: 'list',
// @ts-expect-error Bad Type
editorParams: {
values: this.dialectData.constraintActions,
Expand Down
5 changes: 3 additions & 2 deletions apps/studio/src/components/tableinfo/TableSchema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export default Vue.extend({
allowEmpty: false,
values: this.columnTypes,
defaultValue: 'varchar(255)',
showListOnEmpty: true
listOnEmpty: true,
autocomplete: true,
}
const result = [
Expand All @@ -236,7 +237,7 @@ export default Vue.extend({
{
title: 'Type',
field: 'dataType',
editor: 'autocomplete',
editor: 'list',
editorParams: autocompleteOptions,
cellEdited: this.cellEdited,
editable: this.isCellEditable.bind(this, 'alterColumn'),
Expand Down
9 changes: 5 additions & 4 deletions apps/studio/src/components/tableview/TableTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,10 @@ export default Vue.extend({
}
if (column.dataType && /^(bool|boolean)$/i.test(column.dataType)) {
const trueVal = this.dialectData.boolean?.true ?? true
const falseVal = this.dialectData.boolean?.false ?? false
const values = [falseVal, trueVal]
const values = [
{ label: 'false', value: this.dialectData.boolean?.false ?? false },
{ label: 'true', value: this.dialectData.boolean?.true ?? true },
]
if (column.nullable) values.push({ label: '(NULL)', value: null })
result.editorParams['values'] = values
}
Expand Down Expand Up @@ -1036,7 +1037,7 @@ export default Vue.extend({
return 'textarea'
case 'bool':
case 'boolean':
return 'select'
return 'list'
default: return ne
}
},
Expand Down
5 changes: 3 additions & 2 deletions shared/src/components/SchemaBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export default Vue.extend({
allowEmpty: false,
values: columnTypes.map((d) => d.pretty),
defaultValue: defaultColumnType || 'varchar(255)',
showListOnEmpty: true
listOnEmpty: true,
autocomplete: true,
}
},
disabledFeatures() {
Expand All @@ -118,7 +119,7 @@ export default Vue.extend({
{
title: "Type",
field: "dataType",
editor: "autocomplete",
editor: "list",
editorParams: this.autoCompleteOptions,
minWidth: 90,
widthShrink: 1,
Expand Down

0 comments on commit dae1741

Please sign in to comment.