Richieste d'Amicizia: aggiunto data di richiesta e di amicizia
This commit is contained in:
@@ -286,7 +286,7 @@ export const shared_consts = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldsUserToChange() {
|
fieldsUserToChange() {
|
||||||
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'verified_by_aportador', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
|
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'verified_by_aportador', 'trust_modified', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useUserStore } from '@store/UserStore'
|
|||||||
import { useI18n } from '@/boot/i18n'
|
import { useI18n } from '@/boot/i18n'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
import { ISearchList, IUserFields } from 'model'
|
import { IFriends, ISearchList, IUserFields } from 'model'
|
||||||
import { shared_consts } from '@/common/shared_vuejs'
|
import { shared_consts } from '@/common/shared_vuejs'
|
||||||
import { tools } from '@store/Modules/tools'
|
import { tools } from '@store/Modules/tools'
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ export default defineComponent({
|
|||||||
if (res) {
|
if (res) {
|
||||||
console.log('res = ', res)
|
console.log('res = ', res)
|
||||||
userStore.my.profile.friends = [...userStore.my.profile.friends, res]
|
userStore.my.profile.friends = [...userStore.my.profile.friends, res]
|
||||||
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((rec: any) => rec.username !== usernameDest)
|
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((rec: IFriends) => rec.username !== usernameDest)
|
||||||
tools.showPositiveNotif($q, t('db.addedfriend'))
|
tools.showPositiveNotif($q, t('db.addedfriend'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -264,7 +264,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IFriends) => rec.username !== usernameDest)
|
||||||
tools.showPositiveNotif($q, t('db.removedfriend'))
|
tools.showPositiveNotif($q, t('db.removedfriend'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -281,7 +281,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((user: any) => user !== usernameDest)
|
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((user: IFriends) => user.username !== usernameDest)
|
||||||
tools.showPositiveNotif($q, t('db.removedfriend'))
|
tools.showPositiveNotif($q, t('db.removedfriend'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -314,7 +314,7 @@ export default defineComponent({
|
|||||||
}).onOk(() => {
|
}).onOk(() => {
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.BLOCK_USER, null).then((res) => {
|
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.BLOCK_USER, null).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IFriends) => rec.username !== usernameDest)
|
||||||
tools.showPositiveNotif($q, t('db.blockedfriend'))
|
tools.showPositiveNotif($q, t('db.blockedfriend'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<q-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)"/>
|
<q-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)"/>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-btn color="negative" :label="$t('friends.reject_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)"/>
|
<q-btn color="negative" :label="$t('friends.refuse_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)"/>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side v-if="visu === costanti.TRUSTED">
|
<q-item-section side v-if="visu === costanti.TRUSTED">
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ const enum ESexType {
|
|||||||
Female = 2,
|
Female = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IFriends {
|
||||||
|
username?: string
|
||||||
|
date?: Date
|
||||||
|
}
|
||||||
|
|
||||||
export interface IUserProfile {
|
export interface IUserProfile {
|
||||||
img?: string
|
img?: string
|
||||||
nationality?: string
|
nationality?: string
|
||||||
@@ -44,8 +49,8 @@ export interface IUserProfile {
|
|||||||
socioresidente?: boolean
|
socioresidente?: boolean
|
||||||
consiglio?: boolean
|
consiglio?: boolean
|
||||||
myshares: IShareWithUs[]
|
myshares: IShareWithUs[]
|
||||||
friends: any[]
|
friends: IFriends[]
|
||||||
req_friends: string[]
|
req_friends: IFriends[]
|
||||||
|
|
||||||
// in memory
|
// in memory
|
||||||
asked_friends: any[]
|
asked_friends: any[]
|
||||||
@@ -69,6 +74,7 @@ export interface IUserFields {
|
|||||||
perm?: number
|
perm?: number
|
||||||
verified_email?: boolean
|
verified_email?: boolean
|
||||||
verified_by_aportador?: boolean
|
verified_by_aportador?: boolean
|
||||||
|
trust_modified?: Date
|
||||||
aportador_solidario?: string
|
aportador_solidario?: string
|
||||||
|
|
||||||
made_gift?: boolean
|
made_gift?: boolean
|
||||||
|
|||||||
@@ -378,6 +378,7 @@ const msg_it = {
|
|||||||
legenda: 'Legenda',
|
legenda: 'Legenda',
|
||||||
aportador_solidario: 'Chi ti ha Invitato',
|
aportador_solidario: 'Chi ti ha Invitato',
|
||||||
verified_by_aportador: 'Verificato dall\'Invitante',
|
verified_by_aportador: 'Verificato dall\'Invitante',
|
||||||
|
trust_modified: 'Fiducia Modificata',
|
||||||
blocked: 'Bloccato',
|
blocked: 'Bloccato',
|
||||||
username_who_block: 'Bloccato da',
|
username_who_block: 'Bloccato da',
|
||||||
username_regala_invitato: 'Username del Destinatario del regalo',
|
username_regala_invitato: 'Username del Destinatario del regalo',
|
||||||
@@ -843,7 +844,8 @@ const msg_it = {
|
|||||||
friends: {
|
friends: {
|
||||||
accept_trust: 'Accetta Fiducia',
|
accept_trust: 'Accetta Fiducia',
|
||||||
accept_friend: 'Accetta Amicizia',
|
accept_friend: 'Accetta Amicizia',
|
||||||
reject_trust: 'Rifiuta Fiducia',
|
refuse_trust: 'Rifiuta Fiducia',
|
||||||
|
reject_trust: 'Revoca Fiducia',
|
||||||
remove_from_myfriends: 'Rimuovi dagli Amici',
|
remove_from_myfriends: 'Rimuovi dagli Amici',
|
||||||
block_user: 'Blocca Utente',
|
block_user: 'Blocca Utente',
|
||||||
ask_friend: 'Chiedi l\'Amicizia',
|
ask_friend: 'Chiedi l\'Amicizia',
|
||||||
|
|||||||
@@ -1301,6 +1301,7 @@ export const fieldsTable = {
|
|||||||
AddCol({ name: 'note', label_trans: 'reg.note' }),
|
AddCol({ name: 'note', label_trans: 'reg.note' }),
|
||||||
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
|
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: 'verified_by_aportador', label_trans: 'reg.verified_by_aportador', fieldtype: costanti.FieldType.boolean }),
|
||||||
|
AddCol({ name: 'trust_modified', label_trans: 'reg.trust_modified', fieldtype: costanti.FieldType.date }),
|
||||||
AddCol({ name: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
|
AddCol({ name: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
|
||||||
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
|
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
|
||||||
AddCol({
|
AddCol({
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
IFriends,
|
||||||
ISigninOptions,
|
ISigninOptions,
|
||||||
ISignupOptions, IUserFields, IUserProfile, IUserState,
|
ISignupOptions, IUserFields, IUserProfile, IUserState,
|
||||||
} from '@src/model'
|
} from '@src/model'
|
||||||
@@ -176,13 +177,6 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|
||||||
IsReqFriendByUsername(username: string): boolean {
|
|
||||||
if (this.my.profile.req_friends)
|
|
||||||
return this.my.profile.req_friends.includes(username)
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
|
|
||||||
getUserByUsername(username: string): IUserFields | null {
|
getUserByUsername(username: string): IUserFields | null {
|
||||||
// Check if is this User!
|
// Check if is this User!
|
||||||
if (this.my.username === username) return this.my
|
if (this.my.username === username) return this.my
|
||||||
|
|||||||
Reference in New Issue
Block a user