- Enable Edit Event into dialog form ... (and save to the db)

- Event: enabled drag and drop (date)
- Q-Select components in every table field external: Where, Operators, etc...
- CMyEditor: Add HTML Editor to the details field !
- Added button Color for change font color to the text.
- Complete insert Events Site
This commit is contained in:
Paolo Arena
2019-10-23 23:47:12 +02:00
parent bfe5053407
commit c39f0d8486
11 changed files with 608 additions and 271 deletions

View File

@@ -19,6 +19,7 @@ const state: ICalendarState = {
bookedevent: [],
operators: [],
wheres: [],
contribtype: [],
// ---------------
titlebarHeight: 0,
locale: 'it-IT',
@@ -82,6 +83,23 @@ namespace Getters {
}, 'getWhereRec')
const getContribtypeRec = b.read((mystate: ICalendarState) => (id) => {
const ctrec = mystate.contribtype.find((mycontr) => mycontr._id === id)
return (ctrec)
}, 'getContribtypeRec')
const getContribtypeById = b.read((mystate: ICalendarState) => (id) => {
const ctrec = mystate.contribtype.find((mycontr) => mycontr._id === id)
return (ctrec) ? ctrec.label : ''
}, 'getContribtypeById')
const getContribtypeRecByLabel = b.read((mystate: ICalendarState) => (label) => {
const ctrec = mystate.contribtype.find((mycontr) => mycontr.label === label)
return (ctrec)
}, 'getContribtypeRecByLabel')
export const getters = {
get findEventBooked() {
return findEventBooked()
@@ -98,6 +116,15 @@ namespace Getters {
get getWhereRec() {
return getWhereRec()
},
get getContribtypeRec() {
return getContribtypeRec()
},
get getContribtypeById() {
return getContribtypeById()
},
get getContribtypeRecByLabel() {
return getContribtypeRecByLabel()
},
get getTeacherName() {
return getTeacherName()
}
@@ -117,40 +144,6 @@ namespace Mutations {
}
namespace Actions {
async function loadAfterLogin(context) {
// console.log('CalendarStore: loadAfterLogin')
// Load local data
state.editable = UserStore.state.isAdmin || UserStore.state.isManager
if (UserStore.getters.isUserInvalid) {
state.bookedevent = []
return false
}
// Load local data
// console.log('CALENDAR loadAfterLogin', 'userid=', UserStore.state.userId)
let ris = null
const showall = UserStore.state.isAdmin || UserStore.state.isManager ? '1' : '0'
ris = await Api.SendReq('/booking/' + UserStore.state.userId + '/' + process.env.APP_ID + '/' + showall, 'GET', null)
.then((res) => {
state.bookedevent = (res.data.bookedevent) ? res.data.bookedevent : []
state.eventlist = (res.data.eventlist) ? res.data.eventlist : []
state.operators = (res.data.operators) ? res.data.operators : []
state.wheres = (res.data.wheres) ? res.data.wheres : []
})
.catch((error) => {
console.log('error dbLoad', error)
// UserStore.mutations.setErrorCatch(error)
return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, tools.ERR_GENERICO, error)
})
return ris
}
function getparambyevent(bookevent) {
return {
@@ -222,7 +215,6 @@ namespace Actions {
}
export const actions = {
loadAfterLogin: b.dispatch(loadAfterLogin),
BookEvent: b.dispatch(BookEvent),
CancelBookingEvent: b.dispatch(CancelBookingEvent)
}