Browse Source

Merge pull request #1283 from nocodb/chore/table-validation

fix: enforce validation if table name invalid
pull/1292/head
Raju Udava 3 years ago committed by GitHub
parent
commit
d774bdec1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nc-gui/components/utils/dlgTableCreate.vue

7
packages/nc-gui/components/utils/dlgTableCreate.vue

@ -7,6 +7,7 @@
@keydown.enter="$emit('create', table)" @keydown.enter="$emit('create', table)"
> >
<v-card class="elevation-1 backgroundColor nc-create-table-card"> <v-card class="elevation-1 backgroundColor nc-create-table-card">
<v-form ref="form" v-model="valid">
<v-card-title class="primary subheading white--text py-2"> <v-card-title class="primary subheading white--text py-2">
Create A New Table Create A New Table
</v-card-title> </v-card-title>
@ -105,7 +106,7 @@
Cancel Cancel
</v-btn> </v-btn>
<v-btn <v-btn
:disabled="!(table.name && table.name.length) || !(table.alias && table.alias.length)" :disabled="!(table.name && table.name.length) || !(table.alias && table.alias.length) || !valid"
color="primary" color="primary"
class="nc-create-table-submit" class="nc-create-table-submit"
@click="$emit('create',table)" @click="$emit('create',table)"
@ -113,6 +114,7 @@
Submit Submit
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
</v-form>
</v-card> </v-card>
</v-dialog> </v-dialog>
</template> </template>
@ -134,7 +136,8 @@ export default {
'created_at', 'created_at',
'updated_at'] 'updated_at']
}, },
validateTableName validateTableName,
valid: false
} }
}, },
computed: { computed: {

Loading…
Cancel
Save