Ver 0.5.55

Strette di Mano OK
This commit is contained in:
Surya Paolo
2023-01-09 02:39:53 +01:00
parent 815ca0d565
commit d684d7a46f
18 changed files with 341 additions and 407 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.54" APP_VERSION="0.5.55"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.54" APP_VERSION="0.5.55"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.54" APP_VERSION="0.5.55"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.54" APP_VERSION="0.5.55"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.54" APP_VERSION="0.5.55"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14" APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -96,15 +96,12 @@ export const shared_consts = {
FRIENDSCMD: { FRIENDSCMD: {
SETTRUST: 121, SETTRUST: 121,
REQFRIEND: 125, REQFRIEND: 125,
REQHANDSHAKE: 128,
SETFRIEND: 132, SETFRIEND: 132,
SETHANDSHAKE: 133, SETHANDSHAKE: 133,
REMOVE_FROM_MYFRIENDS: 144, REMOVE_FROM_MYFRIENDS: 144,
REFUSE_REQ_FRIEND: 145, REFUSE_REQ_FRIEND: 145,
CANCEL_REQ_FRIEND: 146, CANCEL_REQ_FRIEND: 146,
REMOVE_FROM_MYHANDSHAKE: 147, REMOVE_FROM_MYHANDSHAKE: 147,
REFUSE_REQ_HANDSHAKE: 148,
CANCEL_REQ_HANDSHAKE: 149,
BLOCK_USER: 155, BLOCK_USER: 155,
UNBLOCK_USER: 156, UNBLOCK_USER: 156,
REPORT_USER: 158, REPORT_USER: 158,
@@ -1072,10 +1069,7 @@ export const shared_consts = {
ID_MSGS_NEW_REC: 1, ID_MSGS_NEW_REC: 1,
TYPEDIR_HANDSHAKE: 10, TYPEDIR_HANDSHAKE: 10,
ID_HANDSHAKE_NEW_REC: 1,
ID_HANDSHAKE_ACCEPTED: 2, ID_HANDSHAKE_ACCEPTED: 2,
ID_HANDSHAKE_REFUSED: 4,
ID_HANDSHAKE_ACCEPTED_MY_REQUEST: 8,
TYPEDIR_TEST: 444, TYPEDIR_TEST: 444,
ID_TEST_NEW_REC: 1, ID_TEST_NEW_REC: 1,

View File

@@ -75,12 +75,8 @@ export default defineComponent({
arr = userStore.my.profile.req_friends arr = userStore.my.profile.req_friends
} else if (props.modelValue === costanti.HANDSHAKE) { } else if (props.modelValue === costanti.HANDSHAKE) {
arr = userStore.my.profile.handshake arr = userStore.my.profile.handshake
} else if (props.modelValue === costanti.REQ_HANDSHAKE) {
arr = userStore.my.profile.req_handshake
} else if (props.modelValue === costanti.ASK_SENT_FRIENDS) { } else if (props.modelValue === costanti.ASK_SENT_FRIENDS) {
arr = userStore.my.profile.asked_friends arr = userStore.my.profile.asked_friends
} else if (props.modelValue === costanti.ASK_SENT_HANDSHAKE) {
arr = userStore.my.profile.asked_handshake
} else if (props.modelValue === costanti.ASK_TRUST) { } else if (props.modelValue === costanti.ASK_TRUST) {
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined) arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
} else if (props.modelValue === costanti.TRUSTED) { } else if (props.modelValue === costanti.TRUSTED) {
@@ -110,12 +106,6 @@ export default defineComponent({
if (numHandShake.value > 0 || props.modelValue === costanti.HANDSHAKE) if (numHandShake.value > 0 || props.modelValue === costanti.HANDSHAKE)
mybutt.push({ label: t('mypages.handshake') + ' (' + numHandShake.value + ')', value: costanti.HANDSHAKE }) mybutt.push({ label: t('mypages.handshake') + ' (' + numHandShake.value + ')', value: costanti.HANDSHAKE })
if (numReqHandShake.value > 0 || props.modelValue === costanti.REQ_HANDSHAKE)
mybutt.push({
label: t('mypages.requesthandshake') + ' (' + numReqHandShake.value + ')',
value: costanti.REQ_HANDSHAKE
})
if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS) if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS)
mybutt.push({ mybutt.push({
label: t('mypages.request_sent') + ' (' + numAskSentFriends.value + ')', label: t('mypages.request_sent') + ' (' + numAskSentFriends.value + ')',
@@ -146,10 +136,6 @@ export default defineComponent({
return (arr) ? arr.length : 0 return (arr) ? arr.length : 0
}) })
const numReqHandShake = computed(() => {
const arr = userStore.my.profile.req_handshake
return (arr) ? arr.length : 0
})
const numAskSentFriends = computed(() => { const numAskSentFriends = computed(() => {
const arr = userStore.my.profile.asked_friends const arr = userStore.my.profile.asked_friends

View File

@@ -83,7 +83,7 @@
</q-btn> </q-btn>
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
<q-item-section side v-else-if="visu === costanti.REQ_HANDSHAKE"> <q-item-section side v-else-if="visu === costanti.SETHANDSHAKE">
<q-item-label> <q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h"> <q-btn rounded icon="fas fa-ellipsis-h">
<q-menu> <q-menu>
@@ -92,12 +92,6 @@
<q-item-section>{{ $t('friends.accept_handshake') }}</q-item-section> <q-item-section>{{ $t('friends.accept_handshake') }}</q-item-section>
</q-item> </q-item>
</q-list> </q-list>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, false, contact.username, false)">
<q-item-section>{{ $t('friends.reject_ask_handshake') }}</q-item-section>
</q-item>
</q-list>
</q-menu> </q-menu>
</q-btn> </q-btn>
</q-item-label> </q-item-label>
@@ -278,7 +272,7 @@
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section> <q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
</q-item> </q-item>
<q-item v-if="!userStore.IsHandShakeByUsername(contact.username)" clickable icon="far fa-handshake" v-close-popup <q-item v-if="!userStore.IsHandShakeByUsername(contact.username)" clickable icon="far fa-handshake" v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, true, contact.username)"> @click="setCmd($q, shared_consts.FRIENDSCMD.SETHANDSHAKE, userStore.my.username, true, contact.username)">
<q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section> <q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section>
</q-item> </q-item>
</q-list> </q-list>
@@ -323,21 +317,14 @@
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section> <q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
</q-item> </q-item>
<q-item v-if="(!userStore.IsHandShakeByUsername(contact.username) && !userStore.IsAskedHandShakeByUsername(contact.username))" <q-item v-if="!userStore.IsHandShakeByUsername(contact.username)"
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, true, contact.username)"> clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.SETHANDSHAKE, userStore.my.username, true, contact.username)">
<q-item-section avatar> <q-item-section avatar>
<q-icon color="positive" name="far fa-handshake"/> <q-icon color="positive" name="far fa-handshake"/>
</q-item-section> </q-item-section>
<q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section> <q-item-section>{{ $t('handshake.ask_handshake') }}</q-item-section>
</q-item> </q-item>
<q-item v-else-if="(!userStore.IsHandShakeByUsername(contact.username) && userStore.IsAskedHandShakeByUsername(contact.username))" <q-item v-else style="min-width: 200px"
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQ_HANDSHAKE, userStore.my.username, false, contact.username)">
<q-item-section avatar>
<q-icon color="negative" name="far fa-handshake-alt-slash"/>
</q-item-section>
<q-item-section>{{ $t('handshake.cancel_ask_handshake') }}</q-item-section>
</q-item>
<q-item v-else-if="userStore.IsHandShakeByUsername(contact.username)" style="min-width: 200px"
clickable v-close-popup clickable v-close-popup
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE, userStore.my.username, '', contact.username)"> @click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE, userStore.my.username, '', contact.username)">
<q-item-section avatar> <q-item-section avatar>

View File

@@ -78,44 +78,46 @@
<q-tab-panels v-model="mytab" animated> <q-tab-panels v-model="mytab" animated>
<q-tab-panel name="reg"> <q-tab-panel name="reg">
<transition-group <div class="q-pa-md" style="max-width: 350px; margin: auto;">
name="fade" <transition-group
mode="out-in" name="fade"
appear mode="out-in"
enter-active-class="animazione fadeIn" appear
leave-active-class="animazione fadeOut" enter-active-class="animazione fadeIn"
> leave-active-class="animazione fadeOut"
<q-item
v-for="(user, index) in lastsreg"
:key="index"
class="animated"
v-ripple
> >
<q-item-section> <q-item
<q-item-label lines="1"> v-for="(user, index) in lastsreg"
<CMyFieldRec :key="index"
table="users" class="animated"
:id="user._id" v-ripple
:rec="user" >
field="username" <q-item-section>
:canEdit="false" <q-item-label lines="1">
:canModify="false" <CMyFieldRec
:fieldtype="costanti.FieldType.username_chip" table="users"
> :id="user._id"
</CMyFieldRec> :rec="user"
</q-item-label> field="username"
</q-item-section> :canEdit="false"
:canModify="false"
:fieldtype="costanti.FieldType.username_chip"
>
</CMyFieldRec>
</q-item-label>
</q-item-section>
<q-item-section side> <q-item-section side>
<q-item-label>{{ <q-item-label>{{
tools.getstrDateTimeShort(user.date_reg) tools.getstrDateTimeShort(user.date_reg)
}}</q-item-label> }}</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</transition-group> </transition-group>
</div>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="online"> <q-tab-panel name="online">
<div class="q-pa-md" style="max-width: 300px"> <div class="q-pa-md" style="max-width: 350px; margin: auto;">
<q-list bordered> <q-list bordered>
<transition-group <transition-group
name="fade" name="fade"
@@ -169,7 +171,7 @@
</div> </div>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="diffusori"> <q-tab-panel name="diffusori">
<div class="q-pa-md" style="max-width: 300px"> <div class="q-pa-md" style="max-width: 350px; margin: auto;">
<div class="text-center text-bold text-h6"> <div class="text-center text-bold text-h6">
Aiuta RISO a crescere Aiuta RISO a crescere
</div> </div>
@@ -219,10 +221,12 @@
<q-item-section side <q-item-section side
><div ><div
:class=" :class="
`text-h6 q-mx-sm q-px-sm text-bold ` + ($q.dark.isActive ? `text-white`: `text-black`) `text-h6 q-mx-sm q-px-sm text-bold ` +
($q.dark.isActive ? `text-white` : `text-black`)
" "
>{{ user.count }} >
</div></q-item-section {{ user.count }}
</div></q-item-section
> >
</q-item> </q-item>
</transition-group> </transition-group>
@@ -230,12 +234,13 @@
</div> </div>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="strettelist"> <q-tab-panel name="strettelist">
<div class="q-pa-md" style="max-width: 300px"> <div class="q-pa-md" style="max-width: 350px; margin: auto;">
<div class="text-center text-bold text-h6"> <div class="text-center text-bold text-h6">
Strette di Mano Strette di Mano
</div> </div>
<div class="text-center"> <div class="text-center">
Più persone conoscerai di persona e maggiore aumenterà la Rete di fiducia. Più persone conoscerai di persona e maggiore aumenterà la
Rete di fiducia.
</div> </div>
<q-list bordered> <q-list bordered>
<transition-group <transition-group
@@ -279,10 +284,12 @@
<q-item-section side <q-item-section side
><div ><div
:class=" :class="
`text-h6 q-mx-sm q-px-sm text-bold ` + ($q.dark.isActive ? `text-white`: `text-black`) `text-h6 q-mx-sm q-px-sm text-bold ` +
($q.dark.isActive ? `text-white` : `text-black`)
" "
>{{ user.count }} >
</div></q-item-section {{ user.count }}
</div></q-item-section
> >
</q-item> </q-item>
</transition-group> </transition-group>

View File

@@ -90,8 +90,6 @@
<q-item-section v-ripple> <q-item-section v-ripple>
status: {{notif.status}}
typedir: {{notif.typedir}}
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)"> <q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
<div v-html="getNotifText($t, notif, false)"></div> <div v-html="getNotifText($t, notif, false)"></div>
</q-item-label> </q-item-label>
@@ -115,8 +113,8 @@
/> />
</div> </div>
</q-item-label> </q-item-label>
<q-item-label caption lines="2" v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_HANDSHAKE && notif.status === 0" v-ripple> <!--<q-item-label caption lines="2" v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_HANDSHAKE && notif.status === 0" v-ripple>
<div class="row no-wrap justify-evenly" v-if="userStore.IsReqHandShakeByUsername(notif.sender)"> <div class="row no-wrap justify-evenly" v-if="!userStore.IsHandShakeByUsername(notif.sender)">
<q-btn <q-btn
dense dense
rounded rounded
@@ -125,16 +123,8 @@
color="positive" :label="$t('handshake.accept')" color="positive" :label="$t('handshake.accept')"
@click="tools.addToMyHandShake(q, userStore.my.username, notif.sender)" @click="tools.addToMyHandShake(q, userStore.my.username, notif.sender)"
/> />
<q-btn
dense
rounded
size="sm"
icon="fas fa-user-minus"
color="negative" :label="$t('handshake.refuse')"
@click="tools.refuseReqHandShake(q, userStore.my.username, notif.sender)"
/>
</div> </div>
</q-item-label> </q-item-label>-->
<q-item-label caption lines="2" <q-item-label caption lines="2"
v-else-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER" v-else-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER"
v-ripple> v-ripple>

View File

@@ -177,8 +177,6 @@ export default function () {
} else if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_HANDSHAKE) { } else if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_HANDSHAKE) {
if (notif.status === shared_consts.StatusNotifs.STATUS_HANDSHAKE_ACCEPTED) { if (notif.status === shared_consts.StatusNotifs.STATUS_HANDSHAKE_ACCEPTED) {
descr += '<br><em>' + $t('handshake.accepted') + '</em>' descr += '<br><em>' + $t('handshake.accepted') + '</em>'
} else if (notif.status === shared_consts.StatusNotifs.STATUS_HANDSHAKE_REFUSED) {
descr += '<br><em>' + $t('handshake.refused') + '</em>'
} }
} else if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) { } else if (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) {
if (notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ) { if (notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ) {

View File

@@ -97,7 +97,6 @@ export interface IUserProfile {
friends: IFriends[] friends: IFriends[]
req_friends: IFriends[] req_friends: IFriends[]
handshake: IFriends[] handshake: IFriends[]
req_handshake: IFriends[]
mygroups: IMyGroup[] mygroups: IMyGroup[]
mycircuits: IMyCircuit[] mycircuits: IMyCircuit[]
manage_mygroups: IMyGroup[] manage_mygroups: IMyGroup[]
@@ -110,7 +109,6 @@ export interface IUserProfile {
// in memory // in memory
asked_friends: any[] asked_friends: any[]
asked_handshake: any[]
asked_groups: IGroupShort[] asked_groups: IGroupShort[]
refused_groups: IGroupShort[] refused_groups: IGroupShort[]
list_usersgroup?: IFriends[] list_usersgroup?: IFriends[]

View File

@@ -226,8 +226,10 @@ const msg_it = {
insertgoodorservices_to_enter_circuit: 'Per poter entrare nel Circuito è necessario aggiungere almeno un Bene, Servizio o offrire Ospitalità', insertgoodorservices_to_enter_circuit: 'Per poter entrare nel Circuito è necessario aggiungere almeno un Bene, Servizio o offrire Ospitalità',
deletedgroup: 'Gruppo Eliminato', deletedgroup: 'Gruppo Eliminato',
domanda_addtofriend: 'Aggiungere agli amici {username}?', domanda_addtofriend: 'Aggiungere agli amici {username}?',
domanda_addtohandshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username}?<br>({username} riceverà una richiesta di conferma)" ?', domanda_addtohandshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username} ?',
addtohandshake: 'Hai stretto la mano a {username}', handshake_you: 'Hai stretto la mano a {username}',
handshake_him: '{username} ti ha stretto la mano',
both_fiducia: 'Fiducia reciproca tra te e {username}',
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?', domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?', domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?',
addedfriend: 'Aggiunto alla lista di Amici', addedfriend: 'Aggiunto alla lista di Amici',
@@ -240,18 +242,16 @@ const msg_it = {
domanda_ask_handshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username} ?', domanda_ask_handshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username} ?',
domanda_ask_group: 'Chiedere l\'invito al Gruppo {groupname}?', domanda_ask_group: 'Chiedere l\'invito al Gruppo {groupname}?',
askedtofriend: 'Chiesto l\'Amicizia a {username}', askedtofriend: 'Chiesto l\'Amicizia a {username}',
askedtohandshake: 'Chiesto la Stretta di mano a {username}', askedtohandshake: 'Hai confermato la tua fiducia a {username}',
domanda_revoke_friend: 'Revocare la richiesta di Amicizia a {username}?', domanda_revoke_friend: 'Revocare la richiesta di Amicizia a {username}?',
domanda_revoke_handshake: 'Revocare la richiesta di Stretta di mano a {username}?', domanda_revoke_handshake: 'Revocare la richiesta di Stretta di mano a {username}?',
domanda_revoke_group: 'Revocare la richiesta al gruppo {groupname}?', domanda_revoke_group: 'Revocare la richiesta al gruppo {groupname}?',
domanda_refuse_group: 'Rifiutare la richiesta di {username} per entrare nel gruppo {groupname}?', domanda_refuse_group: 'Rifiutare la richiesta di {username} per entrare nel gruppo {groupname}?',
revoketofriend: 'Revocato la richiesta di Amicizia a {username}', revoketofriend: 'Revocato la richiesta di Amicizia a {username}',
revoketohandshake: 'Revocato la richiesta di Stretta di mano a {username}', revoketohandshake: 'Hai revocato la fiducia a {username}',
domanda_cancel_req_friend: 'Annullare la richiesta di Amicizia a {username}?', domanda_cancel_req_friend: 'Annullare la richiesta di Amicizia a {username}?',
domanda_cancel_req_handshake: 'Annullare la richiesta di Stretta di mano a {username}?',
domanda_cancel_req_group: 'Annullare la richiesta d\'invito di {username} al gruppo {groupname}?', domanda_cancel_req_group: 'Annullare la richiesta d\'invito di {username} al gruppo {groupname}?',
cancel_req_friend: 'Annullata la richiesta di Amicizia a {username}', cancel_req_friend: 'Annullata la richiesta di Amicizia a {username}',
cancel_req_handshake: 'Annullata la richiesta di Stretta di mano a {username}',
cancel_req_group: 'Annullata la richiesta al gruppo {groupname}', cancel_req_group: 'Annullata la richiesta al gruppo {groupname}',
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?', domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
rejected: 'Rifiutato la Fiducia', rejected: 'Rifiutato la Fiducia',
@@ -1085,16 +1085,18 @@ const msg_it = {
report_user: 'Segnala Utente', report_user: 'Segnala Utente',
}, },
handshake: { handshake: {
strettadimano: 'Stretta di mano',
strettedimano: 'Strette di mano', strettedimano: 'Strette di mano',
received: 'Ricevute', received: 'Ricevute',
incommon: 'Strette in Comune', incommon: 'Strette in Comune',
accept_trust: 'Accetta la Stretta di mano', accept_trust: 'Accetta la Stretta di mano',
accepted: 'Stretta di mano confermata', accepted: 'Stretta di mano confermata',
refused: 'Stretta di mano rifiutata', refused: 'Stretta di mano rifiutata',
accept: 'Conferma', accept: 'Ricambia la fiducia',
refuse: 'Rifiuta', refuse: 'Rifiuta',
accept_handshake: 'Conferma la Stretta di mano', accept_handshake: 'Stringi la mano',
remove_from_myhandshake: 'Rimuovi dalle Strette di mano', accept_you_too_handshake: 'Ricambia la fiducia',
remove_from_myhandshake: 'Togli la Stretta di mano',
ask_handshake: 'Stringi la mano', ask_handshake: 'Stringi la mano',
cancel_ask_handshake: 'Annulla la richiesta di Stretta di mano', cancel_ask_handshake: 'Annulla la richiesta di Stretta di mano',
cancel_ask_handshake_short: 'Annulla', cancel_ask_handshake_short: 'Annulla',

View File

@@ -244,7 +244,6 @@ export const costanti = {
MY_GROUPS: 21, MY_GROUPS: 21,
USER_GROUPS: 22, USER_GROUPS: 22,
HANDSHAKE: 23, HANDSHAKE: 23,
REQ_HANDSHAKE: 24,
ASK_SENT_HANDSHAKE: 25, ASK_SENT_HANDSHAKE: 25,
CREATE_GROUP: 30, CREATE_GROUP: 30,

View File

@@ -5468,7 +5468,7 @@ export const tools = {
message: t('db.domanda_addtohandshake', { username: usernameDest }), message: t('db.domanda_addtohandshake', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true }, ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') }, cancel: { label: t('dialog.cancel') },
title: t('db.domanda') title: t('handshake.strettadimano')
}).onOk(() => { }).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETHANDSHAKE, null) userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETHANDSHAKE, null)
@@ -5476,7 +5476,6 @@ export const tools = {
if (res) { if (res) {
notifStore.updateNotification = true notifStore.updateNotification = true
userStore.my.profile.handshake = [...userStore.my.profile.handshake, res] userStore.my.profile.handshake = [...userStore.my.profile.handshake, res]
userStore.my.profile.req_handshake = userStore.my.profile.req_handshake.filter((rec: IFriends) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.addedhandshake')) tools.showPositiveNotif($q, t('db.addedhandshake'))
} }
}) })
@@ -5572,27 +5571,6 @@ export const tools = {
}) })
}, },
refuseReqHandShake($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
const notifStore = useNotifStore()
$q.dialog({
message: t('db.domanda_revoke_handshake', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE, null).then((res) => {
if (res) {
notifStore.updateNotification = true
userStore.my.profile.req_handshake = userStore.my.profile.req_handshake.filter((user: IFriends) => user.username !== usernameDest)
tools.showPositiveNotif($q, t('db.removedhandshake'))
}
})
})
},
updateMyData(res: any) { updateMyData(res: any) {
const userStore = useUserStore() const userStore = useUserStore()
const circuitStore = useCircuitStore() const circuitStore = useCircuitStore()
@@ -5874,7 +5852,7 @@ export const tools = {
}) })
}, },
setRequestHandShake($q: any, username: string, usernameDest: string, value: boolean) { setHandShake($q: any, username: string, usernameDest: string, value: boolean) {
const userStore = useUserStore() const userStore = useUserStore()
@@ -5897,16 +5875,14 @@ export const tools = {
title: t('db.domanda') title: t('db.domanda')
}).onOk(() => { }).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.REQHANDSHAKE, value) userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETHANDSHAKE, value)
.then((res: any) => { .then((res: any) => {
if (res) { if (res) {
if (value) { if (value) {
// ADD to req HandShake // ADD to req HandShake
userStore.my.profile.asked_handshake.push(res)
tools.showPositiveNotif($q, t('db.askedtohandshake', { username: usernameDest })) tools.showPositiveNotif($q, t('db.askedtohandshake', { username: usernameDest }))
} else { } else {
// REMOVE to req HandShake // REMOVE to req HandShake
userStore.my.profile.asked_handshake = userStore.my.profile.asked_handshake.filter((rec: IUserFields) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.revoketohandshake', { username: usernameDest })) tools.showPositiveNotif($q, t('db.revoketohandshake', { username: usernameDest }))
} }
@@ -5975,23 +5951,6 @@ export const tools = {
}) })
}) })
}, },
cancelReqHandShake($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
$q.dialog({
message: t('db.domanda_cancel_req_handshake', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.CANCEL_REQ_HANDSHAKE, null).then((res) => {
if (res) {
userStore.my.profile.asked_handshake = userStore.my.profile.asked_handshake.filter((rec: IUserFields) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.cancel_req_handshake'))
}
})
})
},
cancelReqGroups($q: any, username: string, groupnameDest: string) { cancelReqGroups($q: any, username: string, groupnameDest: string) {
const userStore = useUserStore() const userStore = useUserStore()
$q.dialog({ $q.dialog({
@@ -6613,14 +6572,8 @@ export const tools = {
tools.cancelReqFriends($q, username, dest) tools.cancelReqFriends($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.SETHANDSHAKE) { } else if (cmd === shared_consts.FRIENDSCMD.SETHANDSHAKE) {
tools.addToMyHandShake($q, username, dest) tools.addToMyHandShake($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.REQHANDSHAKE) {
tools.setRequestHandShake($q, username, dest, value)
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE) { } else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE) {
tools.removeFromMyHandShake($q, username, dest) tools.removeFromMyHandShake($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_HANDSHAKE) {
tools.refuseReqHandShake($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_HANDSHAKE) {
tools.cancelReqHandShake($q, username, dest)
} else if (cmd === shared_consts.CIRCUITCMD.SET) { } else if (cmd === shared_consts.CIRCUITCMD.SET) {
tools.addToMyCircuits($q, username, dest) tools.addToMyCircuits($q, username, dest)
} else if (cmd === shared_consts.CIRCUITCMD.REQ) { } else if (cmd === shared_consts.CIRCUITCMD.REQ) {

View File

@@ -111,7 +111,7 @@ export const useNotifStore = defineStore('NotifStore', {
} }
} }
this.updateArrNotif() this.updateArrNotif()
}, 3000) }, 20000)
}) })
.catch((error) => { .catch((error) => {

View File

@@ -66,8 +66,6 @@ export const DefaultUser: IUserFields = {
friends: [], friends: [],
req_friends: [], req_friends: [],
handshake: [], handshake: [],
req_handshake: [],
asked_handshake: [],
mygroups: [], mygroups: [],
mycircuits: [], mycircuits: [],
manage_mygroups: [], manage_mygroups: [],
@@ -127,8 +125,6 @@ export const DefaultProfile: IUserProfile = {
friends: [], friends: [],
req_friends: [], req_friends: [],
handshake: [], handshake: [],
req_handshake: [],
asked_handshake: [],
mygroups: [], mygroups: [],
mycircuits: [], mycircuits: [],
manage_mygroups: [], manage_mygroups: [],
@@ -233,6 +229,13 @@ export const useUserStore = defineStore('UserStore', {
return false return false
}, },
IsHandShakeByMe(user: IUserFields): boolean {
if (user && user.profile && user.profile.handshake)
return user.profile.handshake.findIndex((rec) => rec.username === this.my.username) >= 0
else
return false
},
IsMyGroupByGroupname(groupname: string): boolean { IsMyGroupByGroupname(groupname: string): boolean {
if (this.my.profile.mygroups) if (this.my.profile.mygroups)
return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0 return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0
@@ -263,13 +266,6 @@ export const useUserStore = defineStore('UserStore', {
return false return false
}, },
IsAskedHandShakeByUsername(username: string): boolean {
if (this.my.profile.asked_handshake)
return this.my.profile.asked_handshake.findIndex((rec) => rec.username === username) >= 0
else
return false
},
IsReqFriendByUsername(username: string): boolean { IsReqFriendByUsername(username: string): boolean {
if (this.my.profile.req_friends) if (this.my.profile.req_friends)
return this.my.profile.req_friends.findIndex((rec) => rec.username === username) >= 0 return this.my.profile.req_friends.findIndex((rec) => rec.username === username) >= 0
@@ -277,13 +273,6 @@ export const useUserStore = defineStore('UserStore', {
return false return false
}, },
IsReqHandShakeByUsername(username: string): boolean {
if (this.my.profile.req_handshake)
return this.my.profile.req_handshake.findIndex((rec) => rec.username === username) >= 0
else
return false
},
IsAskedGroupByGroupname(groupname: string): boolean { IsAskedGroupByGroupname(groupname: string): boolean {
if (this.my.profile.asked_groups) if (this.my.profile.asked_groups)
return this.my.profile.asked_groups.findIndex((rec: IGroupShort) => rec.groupname === groupname) >= 0 return this.my.profile.asked_groups.findIndex((rec: IGroupShort) => rec.groupname === groupname) >= 0
@@ -766,7 +755,6 @@ export const useUserStore = defineStore('UserStore', {
// Memory // Memory
this.my.profile.manage_mygroups = [] this.my.profile.manage_mygroups = []
this.my.profile.asked_friends = [] this.my.profile.asked_friends = []
this.my.profile.asked_handshake = []
this.my.profile.asked_groups = [] this.my.profile.asked_groups = []
this.my.profile.refused_groups = [] this.my.profile.refused_groups = []
} }
@@ -1291,8 +1279,6 @@ export const useUserStore = defineStore('UserStore', {
this.my.profile.asked_friends = data.listSentRequestFriends ? data.listSentRequestFriends : [] this.my.profile.asked_friends = data.listSentRequestFriends ? data.listSentRequestFriends : []
this.my.profile.handshake = data.listHandShake ? data.listHandShake : [] this.my.profile.handshake = data.listHandShake ? data.listHandShake : []
this.my.profile.req_handshake = data.listRequestHandShake ? data.listRequestHandShake : []
this.my.profile.asked_handshake = data.listSentRequestHandShake ? data.listSentRequestHandShake : []
}, },
async loadFriends() { async loadFriends() {

View File

@@ -218,252 +218,286 @@
<div v-if="myuser._id" class="col-12 text-h8 q-mt-sm"> <div v-if="myuser._id" class="col-12 text-h8 q-mt-sm">
{{ myuser.profile.biografia }} {{ myuser.profile.biografia }}
</div> </div>
<div v-if="userStore.IsHandShakeByUsername(myuser.username)"> <div>
<div class="row justify-center">
<q-btn
v-if="
myuser.profile &&
myuser.profile.handshake &&
myuser.profile.handshake.length > 0
"
:label="quantiHandShake"
class="q-my-sm"
color="grey-3"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Lista Strette di mano';
usersList.list = myuser.profile.handshake;
"
>
</q-btn>
<q-btn
v-if="
myuser.username !== myusername() &&
handshake_inCommon &&
handshake_inCommon.length > 0
"
:label="quanteHandShakeInCommon"
class="q-my-sm"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Strette di mano in Comune';
usersList.list = handshake_inCommon;
"
>
</q-btn>
</div>
<q-chip <q-chip
v-if="
userStore.IsHandShakeByMe(myuser) &&
userStore.IsHandShakeByUsername(myuser.username)
"
color="green" color="green"
dense dense
class="cltexth4 chipbooked shadow-5 q-pa-sm2" class="cltexth3 chipbooked shadow-5 q-pa-sm2"
size="md" size="lg"
text-color="white"
icon="fas fa-handshake" icon="fas fa-handshake"
> >
<span <span
>&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2"> >&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2">
{{ $t('db.addtohandshake', { username: myuser.username }) }} {{ $t('db.both_fiducia', { username: myuser.username }) }}
</em></span </em></span
> >
</q-chip> </q-chip>
</div> <q-chip
<q-btn v-else-if="
v-if=" userStore.IsHandShakeByMe(myuser) &&
myuser.profile &&
myuser.profile.handshake &&
myuser.profile.handshake.length > 0
"
:label="quantiHandShake"
class="q-my-sm"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Lista Strette di mano';
usersList.list = myuser.profile.handshake;
"
>
</q-btn>
<q-btn
v-if="
myuser.username !== myusername() &&
handshake_inCommon &&
handshake_inCommon.length > 0
"
:label="quanteHandShakeInCommon"
class="q-my-sm"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Strette di mano in Comune';
usersList.list = handshake_inCommon;
"
>
</q-btn>
<!--HANDSHAKE-->
<div v-if="!isMyRecord(myuser.username)">
<div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqHandShakeByUsername(myuser.username)"
>
<q-btn
icon="fas fa-handshake"
color="positive"
:label="$t('handshake.accept_handshake')"
@click="
tools.addToMyHandShake(
$q,
myuser.username,
userStore.my.username
)
"
/>
<q-btn
icon="fas fa-handshake-alt-slash"
color="negative"
:label="$t('handshake.reject_ask_handshake')"
@click="
tools.refuseReqHandShake(
$q,
myuser.username,
userStore.my.username
)
"
/>
</div>
<div v-else>
<q-btn
v-if="
!userStore.IsHandShakeByUsername(myuser.username) &&
!userStore.IsAskedHandShakeByUsername(myuser.username)
"
icon="fas fa-handshake"
color="primary"
:label="$t('handshake.ask_handshake')"
@click="
tools.setRequestHandShake(
$q,
userStore.my.username,
myuser.username,
true
)
"
/>
</div>
<q-btn
v-if="
userStore.IsAskedHandShakeByUsername(myuser.username) &&
!userStore.IsHandShakeByUsername(myuser.username) !userStore.IsHandShakeByUsername(myuser.username)
" "
icon="fas fa-handshake-alt-slash" color="blue"
:text-color="$q.dark.isActive ? 'black' : 'black'" dense
:label="$t('handshake.cancel_ask_handshake_short')" class="cltexth4 chipbooked shadow-5 q-pa-sm2"
@click=" size="md"
tools.cancelReqHandShake( text-color="white"
$q, icon="fas fa-handshake"
userStore.my.username,
myuser.username
)
"
/>
</div>
<div v-if="!isMyRecord(myuser.username)" class="q-ma-sm">
<div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqFriendByUsername(myuser.username)"
> >
<q-btn <span
icon="fas fa-user-plus" >&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2">
color="positive" {{ $t('db.handshake_him', { username: myuser.username }) }}
:label="$t('friends.accept_friend')" </em></span
@click=" >
tools.addToMyFriends( </q-chip>
$q, <q-chip
userStore.my.username, v-else
myuser.username color="blue"
) dense
" class="cltexth4 chipbooked shadow-5 q-pa-sm2"
/> size="md"
<q-btn text-color="white"
icon="fas fa-user-minus" icon="fas fa-handshake"
color="negative" >
:label="$t('friends.reject_ask_friend')" <span
@click=" >&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2">
tools.refuseReqFriends( {{ $t('db.handshake_you', { username: myuser.username }) }}
$q, </em></span
userStore.my.username, >
myuser.username </q-chip>
)
" <!--HANDSHAKE-->
/> <div v-if="!isMyRecord(myuser.username)">
<div
class="row centeritems q-pa-sm"
v-if="!userStore.IsHandShakeByUsername(myuser.username)"
>
<q-btn
v-if="userStore.IsHandShakeByMe(myuser)"
icon="fas fa-handshake"
color="positive"
:label="$t('handshake.accept_you_too_handshake')"
@click="
tools.addToMyHandShake(
$q,
myuser.username,
userStore.my.username
)
"
/>
<q-btn
v-else
icon="fas fa-handshake"
color="positive"
:label="$t('handshake.accept_handshake')"
@click="
tools.addToMyHandShake(
$q,
myuser.username,
userStore.my.username
)
"
/>
</div>
</div> </div>
<div v-else> </div>
<div v-if="!isMyRecord(myuser.username)" class="q-ma-sm">
<div class="row justify-center">
<div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqFriendByUsername(myuser.username)"
>
<q-btn
icon="fas fa-user-plus"
color="positive"
:label="$t('friends.accept_friend')"
@click="
tools.addToMyFriends(
$q,
userStore.my.username,
myuser.username
)
"
/>
<q-btn
icon="fas fa-user-minus"
color="negative"
:label="$t('friends.reject_ask_friend')"
@click="
tools.refuseReqFriends(
$q,
userStore.my.username,
myuser.username
)
"
/>
</div>
<div v-else>
<q-btn
v-if="
!userStore.IsMyFriendByUsername(myuser.username) &&
!userStore.IsAskedFriendByUsername(myuser.username)
"
icon="fas fa-user-plus"
color="primary"
:label="$t('friends.ask_friend')"
@click="
tools.setRequestFriendship(
$q,
userStore.my.username,
myuser.username,
true
)
"
/>
</div>
</div>
<div class="row justify-center">
<q-btn <q-btn
v-if=" v-if="
!userStore.IsMyFriendByUsername(myuser.username) && userStore.IsMyFriendByUsername(myuser.username) ||
!userStore.IsAskedFriendByUsername(myuser.username) userStore.IsHandShakeByUsername(myuser.username)
" "
icon="fas fa-user-plus" class="text-center"
color="primary" rounded
:label="$t('friends.ask_friend')" icon="fas fa-ellipsis-h"
>
<q-menu>
<q-list style="min-width: 150px">
<q-item
v-if="userStore.IsMyFriendByUsername(myuser.username)"
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.removeFromMyFriends(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.remove_from_myfriends')
}}</q-item-section>
</q-item>
<q-item
v-if="userStore.IsMyFriendByUsername(myuser.username)"
clickable
icon="fas fa-ban"
v-close-popup
@click="
tools.blockUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.block_user')
}}</q-item-section>
</q-item>
<q-item
v-if="userStore.IsMyFriendByUsername(myuser.username)"
clickable
v-close-popup
@click="
tools.reportUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section avatar>
<q-icon color="negative" name="fas fa-user-minus" />
</q-item-section>
<q-item-section>{{
$t('friends.report_user')
}}</q-item-section>
</q-item>
<q-item>
<q-btn
v-if="userStore.IsHandShakeByUsername(myuser.username)"
icon="fas fa-handshake-slash"
color="negative"
:label="$t('handshake.remove_from_myhandshake')"
@click="
tools.removeFromMyHandShake(
$q,
userStore.my.username,
myuser.username
)
"
/>
</q-item>
</q-list>
</q-menu>
</q-btn>
<q-btn
v-if="
userStore.IsAskedFriendByUsername(myuser.username) &&
!userStore.IsMyFriendByUsername(myuser.username)
"
icon="fas fa-user-minus"
:label="$t('friends.cancel_ask_friend_short')"
@click=" @click="
tools.setRequestFriendship( tools.cancelReqFriends(
$q, $q,
userStore.my.username, userStore.my.username,
myuser.username, myuser.username
true
) )
" "
/> />
</div> </div>
<q-btn
v-if="userStore.IsMyFriendByUsername(myuser.username)"
rounded
icon="fas fa-ellipsis-h"
>
<q-menu>
<q-list v-if="true" style="min-width: 150px">
<q-item
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.removeFromMyFriends(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.remove_from_myfriends')
}}</q-item-section>
</q-item>
<q-item
clickable
icon="fas fa-ban"
v-close-popup
@click="
tools.blockUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section>{{
$t('friends.block_user')
}}</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="
tools.reportUser(
$q,
userStore.my.username,
myuser.username
)
"
>
<q-item-section avatar>
<q-icon color="negative" name="fas fa-user-minus" />
</q-item-section>
<q-item-section>{{
$t('friends.report_user')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
<q-btn
v-if="
userStore.IsAskedFriendByUsername(myuser.username) &&
!userStore.IsMyFriendByUsername(myuser.username)
"
icon="fas fa-user-minus"
:label="$t('friends.cancel_ask_friend_short')"
@click="
tools.cancelReqFriends(
$q,
userStore.my.username,
myuser.username
)
"
/>
</div> </div>
<CContactUser :myuser="myuser" :showBtnActivities="true" /> <CContactUser :myuser="myuser" :showBtnActivities="true" />