- Chart Maps Nationality

- Username lowercase
- Statistics
- Telegram
This commit is contained in:
Paolo Arena
2020-01-27 15:09:11 +01:00
parent 415c431270
commit 3653b8309c
71 changed files with 1743 additions and 143 deletions

View File

@@ -818,7 +818,7 @@ namespace Actions {
GlobalStore.state.mypage = (res.data.mypage) ? [...res.data.mypage] : []
}
console.log('res.data.myuser', res.data.myuser)
// console.log('res.data.myuser', res.data.myuser)
if (res.data.myuser) {
UserStore.mutations.authUser(res.data.myuser)

View File

@@ -36,7 +36,8 @@ export const DefaultUser: IUserFields = {
verified_email: false,
made_gift: false,
profile: {
img: ''
img: '',
teleg_id: 0
},
downline: [],
calcstat: DefaultCalc
@@ -305,6 +306,7 @@ namespace Mutations {
localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(tools.localStorage.isLogged, String(true))
localStorage.setItem(tools.localStorage.verified_email, String(myuser.verified_email))
localStorage.setItem(tools.localStorage.teleg_id, String(myuser.profile.teleg_id))
localStorage.setItem(tools.localStorage.made_gift, String(myuser.made_gift))
localStorage.setItem(tools.localStorage.wasAlreadySubOnDb, String(GlobalStore.state.wasAlreadySubOnDb))
@@ -743,6 +745,7 @@ namespace Actions {
localStorage.removeItem(tools.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(tools.localStorage.verified_email)
localStorage.removeItem(tools.localStorage.teleg_id)
localStorage.removeItem(tools.localStorage.made_gift)
localStorage.removeItem(tools.localStorage.categorySel)
localStorage.removeItem(tools.localStorage.wasAlreadySubOnDb)
@@ -833,6 +836,7 @@ namespace Actions {
const made_gift = localStorage.getItem(tools.localStorage.made_gift) === 'true'
const perm = parseInt(localStorage.getItem(tools.localStorage.perm), 10)
const img = String(localStorage.getItem(tools.localStorage.img))
const teleg_id = parseInt(localStorage.getItem(tools.localStorage.teleg_id), 10)
GlobalStore.state.wasAlreadySubOnDb = localStorage.getItem(tools.localStorage.wasAlreadySubOnDb) === 'true'
@@ -848,7 +852,7 @@ namespace Actions {
verified_email,
made_gift,
perm,
profile: { img }
profile: { img, teleg_id }
})
isLogged = true

View File

@@ -153,6 +153,7 @@ const colcontribtype = [
]
const colpaymenttype = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'key', label_trans: 'reg.key' }),
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
AddCol(DeleteRec)
@@ -407,6 +408,8 @@ export const fieldsTable = {
// IColGridTable
colTableUsers: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'ind_order', label_trans: 'reg.ind_order' }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
@@ -429,9 +432,9 @@ export const fieldsTable = {
AddCol({ name: 'profile.manage_telegram', field: 'profile', subfield: 'manage_telegram', label_trans: 'reg.manage_telegram', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.paymenttypes', field: 'profile', subfield: 'paymenttypes', label_trans: 'reg.paymenttype', fieldtype: tools.FieldType.multiselect, jointable: 'paymenttypes' }),
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
// AddCol({ name: 'idapp', label_trans: 'reg.idapp', fieldtype: tools.FieldType.string }),
AddCol({ name: 'perm', label_trans: 'reg.perm', fieldtype: tools.FieldType.binary, jointable: 'permissions' }),
AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
],
@@ -494,7 +497,7 @@ export const fieldsTable = {
value: 'paymenttypes',
label: 'Tipi di Pagamenti',
columns: colpaymenttype,
colkey: '_id',
colkey: 'key',
collabel: 'label'
},
{

View File

@@ -6,6 +6,8 @@ import { translation } from './translation'
import Quasar, { colors, date, Screen } from 'quasar'
import { scroll } from 'quasar'
import { copyToClipboard } from 'quasar'
const { getScrollTarget, setScrollPosition } = scroll
import {
@@ -47,7 +49,7 @@ export interface INotify {
export const tools = {
CAN_EDIT: 'q-ce',
getprefCountries: ['it', 'us', 'es', 'uk', 'fr', 'de', 'ch'],
getprefCountries: ['it', 'si', 'us', 'es', 'uk', 'fr', 'de', 'ch'],
APORTADOR_NONE: '------',
@@ -106,6 +108,7 @@ export const tools = {
SERVKEY_VERS: 'vers',
localStorage: {
teleg_id: 'ti',
verified_email: 'vf',
made_gift: 'mg',
wasAlreadySubOnDb: 'sb',
@@ -1901,7 +1904,7 @@ export const tools = {
getstrDateTimeShort(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'DD/MM HH:mm');
return date.formatDate(mytimestamp, 'DD/MM HH:mm')
else
return ''
},
@@ -2639,7 +2642,7 @@ export const tools = {
const msg = mythis.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode)
tools.showNotif(mythis.$q, msg)
} else if (riscode === tools.OK) {
mythis.$router.push('/signin')
mythis.$router.push('/regok')
tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent'), {
color: 'green',
textColor: 'black'
@@ -3068,10 +3071,65 @@ export const tools = {
return 'fa-flag-gb'
else if (lang === 'DE')
return 'fa-flag-de'
else if (lang === 'SI')
return 'fa-flag-si'
else if (lang === 'CH')
return 'fa-flag-ch'
else if (lang === 'PE')
return 'fa-flag-pe'
else if (lang === 'HR')
return 'fa-flag-hr'
return ''
},
removespaces(mystr) {
return mystr.replace(/\s+/g, '')
},
copyStringToClipboard(mythis, mystr) {
copyToClipboard(mystr).then(() => {
tools.showNotif(mythis.$q, mythis.$t('dialog.copyclipboard') + ' \'' + mystr + '\'')
})
},
getNationsByNationality(nat) {
if (nat === 'IT') {
return 'Italy'
} else if (nat === 'SI') {
return 'Slovenia'
} else if (nat === 'ES') {
return 'Spain'
} else if (nat === 'DE') {
return 'Germany'
} else if (nat === 'US') {
return 'United States'
} else if (nat === 'CA') {
return 'Canada'
} else if (nat === 'MA') {
return 'Morocco'
} else if (nat === 'LT') {
return 'Lithuania'
} else if (nat === 'HR') {
return 'Croatia'
} else if (nat === 'HU') {
return 'Hungary'
} else if (nat === 'CH') {
return 'Switzerland'
} else if (nat === 'PE') {
return 'Peru'
} else if (nat === 'PL') {
return 'Poland'
} else if (nat === 'PT') {
return 'Portugal'
} else if (nat === 'UK') {
return 'United Kingdom'
} else if (nat === 'UA') {
return 'Ukraine'
}
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {