diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index dbe020d..8ca0c13 100644 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -7,7 +7,7 @@ export const shared_consts = { }, fieldsUserToChange() { - return ['username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email'] + return ['username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr'] } } diff --git a/src/components/CEventsCalendar/CEventsCalendar.ts b/src/components/CEventsCalendar/CEventsCalendar.ts index 9cf1aa3..ab8582f 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.ts +++ b/src/components/CEventsCalendar/CEventsCalendar.ts @@ -440,7 +440,7 @@ export default class CEventsCalendar extends Vue { } public addBookEventMenu(eventparam) { - if (!UserStore.state.isLogged || !UserStore.state.verified_email) { + if (!UserStore.state.isLogged || !UserStore.state.my.verified_email) { // Visu right Toolbar to make SignIn GlobalStore.state.RightDrawerOpen = true // this.$router.push('/signin') @@ -459,7 +459,7 @@ export default class CEventsCalendar extends Vue { } public askForInfoEventMenu(eventparam) { - if (!UserStore.state.isLogged || !UserStore.state.verified_email) { + if (!UserStore.state.isLogged || !UserStore.state.my.verified_email) { // Visu right Toolbar to make SignIn GlobalStore.state.RightDrawerOpen = true // this.$router.push('/signin') @@ -665,7 +665,7 @@ export default class CEventsCalendar extends Vue { const data: IMessage = { idapp: process.env.APP_ID, origin: { - userId: UserStore.state.userId, + userId: UserStore.state.my._id, page: '', event_id: myevent._id, infoevent: tools.gettextevent(this, myevent) @@ -688,7 +688,6 @@ export default class CEventsCalendar extends Vue { tools.showNegativeNotif(self.$q, self.$t('cal.sendmsg_error')) }) - } public saveBookEvent(myevent: IEvents) { @@ -703,7 +702,7 @@ export default class CEventsCalendar extends Vue { // self.bookEventForm.booked = self.bookEventForm.bookedcheck const data: IBookedEvent = { - userId: UserStore.state.userId, + userId: UserStore.state.my._id, id_bookedevent: myevent._id, numpeople: self.bookEventForm.numpeople, infoevent: tools.gettextevent(self, myevent), diff --git a/src/components/CSignUp/CSignUp.ts b/src/components/CSignUp/CSignUp.ts index 7489a5b..62b5f8a 100644 --- a/src/components/CSignUp/CSignUp.ts +++ b/src/components/CSignUp/CSignUp.ts @@ -4,7 +4,7 @@ import { UserStore } from '@store' import { tools } from '../../store/Modules/tools' import { toolsext } from '@src/store/Modules/toolsext' -import { ISignupOptions, IUserState } from 'model' +import { ISignupOptions, IUserState, IUserFields } from 'model' import { validations, TSignup } from './CSignUp-validate' import { validationMixin } from 'vuelidate' diff --git a/src/components/Header/Header.scss b/src/components/Header/Header.scss index 826bdc7..3f8a534 100644 --- a/src/components/Header/Header.scss +++ b/src/components/Header/Header.scss @@ -211,7 +211,7 @@ canvas { } .toolbar { - min-height: 30px; + min-height: 43px; } .right-itens a, .right-itens button { @@ -296,3 +296,8 @@ canvas { margin-bottom: 5px; } +.roundimg { + border-radius: 50% !important; + color: red; + background-color: red; +} diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 020f9a2..1d53a92 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -15,8 +15,11 @@ import Quasar, { Screen } from 'quasar' import { static_data } from '../../db/static_data' import globalroutines from '../../globalroutines' +import MixinUsers from '../../mixins/mixin-users' + @Component({ name: 'Header', + mixins: [MixinUsers], components: { drawer, messagePopover, CSignIn @@ -315,28 +318,6 @@ export default class Header extends Vue { }, 100) } - get MenuCollapse() { - return GlobalStore.state.menuCollapse - // return true - } - - get Username() { - return UserStore.state.username - } - get myName() { - return UserStore.state.name - } - get mySurname() { - return UserStore.state.surname - } - get Verificato() { - return UserStore.state.verified_email - } - - get Email() { - return UserStore.state.email - } - public logoutHandler() { UserStore.actions.logout() .then(() => { @@ -359,7 +340,7 @@ export default class Header extends Vue { } get isVerified() { - return UserStore.state.verified_email + return UserStore.state.my.verified_email } public loginOk() { diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index f9b35c9..17b67e5 100644 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -102,11 +102,14 @@ - - + + + + @@ -134,7 +137,7 @@
- + diff --git a/src/components/projects/SingleProject/SingleProject.ts b/src/components/projects/SingleProject/SingleProject.ts index 5adc9e4..b39585c 100644 --- a/src/components/projects/SingleProject/SingleProject.ts +++ b/src/components/projects/SingleProject/SingleProject.ts @@ -293,7 +293,7 @@ export default class SingleProject extends Vue { } get isMyProject() { - return this.itemproject.userId === UserStore.state.userId + return this.itemproject.userId === UserStore.state.my._id } get tipoProj() { diff --git a/src/globalroutines/indexdb.ts b/src/globalroutines/indexdb.ts index 1fa1fca..2d36551 100644 --- a/src/globalroutines/indexdb.ts +++ b/src/globalroutines/indexdb.ts @@ -15,7 +15,7 @@ function saveConfigIndexDb(context) { _id: costanti.CONFIG_ID_CFG, lang: toolsext.getLocale(), token: UserStore.state.x_auth_token, - userId: UserStore.state.userId + userId: UserStore.state.my._id } writeConfigIndexDb('config', data) diff --git a/src/layouts/toolbar/messagePopover/messagePopover.ts b/src/layouts/toolbar/messagePopover/messagePopover.ts index 05d3d3d..f2b0189 100644 --- a/src/layouts/toolbar/messagePopover/messagePopover.ts +++ b/src/layouts/toolbar/messagePopover/messagePopover.ts @@ -9,10 +9,14 @@ import { tools } from '@src/store/Modules/tools' import { toolsext } from '@src/store/Modules/toolsext' import { ITodo, ITodosState } from '../../../model' import { Getter } from 'vuex-class' +import { UserStore } from '../../../store/Modules' + +import MixinUsers from '../../../mixins/mixin-users' const namespace = 'UserModule' @Component({ + mixins: [MixinUsers] }) export default class MessagePopover extends Vue { @@ -25,6 +29,20 @@ export default class MessagePopover extends Vue { // } } + get getNumMsg() { + return UserStore.getters.getlasts_messages().length + } + + get getNumMsgUnread() { + // return UserStore.getters.getlasts_messages().length + return UserStore.getters.getnumMsgUnread() + } + + get getNumNotifUnread() { + // return UserStore.getters.getlasts_messages().length + return 0 + } + public randomDate(): Date { let myval = Math.floor(Math.random() * 10000000000) return tools.getstrDateTime(new Date(tools.getTimestampsNow() - myval)) diff --git a/src/layouts/toolbar/messagePopover/messagePopover.vue b/src/layouts/toolbar/messagePopover/messagePopover.vue index 6574ced..0f67b51 100644 --- a/src/layouts/toolbar/messagePopover/messagePopover.vue +++ b/src/layouts/toolbar/messagePopover/messagePopover.vue @@ -1,45 +1,49 @@