Il creatore del Gruppo deve già appartenere al Gruppo stesso

Non permettere di aggiungere un Gruppo con lo stesso nome o codice
quando cancelli un Gruppo, cancella anche tutti i riferimenti sugli utenti di quel gruppo.
Errore caricamento Immagini !
This commit is contained in:
paoloar77
2022-02-28 17:20:31 +01:00
parent a31d10ceb8
commit 65bde785da
40 changed files with 230 additions and 366 deletions

View File

@@ -21,9 +21,6 @@ export default defineComponent({
components: {},
setup(props) {
const $q = useQuasar()
const { t } = useI18n()
const userStore = useUserStore()
const globalStore = useGlobalStore()
function copytoclip() {
tools.copyStringToClipboard($q, props.texttocopy, true)

View File

@@ -1,6 +1,6 @@
<template>
<div class="landing">
<!-- <div v-if="!tools.IsLogged() && (!mysingleevent)">
<!-- <div v-if="!tools.isLogged() && (!mysingleevent)">
<div class="centermydiv">
<q-banner class="bg-secondary text-white">
Il Calendario sarà visibile solo dopo aver effettuato l'accesso

View File

@@ -1414,25 +1414,35 @@ export default defineComponent({
const data = await globalStore.saveTable(mydata)
.then((ris) => {
if (ris) {
// console.log('ris', ris)
newRecordBool.value = false
const indrec = serverData.value.findIndex((rec: any) => rec._id === ris._id)
console.log('indrec', indrec, serverData.value[indrec])
if (ris.hasOwnProperty('code')) {
tools.checkErrors($q, ris.code, '');
} else {
if (ris) {
// console.log('ris', ris)
newRecordBool.value = false
const indrec = serverData.value.findIndex((rec: any) => rec._id === ris._id)
console.log('indrec', indrec, serverData.value[indrec])
if (fieldsTable.tableWithUsername.includes(props.prop_mytable)) {
ris.username = userStore.my.username
if (fieldsTable.tableWithUsername.includes(props.prop_mytable)) {
ris.username = userStore.my.username
}
// console.table(serverData.value)
if (indrec >= 0)
serverData.value[indrec] = ris
else
serverData.value = [ris, ...serverData.value]
newRecord.value = null
tools.showPositiveNotif($q, t('db.recupdated'))
// refresh()
} else {
tools.showNegativeNotif($q, t('db.recfailed'))
}
// console.table(serverData.value)
if (indrec >= 0)
serverData.value[indrec] = ris
else
serverData.value = [ris, ...serverData.value]
newRecord.value = null
// refresh()
}
}).catch((e) => {
tools.showNegativeNotif($q, t('db.recfailed'))
})
}

View File

@@ -111,10 +111,6 @@ export default defineComponent({
animare.value = process.env.DEV ? 0 : 8000
}
function isLogged() {
return userStore.isLogged
}
function meta() {
return {
keywords: { name: 'keywords', content: 'Quasar website' },
@@ -239,7 +235,6 @@ export default defineComponent({
changeAllunga,
getappname,
appname,
isLogged,
mystilecard,
getenv,
isInCostruction,

View File

@@ -23,17 +23,10 @@ export default defineComponent({
setup(props) {
const userStore = useUserStore()
const $router = useRouter()
const globalStore = useGlobalStore()
const { t } = useI18n();
const { isEmailVerified, TelegVerificato } = MixinUsers()
return {
userStore,
tools,
isEmailVerified,
TelegVerificato
}
},
})

View File

@@ -1,18 +1,29 @@
<template>
<div class="q-ma-md">
<CVerifyTelegram v-if="!TelegVerificato()">
<CVerifyTelegram v-if="!tools.TelegVerificato()">
</CVerifyTelegram>
<CVerifyEmail v-if="!isEmailVerified() && !TelegVerificato()">
<CVerifyEmail v-if="!tools.isEmailVerified() && !tools.TelegVerificato()">
</CVerifyEmail>
<div v-if="tools.isTelegOk()">
<div v-if="tools.isTelegOk()" class="centeritems">
<q-banner inline-actions rounded class="bg-orange text-black">
<template v-slot:avatar>
<q-icon name="info" color="primary"/>
</template>
<strong>A breve sarai abilitato, altrimenti avvisa il tuo invitante che ti sei Registrato.<br>Ti arriverà un messaggio su Telegram quando verrai abilitato dal tuo invitante.</strong>
<strong>Appena sarai abilitato, dal tuo invitante {{tools.getAportadorSolidario()}}, ti arriverà una <strong>notifica su Telegram</strong>.<br><br>
Se non dovesse arrivarti subito probabilmente {{tools.getAportadorSolidario()}} non ha il cellulare a portata di mano.<br>
</strong>
<q-btn
rounded
class="q-ma-sm"
color="primary"
icon="fas fa-user"
:to="tools.getLinkProfileAportador()"
:label="`Profilo di ` + tools.getAportadorSolidario()">
</q-btn>
</q-banner>
</div>

View File

@@ -2,6 +2,7 @@ import { defineComponent } from 'vue'
import { CCopyBtn } from '../CCopyBtn'
import { useUserStore } from '@store/UserStore'
import { tools } from '@store/Modules/tools'
export default defineComponent({
name: 'CVerifyEmail',
@@ -9,14 +10,8 @@ export default defineComponent({
props: {},
setup() {
const userStore = useUserStore()
function isEmailVerified(): boolean {
return userStore.my.verified_email!
}
return {
isEmailVerified,
tools,
}
}
})

View File

@@ -1,15 +1,15 @@
<template>
<div class="text-center q-gutter-sm q-ma-sm clBorderWarning">
<q-chip v-if="isEmailVerified()" color="positive" text-color="white" icon="email">
<q-chip v-if="tools.isEmailVerified()" color="positive" text-color="white" icon="email">
{{ `Email ` + $t('pages.statusreg.verified') }}
</q-chip>
<q-chip v-else color="negative" text-color="white" icon="email">
{{ `Email ` + $t('pages.statusreg.nonverified') }}
</q-chip>
<div v-if="!isEmailVerified()" v-html="$t('components.authentication.email_verification.link_sent', {botname: $t('ws.botname') })">
<div v-if="!tools.isEmailVerified()" v-html="$t('components.authentication.email_verification.link_sent', {botname: tools.getBotName() })">
</div>
<div v-if="!isEmailVerified()" v-html="$t('components.authentication.email_verification.se_non_ricevo')">
<div v-if="!tools.isEmailVerified()" v-html="$t('components.authentication.email_verification.se_non_ricevo')">
</div>
</div>

View File

@@ -17,41 +17,9 @@ export default defineComponent({
const userStore = useUserStore()
const { setValDb, getValDb } = MixinBase()
function TelegCode() {
if (userStore.my.profile) {
return userStore.my.profile.teleg_checkcode
}else {
return 0
}
}
function TelegVerificato(): boolean {
return userStore.my.profile ? userStore.my.profile.teleg_id! > 0 : false
}
function getLinkBotTelegram(): string {
if (tools.isTest() && !process.env.DEV) {
return getValDb('TELEG_BOT_LINK_TEST', false)
} else{
return getValDb('TELEG_BOT_LINK', false)
}
}
function getBotNameTelegram() {
return t('ws.botname');
}
function isEmailVerified(): boolean {
return userStore.my.verified_email!
}
return {
TelegCode,
TelegVerificato,
getLinkBotTelegram,
isEmailVerified,
getBotNameTelegram,
tools,
}
}
})

View File

@@ -1,27 +1,27 @@
<template>
<div class="text-center q-gutter-sm q-ma-sm clBorderWarning">
<div v-if="TelegCode() > 0">
<div v-if="tools.TelegCode() > 0">
<div class="text-h5 text-center text-red">
{{ $t('reg.teleg_auth') }} Telegram:
</div>
<CCopyBtn :title="$t('reg.click_per_copiare')" :texttocopy="TelegCode()">
<CCopyBtn :title="$t('reg.click_per_copiare')" :texttocopy="tools.TelegCode()">
</CCopyBtn>
<div class="text-h6 text-center" v-html="$t('reg.teleg_torna_sul_bot', {botname: getBotNameTelegram()})">
<div class="text-h6 text-center" v-html="$t('reg.teleg_torna_sul_bot', {botname: tools.getBotName()})">
</div>
</div>
<div v-if="!TelegVerificato()" class="q-pa-sm q-gutter-sm">
<div v-if="!TelegCode()"><strong>{{ $t('components.authentication.telegram.open')}}</strong></div>
<div v-if="!tools.TelegVerificato()" class="q-pa-sm q-gutter-sm">
<div v-if="!tools.TelegCode()"><strong>{{ $t('components.authentication.telegram.open')}}</strong></div>
<div class="q-ma-md">
<q-btn rounded color="primary" icon="fab fa-telegram" :label="$t('components.authentication.telegram.openbot', {botname: $t('ws.botname') })"
<q-btn rounded color="primary" icon="fab fa-telegram" :label="$t('components.authentication.telegram.openbot', {botname: tools.getBotName() })"
type="a"
:href="getLinkBotTelegram()" target="_blank"></q-btn>
:href="tools.getLinkBotTelegram()" target="_blank"></q-btn>
<br>
</div>
<strong>{{ $t('components.authentication.telegram.ifclose', {botname: getBotNameTelegram() })}}</strong>
<strong>{{ $t('components.authentication.telegram.ifclose', {botname: tools.getBotName() })}}</strong>
<div class="q-my-sm">
<!--<q-img src="images/ayni_bot.jpg" class="" :alt="$t('ws.sitename')" style="height: 100px; width: 250px;">
</q-img>-->

View File

@@ -68,7 +68,6 @@ export default defineComponent({
myName,
mySurname,
myCell,
Verificato,
MadeGift,
Email,
getMyImg,
@@ -80,7 +79,6 @@ export default defineComponent({
getNumMsg,
getNumMsgUnread,
getMsgText,
isVerified,
paotest } = MixinUsers();
function isonline() {
@@ -370,10 +368,6 @@ export default defineComponent({
})
}
function isLogged() {
return userStore.isLogged
}
function clickregister() {
rightDrawerOpen.value = false
@@ -432,7 +426,6 @@ export default defineComponent({
rightCartOpen,
lang,
langshort,
isLogged,
getnumOrdersCart,
t,
isonline,
@@ -457,7 +450,6 @@ export default defineComponent({
myName,
mySurname,
myCell,
Verificato,
MadeGift,
Email,
getMyImg,
@@ -472,7 +464,7 @@ export default defineComponent({
paotest,
logoutHandler,
isUserNotAuth,
isVerified,
tools,
}
},

View File

@@ -100,7 +100,7 @@
<!-- BUTTON USER BAR -->
<q-btn
class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && isLogged()" round dense flat
class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && tools.isLogged()" round dense flat
@click="rightCartOpen = !rightCartOpen" icon="fas fa-shopping-cart">
<q-badge v-if="getnumItemsCart() > 0" color="red" floating transparent>
@@ -109,7 +109,7 @@
</q-btn>
<q-btn
class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && isLogged() && getnumOrdersCart() > 0"
class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && tools.isLogged() && getnumOrdersCart() > 0"
round dense flat
to="/orderinfo" icon="fas fa-list-ol">
@@ -119,11 +119,11 @@
</q-btn>
<q-btn
class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && !isLogged()" dense flat round
class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && !tools.isLogged()" dense flat round
icon="menu"
@click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>
<q-avatar v-else-if="static_data.functionality.SHOW_USER_MENU && isLogged() && getMyImg()"
<q-avatar v-else-if="static_data.functionality.SHOW_USER_MENU && tools.isLogged() && getMyImg()"
size="36px" class="center_img cursor-pointer"
@click="rightDrawerOpen = !rightDrawerOpen">
<q-img ratio="1" fit="conver" :src="getMyImg()" :alt="Username()" img-class="imgprofile_small" stretch="false"
@@ -163,7 +163,7 @@
class="absolute-top-right" style="margin-right: 10px; color: white;"
dense flat round icon="close" @click="rightCartOpen = !rightCartOpen">
</q-btn>
<div v-if="isLogged()" class="text-weight-bold text-cart">Carrello
<div v-if="tools.isLogged()" class="text-weight-bold text-cart">Carrello
</div>
<CMyCart></CMyCart>
</q-drawer>
@@ -188,10 +188,10 @@
dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>
<div v-if="isLogged()" class="text-weight-bold text-user">{{ Username() }}<span v-if="myName()"> - {{ myName() }}</span>
<div v-if="tools.isLogged()" class="text-weight-bold text-user">{{ Username() }}<span v-if="myName()"> - {{ myName() }}</span>
</div>
<div class="row justify-evenly q-pa-xs-sm">
<div v-if="isLogged() && isAdmin()" class="text-weight-bold text-user bg-red q-px-xs">Admin</div>
<div v-if="tools.isLogged() && isAdmin()" class="text-weight-bold text-user bg-red q-px-xs">Admin</div>
<div v-if="isSocio" class="text-weight-bold text-user q-px-xs">Socio</div>
<div v-if="isSocioResidente()" class="text-weight-bold text-user q-px-xs bg-amber">Residente</div>
<div v-if="isConsiglio()" class="text-weight-bold text-user q-px-xs bg-deep-orange-10">Consiglio</div>
@@ -199,22 +199,22 @@
<div v-if="isTutor()" class="text-weight-bold text-user q-px-xs">Tutor</div>
<div v-if="isTratuttrici()" class="text-weight-bold text-user q-px-xs">Editor</div>
</div>
<div v-if="!isLogged()" class="text-user text-italic bg-red">
<div v-if="!tools.isLogged()" class="text-user text-italic bg-red">
{{ t('user.loggati') }}
</div>
<div v-if="isLogged() && !isVerified()" class="text-verified">{{
<div v-if="tools.isLogged() && !tools.isVerified()" class="text-verified">{{
t('components.authentication.email_verification.verify_email')
}}
</div>
<div v-if="isLogged()"
<div v-if="tools.isLogged()"
class="text-verified">
<!-- <span class="text-white" v-if="Verificato()"> {{t('reg.verificato')}} </span> -->
<span class="text-user text-italic bg-red" v-if="!Verificato()"> {{t('reg.non_verificato')}} </span>
<span class="text-user text-italic bg-red" v-if="!tools.Verificato()"> {{t('reg.non_verificato')}} </span>
</div>
<div v-if="isLogged()" id="user-actions" class="column justify-center q-gutter-sm q-ma-sm center-150">
<div v-if="tools.isLogged()" id="user-actions" class="column justify-center q-gutter-sm q-ma-sm center-150">
<q-btn rounded color="primary" icon="person" :to="`/my/`+getMyUsername()">{{ t('pages.profile') }}</q-btn>
<!--<q-btn round color="warning" icon="lock"></q-btn>-->
<q-btn rounded color="negative" icon="exit_to_app" @click='logoutHandler'>{{ t('login.esci') }}</q-btn>
@@ -222,7 +222,7 @@
</div>
<div style="margin-top:120px;"></div>
<div v-show="!isLogged()">
<div v-show="!tools.isLogged()">
<div class="q-ma-md" style="">
<CSigninNoreg :showregbutt="static_data.functionality.SHOW_REG_BUTTON">
@@ -232,7 +232,7 @@
</div>
</div>
<div v-if="isLogged()" class="q-mt-lg"></div>
<div v-if="tools.isLogged()" class="q-mt-lg"></div>
<slot></slot>