Merge pull request #27 from paoloar77/Booking_Events

Booking events
This commit is contained in:
Paolo Arena
2019-10-10 21:09:44 +02:00
committed by GitHub
22 changed files with 15625 additions and 217 deletions

7
src/boot/.directory Normal file
View File

@@ -0,0 +1,7 @@
[Dolphin]
Timestamp=2019,10,10,17,25,7
Version=4
ViewMode=1
[Settings]
HiddenFilesShown=true

View File

@@ -1,5 +0,0 @@
import axios from 'axios'
export default ({ Vue }) => {
Vue.prototype.$axios = axios
}

View File

@@ -1,5 +0,0 @@
import Dialog from 'quasar'
export default ({ Vue }) => {
Vue.use(Dialog)
}

View File

@@ -1,10 +0,0 @@
import Vue from 'vue'
import { Vue2Dragula } from 'vue2-dragula'
export default ({ Vue }) => {
Vue.use(Vue2Dragula, {
logging: {
service: false // to only log methods in service (DragulaService)
}
})
}

View File

@@ -1,7 +0,0 @@
// import something here
import errorHandler from '../error-handler'
// leave the export, even if you don't use it
export default ({ app, router, Vue }) => {
// something to do
Vue.prototype.$errorHandler = errorHandler
}

View File

@@ -1,8 +0,0 @@
import globalroutines from '../globalroutines'
export default ({ app, router, store, Vue }) => {
// something to do
Vue.prototype.$globalroutines = globalroutines
}

View File

@@ -1,89 +0,0 @@
// import something here
// leave the export, even if you don't use it
export default ({ app, router, store, Vue }) => {
// something to do
// ******************************************
// *** Per non permettere di accedere alle pagine in cui è necessario essere Loggati ! ***
// ******************************************
// Creates a `nextMiddleware()` function which not only
// runs the default `next()` callback but also triggers
// the subsequent Middleware function.
function nextFactory(context, middleware, index) {
const subsequentMiddleware = middleware[index]
// If no subsequent Middleware exists,
// the default `next()` callback is returned.
if (!subsequentMiddleware) return context.next
return (...parameters) => {
// Run the default Vue Router `next()` callback first.
context.next(...parameters)
// Then run the subsequent Middleware with a new
// `nextMiddleware()` callback.
const nextMiddleware = nextFactory(context, middleware, index + 1)
subsequentMiddleware({ ...context, next: nextMiddleware })
};
}
router.beforeEach((to, from, next) => {
if (to.meta.middleware) {
const middleware = Array.isArray(to.meta.middleware)
? to.meta.middleware
: [to.meta.middleware];
const context = {
from,
next,
router,
to,
};
const nextMiddleware = nextFactory(context, middleware, 1)
return middleware[0]({ ...context, next: nextMiddleware })
}
return next()
})
/*router.beforeEach((to, from, next) => {
var accessToken = store.state.session.userSession.accessToken
// ESTANDO LOGEADO
if (accessToken) {
// SE PERMITE IR DE AREA PUBLICA A PRIVADA
if (!from.matched.some(record => record.meta.requiresAuth) && to.matched.some(record => record.meta.requiresAuth)) {
next()
}
// SE PERMITE IR DE UNA AREA PRIVADA A OTRA PRIVADA
if (from.matched.some(record => record.meta.requiresAuth) && to.matched.some(record => record.meta.requiresAuth)) {
next()
}
// NO SE PERMITE IR A UN AREA PUBLICA DESDE UN AREA PRIVADA
if (from.matched.some(record => record.meta.requiresAuth) && !to.matched.some(record => record.meta.requiresAuth)) {
next(false)
}
// SE REDIRIJE AL PANEL
if (!from.matched.some(record => record.meta.requiresAuth) && !to.matched.some(record => record.meta.requiresAuth)) {
next('/Panel')
}
// NO ESTA LOGEADO
} else {
// SE PERMITE IR DE UNA AREA PUBLICA A OTRA PUBLICA
if (!from.matched.some(record => record.meta.requiresAuth) && !to.matched.some(record => record.meta.requiresAuth)) {
next()
}
// SE PERMITE IR DE UNA AREA PRIVADA A UNA PUBLICA (LOGOUT)
if (from.matched.some(record => record.meta.requiresAuth) && !to.matched.some(record => record.meta.requiresAuth)) {
next()
}
// NO SE PERMITE IR DE UNA AREA PUBLICA A UNA PRIVADA
if (!from.matched.some(record => record.meta.requiresAuth) && to.matched.some(record => record.meta.requiresAuth)) {
// REDIRIGIR A LOGIN
next('/')
}
}
})*/
}

View File

@@ -1,9 +0,0 @@
// import something here
import myconfig from '../myconfig'
// leave the export, even if you don't use it
export default ({ Vue }) => {
//Vue.use(myconfig);
// something to do
Vue.prototype.$myconfig = myconfig
}

View File

@@ -1,5 +0,0 @@
import VeeValidate from "vee-validate";
export default ({ Vue }) => {
Vue.use(VeeValidate, { inject: false })
}

View File

@@ -1,46 +0,0 @@
// src/boot/i18n.js
import VueI18n from 'vue-i18n';
import messages from 'src/statics/i18n';
import { tools } from "../store/Modules/tools";
export default ({ app, store, Vue }) => {
Vue.use(VueI18n);
// Vue.config.lang = process.env.LANG_DEFAULT;
let mylang = tools.getItemLS(tools.localStorage.lang)
if ((navigator) && (mylang === '')) {
mylang = navigator.language
console.log(`LANG NAVIGATOR ${mylang}`)
}
if (mylang === '')
mylang = process.env.LANG_DEFAULT;
if (mylang.toLowerCase() === 'es-es')
mylang = 'esEs'
console.log('MYLANG2=', mylang)
console.log('process.env.LANG_DEFAULT=', process.env.LANG_DEFAULT)
Vue.config.lang = mylang
import(`quasar/lang/${mylang}`).then(lang => {
console.log(' ... LANGDEFAULT=', lang)
this.$q.lang.set(lang.default)
import(`src/statics/i18n`).then(function () {
})
})
// console.log("PLUGINS INIT....");
//console.log("LANG_DEFAULT: ")
//console.log(process.env.LANG_DEFAULT)
// Set i18n instance on app
app.lang = new VueI18n({
locale: mylang,
fallbackLocale: mylang,
messages
})
}

View File

@@ -1,20 +0,0 @@
import Vue from 'vue'
import VueIdb from 'vue-idb'
export default ({ Vue }) => {
Vue.use(VueIdb)
}
/*
export default new VueIdb({
version: 1,
database: 'test',
schemas: [
{ categories: '++_id, sub_categ_id, descr_it' }
]
})
*/

View File

@@ -1,5 +0,0 @@
import Vuelidate from 'vuelidate'
export default ({ Vue }) => {
Vue.use(Vuelidate)
}

View File

@@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2019,10,10,16,45,34
Version=4
ViewMode=1

View File

@@ -38,7 +38,6 @@ export default class Header extends Vue {
public photo = '' public photo = ''
public visuimg: boolean = true public visuimg: boolean = true
get getappname(){ get getappname(){
if (Screen.width < 400) { if (Screen.width < 400) {
return this.$t('msg.myAppNameShort') return this.$t('msg.myAppNameShort')

View File

@@ -102,7 +102,13 @@
<label>{{ $t('msg.hello') }}</label> <span v-model="prova"></span> ! <label>{{ $t('msg.hello') }}</label> <span v-model="prova"></span> !
</div>--> </div>-->
<q-btn v-if="static_data.functionality.SHOW_USER_MENU" dense flat round icon="menu" @click="right = !right"> <!-- BUTTON USER BAR -->
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && !isLogged" dense flat round icon="menu"
@click="right = !right">
</q-btn>
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round
icon="img:statics/images/avatar-1.svg" @click="right = !right">
</q-btn> </q-btn>
</q-toolbar> </q-toolbar>
@@ -121,7 +127,8 @@
</q-drawer> </q-drawer>
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="right" side="right" overlay bordered> <!-- USER BAR -->
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="right" side="right" elevated>
<div id="profile"> <div id="profile">
<q-img class="absolute-top" src="../../statics/images/landing_first_section.png" <q-img class="absolute-top" src="../../statics/images/landing_first_section.png"
style="height: 150px"> style="height: 150px">
@@ -130,7 +137,9 @@
<q-avatar class="q-mb-sm center_img"> <q-avatar class="q-mb-sm center_img">
<img src="../../statics/images/avatar-1.svg"> <img src="../../statics/images/avatar-1.svg">
</q-avatar> </q-avatar>
<div v-if="Username" class="text-weight-bold text-user">{{ Username }} - {{ Name }}</div> <q-btn class="absolute-top-right" style="margin-top: 9px; margin-right: 12px; color: white;" dense flat round icon="close" @click="right = !right">
</q-btn>
<div v-if="Username" class="text-weight-bold text-user">{{ Username }} - {{ myName }}</div>
<div v-else class="text-italic">{{ $t('user.loggati') }}</div> <div v-else class="text-italic">{{ $t('user.loggati') }}</div>
<!--<span class="text-white" v-if="Verificato"> {{$t('reg.verificato')}} </span>--> <!--<span class="text-white" v-if="Verificato"> {{$t('reg.verificato')}} </span>-->

View File

@@ -28,9 +28,20 @@ export interface IBookedEvent {
infoevent: string infoevent: string
msgbooking: string msgbooking: string
datebooked?: Date datebooked?: Date
modified: boolean
booked: boolean booked: boolean
} }
export enum EState {
None, Creating, Modifying
}
export interface IBookedEventPage {
show: boolean
bookedevent: IBookedEvent
state: EState
}
export interface ICalendarState { export interface ICalendarState {
editable: boolean editable: boolean
eventlist: IEvents[] eventlist: IEvents[]

View File

@@ -8,6 +8,7 @@ const msgglobal = {
no: 'No', no: 'No',
delete: 'Elimina', delete: 'Elimina',
cancel: 'Annulla', cancel: 'Annulla',
update: 'Aggiorna',
today: 'Oggi', today: 'Oggi',
book: 'Prenota', book: 'Prenota',
msg: { msg: {
@@ -158,6 +159,7 @@ const msgglobal = {
booked_error: 'Prenotazione non avvenuta. Riprovare più tardi', booked_error: 'Prenotazione non avvenuta. Riprovare più tardi',
booking: 'Prenota Evento', booking: 'Prenota Evento',
titlebooking: 'Prenotazione', titlebooking: 'Prenotazione',
modifybooking: 'Modifica Prenotazione',
cancelbooking: 'Cancella Prenotazione', cancelbooking: 'Cancella Prenotazione',
canceledbooking: 'Prenotazione Cancellata', canceledbooking: 'Prenotazione Cancellata',
cancelederrorbooking: 'Cancellazione non effettuata, Riprovare più tardi', cancelederrorbooking: 'Cancellazione non effettuata, Riprovare più tardi',
@@ -204,6 +206,7 @@ const msgglobal = {
no: 'No', no: 'No',
delete: 'Borrar', delete: 'Borrar',
cancel: 'Cancelar', cancel: 'Cancelar',
update: 'Actualiza',
today: 'Hoy', today: 'Hoy',
book: 'Reserva', book: 'Reserva',
msg: { msg: {
@@ -348,6 +351,7 @@ const msgglobal = {
booked_error: 'Reserva fallida. Intenta nuevamente más tarde', booked_error: 'Reserva fallida. Intenta nuevamente más tarde',
booking: 'Reserva Evento', booking: 'Reserva Evento',
titlebooking: 'Reserva', titlebooking: 'Reserva',
modifybooking: 'Edita Reserva',
cancelbooking: 'Cancelar Reserva', cancelbooking: 'Cancelar Reserva',
canceledbooking: 'Reserva Cancelada', canceledbooking: 'Reserva Cancelada',
cancelederrorbooking: 'Cancelación no realizada, intente nuevamente más tarde', cancelederrorbooking: 'Cancelación no realizada, intente nuevamente más tarde',
@@ -393,6 +397,7 @@ const msgglobal = {
yes: 'Oui', yes: 'Oui',
no: 'Non', no: 'Non',
delete: 'Supprimer', delete: 'Supprimer',
update: 'mises à jour',
cancel: 'annuler', cancel: 'annuler',
today: 'Aujourd\'hui', today: 'Aujourd\'hui',
book: 'Réserve', book: 'Réserve',
@@ -537,6 +542,7 @@ const msgglobal = {
booked_error: 'La réservation a échoué. Réessayez plus tard', booked_error: 'La réservation a échoué. Réessayez plus tard',
booking: 'Réserver l\'événement', booking: 'Réserver l\'événement',
titlebooking: 'Réservation', titlebooking: 'Réservation',
modifybooking: 'changement de réservation',
cancelbooking: 'Annuler la réservation', cancelbooking: 'Annuler la réservation',
canceledbooking: 'Réservation annulée', canceledbooking: 'Réservation annulée',
cancelederrorbooking: 'Annulation non effectuée, réessayez plus tard', cancelederrorbooking: 'Annulation non effectuée, réessayez plus tard',
@@ -582,6 +588,7 @@ const msgglobal = {
yes: 'Yes', yes: 'Yes',
no: 'No', no: 'No',
delete: 'Delete', delete: 'Delete',
update: 'Update',
cancel: 'Cancel', cancel: 'Cancel',
today: 'Today', today: 'Today',
book: 'Book', book: 'Book',
@@ -725,6 +732,7 @@ const msgglobal = {
booked_error: 'Reservation failed. Try again later', booked_error: 'Reservation failed. Try again later',
booking: 'Book the Event', booking: 'Book the Event',
titlebooking: 'Reservation', titlebooking: 'Reservation',
modifybooking: 'Modify Reservation',
cancelbooking: 'Cancel Reservation', cancelbooking: 'Cancel Reservation',
canceledbooking: 'Booking cancelled', canceledbooking: 'Booking cancelled',
cancelederrorbooking: 'Cancellation unsuccessfully, try again later', cancelederrorbooking: 'Cancellation unsuccessfully, try again later',
@@ -770,6 +778,7 @@ const msgglobal = {
yes: 'Yes', yes: 'Yes',
no: 'No', no: 'No',
delete: 'Delete', delete: 'Delete',
update: 'Update',
cancel: 'Cancel', cancel: 'Cancel',
today: 'Today', today: 'Today',
book: 'Book', book: 'Book',
@@ -915,6 +924,7 @@ const msgglobal = {
booked_error: 'Reservation failed. Try again later', booked_error: 'Reservation failed. Try again later',
booking: 'Book the Event', booking: 'Book the Event',
titlebooking: 'Reservation', titlebooking: 'Reservation',
modifybooking: 'Modify Reservation',
cancelbooking: 'Cancel Reservation', cancelbooking: 'Cancel Reservation',
canceledbooking: 'Booking cancelled', canceledbooking: 'Booking cancelled',
cancelederrorbooking: 'Cancellation unsuccessfully, try again later', cancelederrorbooking: 'Cancellation unsuccessfully, try again later',

6
src/store/.directory Normal file
View File

@@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2019,10,10,17,19,58
Version=4
[Settings]
HiddenFilesShown=true

View File

@@ -113,6 +113,7 @@ namespace Actions {
datebooked: bookevent.datebooked, datebooked: bookevent.datebooked,
userId: UserStore.state.userId, userId: UserStore.state.userId,
booked: bookevent.booked, booked: bookevent.booked,
modified: bookevent.modified,
} }
} }
@@ -125,7 +126,15 @@ namespace Actions {
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) { if (res.data.code === serv_constants.RIS_CODE_OK) {
state.bookedevent.push(bookevent) if (bookevent.modified) {
const foundIndex = state.bookedevent.findIndex((x) => x.id_bookedevent === bookevent.id_bookedevent)
if (foundIndex >= 0)
state.bookedevent[foundIndex] = bookevent
} else {
state.bookedevent.push(bookevent)
}
return true return true
} }
} }

View File

@@ -1305,9 +1305,10 @@ export const tools = {
if (myfunc === costanti.FuncDialog.CANCEL_BOOKING) { if (myfunc === costanti.FuncDialog.CANCEL_BOOKING) {
console.log(' ENTRATO ! CancelBookingEvent ') console.log(' ENTRATO ! CancelBookingEvent ')
CalendarStore.actions.CancelBookingEvent(par.param1).then((ris) => { CalendarStore.actions.CancelBookingEvent(par.param1).then((ris) => {
if (ris) if (ris) {
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"') tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"')
else myself.bookEventpage.show = false
} else
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking')) tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking'))
}) })
} }
@@ -2077,7 +2078,7 @@ export const tools = {
return msg return msg
}, },
gettextevent(myevent) { gettextevent(myevent) {
return '"' + myevent.title + '" (' + this.getDateStr(myevent.date) + ') - ' + myevent.time return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
}, },
setLangAtt(mylang) { setLangAtt(mylang) {

72
tslint.json Normal file
View File

@@ -0,0 +1,72 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console": false,
"curly": [false],
"object-literal-sort-keys": false,
// "no-restricted-syntax": [
// "error",
// {
// "selector": "CallExpression[callee.object.nametranslate='console'][callee.property.nametranslate!=/^(log|warn|error|info|trace)$/]",
// "message": "Unexpected property on console object was called"
// }
// ],
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"ordered-imports": false,
"no-duplicate-variable": true,
"no-eval": true,
"no-internal-module": false,
"no-trailing-whitespace": false,
"no-var-keyword": true,
"max-line-length": false,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"semicolon": [true, "never"],
"trailing-comma": [true, {"multiline": "never", "singleline": "never"}],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}

15489
yarn.lock Normal file

File diff suppressed because it is too large Load Diff