From 0ac2edf69d5bc51b957ba8dd1afb51206405c140 Mon Sep 17 00:00:00 2001 From: les Date: Wed, 4 Nov 2020 10:55:30 +0100 Subject: [PATCH] fix WhereInput --- components/admin/Theme.vue | 4 +--- package.json | 16 ++++++++-------- pages/add/HourInput.vue | 3 ++- pages/add/ImportDialog.vue | 13 ++++++------- pages/add/WhereInput.vue | 23 +++++++++++++++-------- pages/add/_edit.vue | 4 ++-- 6 files changed, 34 insertions(+), 29 deletions(-) diff --git a/components/admin/Theme.vue b/components/admin/Theme.vue index ffd742ef..85b2199c 100644 --- a/components/admin/Theme.vue +++ b/components/admin/Theme.vue @@ -131,9 +131,8 @@ export default { }, openLinkModal () { // this.link = { href: '', label: '' } - // console.error(this.$refs) this.linkModal = true - this.$nextTick( () => this.$refs.linkModalForm.reset() ) + this.$nextTick(() => this.$refs.linkModalForm.reset()) }, addFooterLink () { const link = Object.assign({}, this.link) @@ -151,7 +150,6 @@ export default { editFooterLink (item) { this.link = { href: item.href, label: item.label } this.linkModal = true - }, async uploadLogo (file) { const formData = new FormData() diff --git a/package.json b/package.json index 23700ecf..e419888a 100644 --- a/package.json +++ b/package.json @@ -40,14 +40,14 @@ "cross-env": "^7.0.2", "date-fns": "^2.16.1", "dayjs": "^1.9.4", - "dompurify": "^2.2.0", + "dompurify": "^2.2.2", "email-templates": "^7.1.2", "express": "^4.17.1", "express-oauth-server": "^2.0.0", "fs": "^0.0.1-security", "http-signature": "^1.3.5", "ical.js": "^1.4.0", - "ics": "^2.26.0", + "ics": "^2.26.1", "inquirer": "^7.3.3", "jsdom": "^16.4.0", "jsonwebtoken": "^8.5.1", @@ -61,7 +61,7 @@ "multer": "^1.4.2", "nuxt": "^2.14.7", "nuxt-express-module": "^0.0.11", - "pg": "^8.4.1", + "pg": "^8.4.2", "sequelize": "^6.3.5", "sequelize-cli": "^6.2.0", "sharp": "^0.26.2", @@ -79,9 +79,9 @@ "@nuxtjs/eslint-config": "^4.0.0", "@nuxtjs/vuetify": "^1.11.2", "babel-eslint": "^10.1.0", - "eslint": "^7.12.0", - "eslint-config-prettier": "^6.14.0", - "eslint-config-standard": "^15.0.0", + "eslint": "^7.12.1", + "eslint-config-prettier": "^6.15.0", + "eslint-config-standard": "^16.0.1", "eslint-loader": "^4.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": ">=11.1.0", @@ -94,8 +94,8 @@ "nodemon": "^2.0.6", "prettier": "^2.1.2", "pug-plain-loader": "^1.0.0", - "sass": "^1.27.0", - "sass-loader": "^10.0.4", + "sass": "^1.28.0", + "sass-loader": "^10.0.5", "vue-cli-plugin-vuetify": "~2.0.7", "vuetify-loader": "^1.3.0", "webpack-cli": "^4.1.0" diff --git a/pages/add/HourInput.vue b/pages/add/HourInput.vue index 525ebf2b..74cfc41b 100644 --- a/pages/add/HourInput.vue +++ b/pages/add/HourInput.vue @@ -14,6 +14,7 @@ template(v-slot:activator='{ on }') v-text-field( :label="$t('event.from')" + prepend-icon='mdi-clock' :rules="[$validators.required('event.from')]" :value='value.start' v-on='on' @@ -40,6 +41,7 @@ min-width="290px") template(v-slot:activator='{ on }') v-text-field( + prepend-icon='mdi-clock' :label="$t('event.due')" :value='value.end' v-on='on' @@ -61,7 +63,6 @@ export default { value: { type: Object, default: () => { } } }, data () { - // console.error('sono dentro data ', this.value) return { // time: { start: this.value.start, end: this.value.end }, time: {}, diff --git a/pages/add/ImportDialog.vue b/pages/add/ImportDialog.vue index a61cfaa7..b7594218 100644 --- a/pages/add/ImportDialog.vue +++ b/pages/add/ImportDialog.vue @@ -25,7 +25,6 @@ v-btn(@click='importGeneric' :loading='loading' :disabled='loading' color='primary') {{$t('common.import')}} - \ No newline at end of file + diff --git a/pages/add/WhereInput.vue b/pages/add/WhereInput.vue index 819c1fda..035b2eae 100644 --- a/pages/add/WhereInput.vue +++ b/pages/add/WhereInput.vue @@ -6,16 +6,18 @@ :hint="$t('event.where_description')" :hide-no-data="!place._name" :search-input.sync="place._name" + prepend-icon='mdi-map-marker' persistent-hint :value="value.name" :items="places" item-text='name' @change='selectPlace') template(v-slot:no-data) - v-list-item - p Create {{place._name}} + v-list-item(@click='createPlace') + v-list-item-content Create {{place._name}} v-text-field.col-md-6(ref='address' + prepend-icon='mdi-map' :disabled='disableAddress' :rules="[$validators.required('common.address')]" :label="$t('common.address')" @@ -42,21 +44,26 @@ export default { }, methods: { selectPlace (p) { - const place = p && this.places.find(place => place.id === p.id) - if (place && place.address) { + if (typeof p === 'object') { + if (p === null) { return } this.place.name = p.name - this.place.address = place.address + this.place.address = p.address this.disableAddress = true - } else { + } else { // this is a new place + this.place.name = p this.disableAddress = false this.$refs.place.blur() this.$refs.address.focus() } - this.$emit('input', this.place) + this.$emit('input', { ...this.place }) }, changeAddress (v) { this.place.address = v - this.$emit('input', this.place) + this.$emit('input', { ...this.place }) + }, + createPlace (v) { + this.$refs.place.blur() + this.$refs.address.focus() } } } diff --git a/pages/add/_edit.vue b/pages/add/_edit.vue index 1d630305..205bb3a8 100644 --- a/pages/add/_edit.vue +++ b/pages/add/_edit.vue @@ -24,6 +24,7 @@ :value = 'event.title' :rules="[$validators.required('common.title')]" :hint="$t('event.what_description')" + prepend-icon='mdi-format-title' :label="$t('common.title')" autofocus ref='title') @@ -53,6 +54,7 @@ //- tags v-combobox.col-6.mt-3(v-model='event.tags' + prepend-icon="mdi-tag-multiple" chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint :delimiters="[',', ' ']" :items="tags.map(t => t.tag)" @@ -169,7 +171,6 @@ export default { this.loading = true let start_datetime, end_datetime const [start_hour, start_minute] = this.time.start.split(':') - console.error('TIME: hour', start_hour, this.time) if (!this.time.end) { this.time.end = (Number(start_hour) + 2) + ':' + start_minute } @@ -183,7 +184,6 @@ export default { end_datetime = dayjs(this.date.date[1]) .set('hour', end_hour).set('minute', end_minute) } else if (this.date.type === 'normal') { - console.error('dentro type normal', this.date.type) start_datetime = dayjs(this.date.date).set('hour', start_hour).set('minute', start_minute) end_datetime = dayjs(this.date.date).set('hour', end_hour).set('minute', end_minute) if (end_hour < start_hour) {