diff --git a/fda-ui/components/TableSchema.vue b/fda-ui/components/TableSchema.vue index 5d4577bc1c749a70f05ecae53ff63ddbebf3588e..93a96e92cba16e55bf8da6bae790820d86820e43 100644 --- a/fda-ui/components/TableSchema.vue +++ b/fda-ui/components/TableSchema.vue @@ -14,7 +14,7 @@ v-model="c.name" required :rules="[v => !!v || $t('Required')]" - :error-messages="needsSequence && c.name === 'id' ? ['Column with this name already present'] : []" + :error-messages="needsSequence && c.name === 'id' ? ['Column needs to be declared as primary key'] : []" label="Name *" /> </v-col> <v-col cols="2"> diff --git a/fda-ui/pages/container/_container_id/database/_database_id/table/create.vue b/fda-ui/pages/container/_container_id/database/_database_id/table/create.vue index 2345caf0abdf821f9c8fbe84de81b75622ef5d02..248ba2e426370e19213ae43897f542be6c06dae4 100644 --- a/fda-ui/pages/container/_container_id/database/_database_id/table/create.vue +++ b/fda-ui/pages/container/_container_id/database/_database_id/table/create.vue @@ -20,8 +20,8 @@ name="name" label="Table Name *" autocomplete="off" - :rules="[v => !!v || $t('Required')]" - :error-messages="!validTableName ? ['Table with this name exists!'] : []" + :rules="[v => notEmpty(v) || $t('Required')]" + :error-messages="!validTableName ? ['Table with this name exists'] : []" required /> </v-col> </v-row> @@ -32,7 +32,7 @@ name="description" label="Description *" autocomplete="off" - :rules="[v => !!v || $t('Required')]" + :rules="[v => notEmpty(v) || $t('Required')]" required /> </v-col> </v-row> @@ -59,6 +59,7 @@ <script> import TableSchema from '@/components/TableSchema' +const { notEmpty } = require('@/utils') export default { components: { TableSchema @@ -113,6 +114,7 @@ export default { this.listTables() }, methods: { + notEmpty, submit () { this.$refs.form.validate() },