Browse Source

fix: Removed inflection and auto camel casing from nc-gui

pull/2553/head
Mustafa 2 years ago
parent
commit
01657f53fc
  1. 6
      packages/nc-gui/components/utils/DlgTableCreate.vue
  2. 14
      packages/nc-gui/package-lock.json
  3. 1
      packages/nc-gui/package.json
  4. 3
      packages/nocodb/src/lib/meta/api/tableApis.ts

6
packages/nc-gui/components/utils/DlgTableCreate.vue

@ -154,8 +154,6 @@
</template>
<script>
import inflection from 'inflection'
import { validateTableName } from '~/helpers'
export default {
@ -196,8 +194,8 @@ export default {
}
},
watch: {
'table.alias'(v) {
this.$set(this.table, 'name', `${this.projectPrefix || ''}${inflection.underscore(v.replace(/^\s+|\s+$/g, m => new Array(m.length).fill('_').join('')))}`)
'table.alias'(alias) {
this.$set(this.table, 'name', `${this.projectPrefix || ''}${alias}`)
}
},
created() {

14
packages/nc-gui/package-lock.json generated

@ -21,7 +21,6 @@
"file-saver": "^2.0.5",
"fix-path": "^3.0.0",
"httpsnippet": "^2.0.0",
"inflection": "^1.12.0",
"jsep": "^1.3.6",
"locale-codes": "^1.3.1",
"material-design-icons-iconfont": "^5.0.1",
@ -9033,14 +9032,6 @@
"resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
"integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A=="
},
"node_modules/inflection": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.2.tgz",
"integrity": "sha512-cmZlljCRTBFouT8UzMzrGcVEvkv6D/wBdcdKG7J1QH5cXjtU75Dm+P27v9EKu/Y43UYyCJd1WC4zLebRrC8NBw==",
"engines": [
"node >= 0.4.0"
]
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@ -24895,11 +24886,6 @@
"resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
"integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A=="
},
"inflection": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.2.tgz",
"integrity": "sha512-cmZlljCRTBFouT8UzMzrGcVEvkv6D/wBdcdKG7J1QH5cXjtU75Dm+P27v9EKu/Y43UYyCJd1WC4zLebRrC8NBw=="
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",

1
packages/nc-gui/package.json

@ -24,7 +24,6 @@
"file-saver": "^2.0.5",
"fix-path": "^3.0.0",
"httpsnippet": "^2.0.0",
"inflection": "^1.12.0",
"jsep": "^1.3.6",
"locale-codes": "^1.3.1",
"material-design-icons-iconfont": "^5.0.1",

3
packages/nocodb/src/lib/meta/api/tableApis.ts

@ -103,9 +103,6 @@ export async function tableCreate(req: Request<any, any, TableReqType>, res) {
}
}
// Cleanup table name
req.body.table_name = req.body.table_name.toLowerCase().replace(/ /g, '_');
// validate table name
if (/^\s+|\s+$/.test(req.body.table_name)) {
NcError.badRequest(

Loading…
Cancel
Save