Browse Source

refactor: inflection option to single select, disable edit

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/843/head
Pranav C 3 years ago
parent
commit
16ef1b6e57
  1. 16
      packages/nc-gui/components/createOrEditProject.vue
  2. 2
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

16
packages/nc-gui/components/createOrEditProject.vue

@ -650,14 +650,14 @@
<!-- Inflection - Table name -->
<v-select
v-model="db.meta.inflection.tn"
:disabled="edit"
class="caption"
:label="
$t(
'projects.ext_db.credentials.advanced.inflection.table_name'
)
"
multiple
:items="['camelize']"
:items="['camelize', 'none']"
>
<template #item="{ item }">
<span class="caption">{{ item }}</span>
@ -668,14 +668,14 @@
<!-- Inflection - Column name -->
<v-select
v-model="db.meta.inflection.cn"
:disabled="edit"
class="caption"
:label="
$t(
'projects.ext_db.credentials.advanced.inflection.column_name'
)
"
multiple
:items="['camelize']"
:items="['camelize', 'none']"
>
<template #item="{ item }">
<span class="caption">{{ item }}</span>
@ -1709,8 +1709,8 @@ export default {
tn: 'nc_evolutions',
dbAlias: 'db',
inflection: {
tn: ['camelize'],
cn: ['camelize']
tn: 'camelize',
cn: 'camelize'
},
api: {
type: ''
@ -1759,8 +1759,8 @@ export default {
tn: 'nc_evolutions',
dbAlias,
inflection: {
tn: ['camelize'],
cn: ['camelize']
tn: 'camelize',
cn: 'camelize'
},
api: {
type: ''

2
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -1675,7 +1675,7 @@ export default abstract class BaseApiBuilder<T extends Noco>
if (inflectionFns && inflectionFns !== 'none') {
return inflectionFns
.split(',')
.reduce((out, fn) => inflection[fn](out), name);
.reduce((out, fn) => inflection?.[fn]?.(out) ?? out, name);
}
return name;
}

Loading…
Cancel
Save