Skip to content

Commit

Permalink
fix: add text rules for add buld note
Browse files Browse the repository at this point in the history
  • Loading branch information
sbgap committed Apr 29, 2024
1 parent 11e8845 commit 9afcaca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
:counter="maxNoteLength"
:maxlength="maxNoteLength"
:minlength="minNoteLength"
:rules="textRules"
:rules="noteRules"
:label="$t('AddNote')"
required
/>
Expand Down Expand Up @@ -536,7 +536,7 @@ export default {
Snackbar
},
props: [],
data: () => ({
data: vm => ({
hasFocus: false,
menu: false,
message: false,
Expand All @@ -545,6 +545,12 @@ export default {
drawer: false,
noteText: '',
showNote: false,
maxNoteLength: 200,
minNoteLength: 0,
noteRules: [
v => !!v || i18n.t('TextIsRequired'),
v => (v && v.length <= vm.maxNoteLength) || `${i18n.t('TextMustBeLessThan')} ${vm.maxNoteLength} ${i18n.t('characters')}`
],
navbar: {
signin: { icon: 'account_circle', text: i18n.t('SignIn'), path: '/login' }
},
Expand Down Expand Up @@ -884,7 +890,7 @@ export default {
Promise.all(this.selected.map(a => this.$store.dispatch('alerts/addNote', [a.id, this.noteText]))).then(() => {
this.clearSelected()
this.$store.dispatch('alerts/getAlerts')
this.toogleNote()
this.toggleNote()
}) : this.toggleNote()
},
bulkDeleteAlert() {
Expand Down

0 comments on commit 9afcaca

Please sign in to comment.