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 --> <!-- Inflection - Table name -->
<v-select <v-select
v-model="db.meta.inflection.tn" v-model="db.meta.inflection.tn"
:disabled="edit"
class="caption" class="caption"
:label=" :label="
$t( $t(
'projects.ext_db.credentials.advanced.inflection.table_name' 'projects.ext_db.credentials.advanced.inflection.table_name'
) )
" "
multiple :items="['camelize', 'none']"
:items="['camelize']"
> >
<template #item="{ item }"> <template #item="{ item }">
<span class="caption">{{ item }}</span> <span class="caption">{{ item }}</span>
@ -668,14 +668,14 @@
<!-- Inflection - Column name --> <!-- Inflection - Column name -->
<v-select <v-select
v-model="db.meta.inflection.cn" v-model="db.meta.inflection.cn"
:disabled="edit"
class="caption" class="caption"
:label=" :label="
$t( $t(
'projects.ext_db.credentials.advanced.inflection.column_name' 'projects.ext_db.credentials.advanced.inflection.column_name'
) )
" "
multiple :items="['camelize', 'none']"
:items="['camelize']"
> >
<template #item="{ item }"> <template #item="{ item }">
<span class="caption">{{ item }}</span> <span class="caption">{{ item }}</span>
@ -1709,8 +1709,8 @@ export default {
tn: 'nc_evolutions', tn: 'nc_evolutions',
dbAlias: 'db', dbAlias: 'db',
inflection: { inflection: {
tn: ['camelize'], tn: 'camelize',
cn: ['camelize'] cn: 'camelize'
}, },
api: { api: {
type: '' type: ''
@ -1759,8 +1759,8 @@ export default {
tn: 'nc_evolutions', tn: 'nc_evolutions',
dbAlias, dbAlias,
inflection: { inflection: {
tn: ['camelize'], tn: 'camelize',
cn: ['camelize'] cn: 'camelize'
}, },
api: { api: {
type: '' 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') { if (inflectionFns && inflectionFns !== 'none') {
return inflectionFns return inflectionFns
.split(',') .split(',')
.reduce((out, fn) => inflection[fn](out), name); .reduce((out, fn) => inflection?.[fn]?.(out) ?? out, name);
} }
return name; return name;
} }

Loading…
Cancel
Save