Skip to content

Commit 158fc7f

Browse files
committed
added validation to state and action input fields; updated validation message on create component to include route
1 parent 5cf72ca commit 158fc7f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Description:
2727
class="input-add"
2828
no-error-icon
2929
reactive-rules
30-
:rules="[ val => val.length != 0 || 'Please set a component name', val => !Object.keys(this.componentMap).includes(val) || 'A component with this name already exists' ]"
30+
:rules="[ val => val.length != 0 || 'Please set a component name', val => !Object.keys(this.componentMap).includes(val) || 'A component/route with this name already exists' ]"
3131
></q-input>
3232
</form>
3333

src/components/home_sidebar_items/StoreTab/StoreTab.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ Functionality:
2929
label="Add state to store"
3030
dense
3131
class="input-add"
32-
v-on:keyup.delete.stop
32+
no-error-icon
33+
reactive-rules
34+
:rules="[val => !this.userState.includes(val) || 'A state with this name already exists']"
35+
@keyup.delete.stop
3336
>
3437
<template v-slot:append>
3538
<q-btn
@@ -74,7 +77,10 @@ Functionality:
7477
label="Add action to store"
7578
dense
7679
class="input-add"
77-
v-on:keyup.delete.stop
80+
@keyup.delete.stop
81+
no-error-icon
82+
reactive-rules
83+
:rules="[val => !this.userActions.includes(val) || 'An action with this name already exists']"
7884
>
7985
<template v-slot:append>
8086
<q-btn

0 commit comments

Comments
 (0)