- menu BOT

- verified_by_aportador
This commit is contained in:
paoloar77
2021-12-29 18:26:41 +01:00
parent f29c9e0413
commit 664b469d99
30 changed files with 505 additions and 60 deletions

View File

@@ -145,6 +145,22 @@ export const colmypage = [
AddCol(DuplicateRec),
]
export const colmybot = [
AddCol({ name: 'page', label_trans: 'bot.page', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'riga', label_trans: 'bot.riga', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'index', label_trans: 'bot.index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'active', label_trans: 'bot.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'lang', label_trans: 'bot.lang' }),
AddCol({ name: 'main', label_trans: 'bot.main', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'label', label_trans: 'bot.label' }),
AddCol({ name: 'type', label_trans: 'bot.type', fieldtype: costanti.FieldType.select, jointable: 'bottype' }),
AddCol({ name: 'value', label_trans: 'bot.value' }),
AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.binary, jointable: 'visibility' }),
AddCol({ name: 'date_updated', label_trans: 'bot.date_updated', fieldtype: costanti.FieldType.date }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colopzemail = [
AddCol({ name: 'key', label_trans: 'col.key' }),
AddCol({ name: 'label_it', label_trans: 'col.label' }),
@@ -1229,6 +1245,135 @@ export const fieldsTable = {
AddCol(DuplicateRec),
],
colTableUsersISP: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'ind_order', label_trans: 'reg.ind_order' }),
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'email', label_trans: 'reg.email' }),
AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'note', label_trans: 'reg.note' }),
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
AddCol({ name: 'verified_by_aportador', label_trans: 'reg.verified_by_aportador', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'profile.resplist',
field: 'profile',
subfield: 'resplist',
label_trans: 'reg.resplist',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.workerslist',
field: 'profile',
subfield: 'workerslist',
label_trans: 'reg.workerslist',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.special_req',
field: 'profile',
subfield: 'special_req',
label_trans: 'reg.special_req',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.my_dream', field: 'profile', subfield: 'my_dream', label_trans: 'reg.my_dream',
}),
AddCol({ name: 'lang', field: 'lang', label_trans: 'reg.lang' }),
AddCol({
name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality',
}),
AddCol({
name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell',
}),
AddCol({
name: 'profile.email_paypal',
field: 'profile',
subfield: 'email_paypal',
label_trans: 'reg.email_paypal',
}),
/* AddCol({
name: 'profile.payeer_id',
field: 'profile',
subfield: 'payeer_id',
label_trans: 'reg.payeer_id'
}),
AddCol({
name: 'profile.advcash_id',
field: 'profile',
subfield: 'advcash_id',
label_trans: 'reg.advcash_id'
}),
AddCol({
name: 'profile.revolut',
field: 'profile',
subfield: 'revolut',
label_trans: 'revolut'
}), */
AddCol({
name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id',
}),
AddCol({
name: 'profile.teleg_checkcode',
field: 'profile',
subfield: 'teleg_checkcode',
label_trans: 'reg.teleg_checkcode',
}),
AddCol({
name: 'profile.manage_telegram',
field: 'profile',
subfield: 'manage_telegram',
label_trans: 'reg.manage_telegram',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.socio',
field: 'profile',
subfield: 'socio',
label_trans: 'reg.socio',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.socioresidente',
field: 'profile',
subfield: 'socioresidente',
label_trans: 'reg.socioresidente',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.consiglio',
field: 'profile',
subfield: 'consiglio',
label_trans: 'reg.consiglio',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni', }),
AddCol({ name: 'profile.biografia', field: 'profile', subfield: 'biografia', label_trans: 'reg.biografia', }),
AddCol({
name: 'profile.paymenttypes',
field: 'profile',
subfield: 'paymenttypes',
label_trans: 'reg.paymenttype',
fieldtype: costanti.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: costanti.FieldType.date }),
AddCol({ name: 'lasttimeonline', label_trans: 'reg.lasttimeonline', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'perm', label_trans: 'reg.perm', fieldtype: costanti.FieldType.binary, jointable: 'permissions', titlepopupedit: 'Permessi'
}),
AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
],
colTableExtraList: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
@@ -1468,6 +1613,24 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: 'bottype',
label: 'Tipo di Bot',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'visibility',
label: 'Visibilità',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'accepted',
label: 'Condizioni',

View File

@@ -3077,7 +3077,7 @@ export const tools = {
}
},
SignUpcheckErrors(mythisq: any, riscode: number, msg: string) {
SignUpcheckErrors(mythisq: any, $router: any, riscode: number, msg: string) {
console.log('SignUpcheckErrors', riscode)
const endload = true
@@ -3105,13 +3105,13 @@ export const tools = {
const msg2 = t('fetch.errore_generico') + userStore.getMsgError(riscode)
this.showNotif(mythisq, msg2)
} else if (riscode === this.OK) {
mythisq.$router.push('/regok')
$router.push('/regok')
this.showNotif(mythisq, t('components.authentication.email_verification.link_sent', { botname: t('ws.botname') }), {
color: 'green',
textColor: 'black',
})
} else if (riscode === serv_constants.RIS_ISCRIZIONE_OK) {
mythisq.$router.push('/')
$router.push('/')
this.showNotif(mythisq, t('components.authentication.iscrizione_ok', { botname: t('ws.botname') }), {
color: 'green',
textColor: 'black',
@@ -4276,7 +4276,7 @@ export const tools = {
if (!item.$error) {
return ''
}
console.log('errorMsg', cosa, item)
// console.log('errorMsg', cosa, item)
if (item.email) {
if (item.email.$invalid)

View File

@@ -66,6 +66,7 @@ export const toolsext = {
TABGALLERY: 'gallery',
TABMAILINGLIST: 'mailinglist',
TABMYPAGE: 'mypage',
TABMYBOT: 'mybots',
TABCALZOOM: 'calzoom',
TABGROUPS: 'groups',
TABTEMPLEMAIL: 'templemail',
@@ -80,6 +81,7 @@ export const toolsext = {
localStorage: {
teleg_id: 'ti',
verified_email: 'vf',
verified_by_aportador: 'va',
made_gift: 'mg',
wasAlreadySubOnDb: 'sb',
categorySel: 'cs',

View File

@@ -31,6 +31,7 @@ export const DefaultUser: IUserFields = {
password: '',
tokens: [],
verified_email: false,
verified_by_aportador: false,
aportador_solidario: '',
made_gift: false,
profile: {
@@ -60,7 +61,7 @@ export const DefaultProfile: IUserProfile = {
nationality: '',
intcode_cell: '',
cell: process.env.TEST_CELL || '',
dateofbirth: new Date(),
dateofbirth: null,
sex: 0,
country_pay: '',
email_paypal: '',
@@ -175,8 +176,14 @@ export const useUserStore = defineStore('UserStore', {
return ''
},
getRefLink(username: string): string {
if (username === '')
username = this.my.username
return tools.getUrlSite() + '/signup/' + username
},
isUserOk(): boolean {
return this.my.verified_email! && this.my.profile.teleg_id! > 0
return this.my.verified_email! && this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador!
},
getNameSurnameByUserId(userId: string): string {
@@ -398,23 +405,28 @@ export const useUserStore = defineStore('UserStore', {
},
authUser(data: IUserFields) {
this.my = { ...data }
if (!this.my.profile) {
this.my.profile = DefaultProfile
try {
this.my = { ...data }
if (!this.my.profile) {
this.my.profile = DefaultProfile
}
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
this.isManager = tools.isBitActive(this.my.perm, shared_consts.Permissions.Manager.value)
this.isTutor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Tutor.value)
this.isZoomeri = tools.isBitActive(this.my.perm, shared_consts.Permissions.Zoomeri.value)
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
this.my.tokens = []
this.resetArrToken(this.my.tokens)
this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() })
} catch (e) {
console.log('Error authUser: ' + e)
}
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
this.isManager = tools.isBitActive(this.my.perm, shared_consts.Permissions.Manager.value)
this.isTutor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Tutor.value)
this.isZoomeri = tools.isBitActive(this.my.perm, shared_consts.Permissions.Zoomeri.value)
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
this.my.tokens = []
this.resetArrToken(this.my.tokens)
this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() })
},
updateLocalStorage(myuser: IUserFields) {
@@ -436,6 +448,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.isLogged, String(true))
localStorage.setItem(toolsext.localStorage.verified_email, String(myuser.verified_email))
localStorage.setItem(toolsext.localStorage.verified_by_aportador, String(myuser.verified_by_aportador))
localStorage.setItem(toolsext.localStorage.teleg_id, String(myuser.profile.teleg_id))
localStorage.setItem(toolsext.localStorage.made_gift, String(myuser.made_gift))
localStorage.setItem(toolsext.localStorage.wasAlreadySubOnDb, String(globalStore.wasAlreadySubOnDb))
@@ -461,18 +474,6 @@ export const useUserStore = defineStore('UserStore', {
return bcrypt.hash(authData.password!, bcrypt.genSaltSync(12))
.then((hashedPassword: string) => {
/*
const usertosend = {
lang: mylang,
email: authData.email,
password: String(hashedPassword),
username: authData.username,
name: authData.name,
surname: authData.surname
}
console.log(usertosend)
*/
authData.lang = mylang
authData.password = String(hashedPassword)
@@ -506,14 +507,16 @@ export const useUserStore = defineStore('UserStore', {
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.verified_email, String(false))
localStorage.setItem(toolsext.localStorage.verified_by_aportador, String(false))
// Even if you has registered, you have to SignIn first
this.isLogged = false
// dispatch('storeUser', authData);
// dispatch('setLogoutTimer', myres.data.expiresIn);
console.log('OK')
return { code: tools.OK, msg: '' }
} else {
console.log('ERR GENERICO')
return { code: toolsext.ERR_GENERICO, msg: '' }
}
})
@@ -674,6 +677,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.removeItem(toolsext.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(toolsext.localStorage.verified_email)
localStorage.removeItem(toolsext.localStorage.verified_by_aportador)
localStorage.removeItem(toolsext.localStorage.teleg_id)
localStorage.removeItem(toolsext.localStorage.made_gift)
localStorage.removeItem(toolsext.localStorage.categorySel)
@@ -759,6 +763,7 @@ export const useUserStore = defineStore('UserStore', {
const name = String(localStorage.getItem(toolsext.localStorage.name))
const surname = String(localStorage.getItem(toolsext.localStorage.surname))
const verified_email = localStorage.getItem(toolsext.localStorage.verified_email) === 'true'
const verified_by_aportador = localStorage.getItem(toolsext.localStorage.verified_by_aportador) === 'true'
const made_gift = localStorage.getItem(toolsext.localStorage.made_gift) === 'true'
const myperm = localStorage.getItem(toolsext.localStorage.perm)
let perm = 0
@@ -780,6 +785,7 @@ export const useUserStore = defineStore('UserStore', {
name,
surname,
verified_email,
verified_by_aportador,
made_gift,
perm,
profile: { img, teleg_id, myshares: [] },

View File

@@ -1289,6 +1289,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (table === 'accepted') return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
if (table === 'fieldstype') return costanti.FieldTypeArr
if (table === 'metodo_pagamento') return tools.SelectMetodiPagamento
if (table === 'bottype') return shared_consts.BotType
if (table === 'visibility') return shared_consts.Visibility
let myarr = this.getListByTable(table)