- Accepted and Refused Group Entering

- Report a User
This commit is contained in:
paoloar77
2022-08-04 17:30:01 +02:00
parent 1144177168
commit 66ee007e92
22 changed files with 378 additions and 341 deletions

View File

@@ -525,6 +525,7 @@ export const colmyUserPeople = [
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
}),
AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'profile.born_city_id', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.select_by_server,
jointable: 'cities',
@@ -2153,6 +2154,10 @@ export const colTableUsersISP = [
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: 'username_who_block', label_trans: 'reg.username_who_block' }),
AddCol({ name: 'date_blocked', label_trans: 'reg.date_blocked', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'username_who_reported', label_trans: 'reg.username_who_reported' }),
AddCol({ name: 'date_reported', label_trans: 'reg.date_reported', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'profile.resplist',
field: 'profile',

View File

@@ -4671,6 +4671,22 @@ export const tools = {
})
},
reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
const userStore = useUserStore()
$q.dialog({
message: t('db.domanda_reportuser', { 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.REPORT_USER, null).then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('db.reporteduser'))
}
})
})
},
refuseReqFriends($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
@@ -4696,6 +4712,7 @@ export const tools = {
addToMyGroups($q: any, username: string, groupnameDest: string) {
const userStore = useUserStore()
const notifStore = useNotifStore()
$q.dialog({
message: t('db.domanda_addtogroup', { username, groupname: groupnameDest }),
ok: { label: t('dialog.yes'), push: true },
@@ -4703,9 +4720,10 @@ export const tools = {
title: t('db.domanda')
}).onOk(() => {
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, true)
.then((res: any) => {
if (res) {
notifStore.updateNotification = true
if (userStore.my.profile.mygroups)
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
else
@@ -4716,6 +4734,27 @@ export const tools = {
})
},
refuseReqGroup($q: any, username: string, groupnameDest: string) {
const userStore = useUserStore()
const notifStore = useNotifStore()
$q.dialog({
message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, null).then((res) => {
if (res) {
notifStore.updateNotification = true
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
tools.showPositiveNotif($q, t('db.refusedgroup'))
}
})
})
},
blockGroup($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
@@ -5063,6 +5102,8 @@ export const tools = {
tools.addToMyGroups($q, username, dest)
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
tools.setRequestGroup($q, username, dest, value)
} else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
tools.refuseReqGroup($q, username, dest)
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
tools.cancelReqGroups($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {