- Add to Friends
- remove from Friend list - Cancel Ask Friend .... OK !
This commit is contained in:
@@ -41,3 +41,7 @@
|
||||
padding: 4px 8px !important;
|
||||
}
|
||||
|
||||
|
||||
.q-table__top{
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
@@ -12,14 +12,12 @@ import {
|
||||
ISearchList,
|
||||
IPagination,
|
||||
IParamDialog,
|
||||
IEvents,
|
||||
IDataToSet,
|
||||
IMySkill, ISkill
|
||||
} from '../../model'
|
||||
import { lists } from '../../store/Modules/lists'
|
||||
import { IParamsQuery } from '../../model/GlobalStore'
|
||||
import { CMyUser } from '../CMyUser'
|
||||
IMySkill
|
||||
} from 'model'
|
||||
import { lists } from '@store/Modules/lists'
|
||||
import { IParamsQuery } from 'model'
|
||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||
import { CMyFriends } from '../CMyFriends'
|
||||
import { CMyFieldDb } from '../CMyFieldDb'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
@@ -28,9 +26,7 @@ import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { useCalendarStore } from '@store/CalendarStore'
|
||||
import translate from '@/globalroutines/util'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CGridTableRec',
|
||||
@@ -167,8 +163,13 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
showCol: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyUser },
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -189,7 +190,7 @@ export default defineComponent({
|
||||
const mytitle = ref('')
|
||||
const mycolumns = ref([])
|
||||
const colkey = ref('')
|
||||
const search = ref('')
|
||||
const search = ref('paoloar773')
|
||||
|
||||
const tablesel = ref('')
|
||||
|
||||
@@ -222,6 +223,8 @@ export default defineComponent({
|
||||
|
||||
const selected: any = ref([])
|
||||
|
||||
const filter = ref(0)
|
||||
|
||||
const mycodeid = toRef(props, 'prop_codeId')
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean) => {
|
||||
@@ -1232,6 +1235,7 @@ export default defineComponent({
|
||||
checkIfShowRec,
|
||||
valoriopt,
|
||||
labelcombo,
|
||||
filter,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@click="createNewRecordDialog"></q-btn>
|
||||
</div>
|
||||
|
||||
<div :class="$q.screen.lt.sm ? `` : `q-gutter-md q-ma-xs` + ` row`">
|
||||
<div v-if="butt_modif_new || mytitle" :class="$q.screen.lt.sm ? `` : `q-gutter-md q-ma-xs` + ` row`">
|
||||
<div class="q-table__title" style="min-width: 150px;">{{ mytitle }}</div>
|
||||
<q-space></q-space>
|
||||
<div v-if="butt_modif_new">
|
||||
@@ -99,7 +99,7 @@
|
||||
<template v-slot:top-left>
|
||||
|
||||
<div v-if="searchList"
|
||||
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue`">
|
||||
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue`">
|
||||
<span v-for="(item, index) in searchList" :key="index">
|
||||
<CMySelect
|
||||
v-if="item.type === costanti.FieldType.select"
|
||||
@@ -184,7 +184,7 @@
|
||||
|
||||
<q-space></q-space>
|
||||
<q-select
|
||||
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit)"
|
||||
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol"
|
||||
v-model="colVisib"
|
||||
rounded
|
||||
outlined
|
||||
@@ -251,10 +251,15 @@
|
||||
|
||||
|
||||
<template v-slot:item="props">
|
||||
<div v-if="showType === costanti.SHOW_USERINFO">
|
||||
<CMyUser
|
||||
:mycontact="props.row">
|
||||
</CMyUser>
|
||||
<div v-if="showType === costanti.SHOW_USERINFO" class="fill-all-width">
|
||||
<div>
|
||||
<CMyFriends
|
||||
v-model="filter"
|
||||
:finder="false"
|
||||
:mycontact="props.row"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div
|
||||
@@ -316,16 +321,6 @@
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
<q-btn
|
||||
flat round dense
|
||||
:icon="props.inFullscreen ? 'fullscreen_exit' : 'fullscreen'"
|
||||
@click="props.toggleFullscreen"
|
||||
class="q-ml-md">
|
||||
</q-btn>
|
||||
-->
|
||||
<!---->
|
||||
</q-table>
|
||||
|
||||
<div v-if="rowclicksel">
|
||||
|
||||
0
src/components/CMyFriends/CMyFriends.scss
Executable file
0
src/components/CMyFriends/CMyFriends.scss
Executable file
365
src/components/CMyFriends/CMyFriends.ts
Executable file
365
src/components/CMyFriends/CMyFriends.ts
Executable file
@@ -0,0 +1,365 @@
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { computed, defineComponent, onMounted, PropType, ref, toRef } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { ISearchList, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyFriends',
|
||||
components: { CMyUser },
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
finder: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
mycontact: {
|
||||
type: Object as PropType<IUserFields | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
myusername: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const username = ref('')
|
||||
const listTrusted = ref(<IUserFields[]>[])
|
||||
|
||||
const filtroutente = ref(<any[]>[])
|
||||
|
||||
const listfriendsfiltered = computed(() => {
|
||||
let arr: any[] = []
|
||||
try {
|
||||
if (props.modelValue === costanti.FRIENDS) {
|
||||
arr = userStore.my.profile.friends
|
||||
} else if (props.modelValue === costanti.REQ_FRIENDS) {
|
||||
arr = userStore.my.profile.req_friends
|
||||
} else if (props.modelValue === costanti.ASK_SENT_FRIENDS) {
|
||||
arr = userStore.my.profile.asked_friends
|
||||
} else if (props.modelValue === costanti.ASK_TRUST) {
|
||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
|
||||
} else if (props.modelValue === costanti.TRUSTED) {
|
||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador)
|
||||
} else if (props.modelValue === costanti.REJECTED) {
|
||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === false)
|
||||
}
|
||||
} catch (e) {
|
||||
arr = []
|
||||
}
|
||||
|
||||
return arr
|
||||
})
|
||||
|
||||
const myoptions = computed(() => {
|
||||
const mybutt = []
|
||||
mybutt.push({ label: t('mypages.find_people'), value: costanti.FIND_PEOPLE })
|
||||
|
||||
if (numFriends.value > 0 || props.modelValue === costanti.FRIENDS)
|
||||
mybutt.push({ label: t('mypages.friends') + ' (' + numFriends.value + ')', value: costanti.FRIENDS })
|
||||
|
||||
if (numReqFriends.value > 0 || props.modelValue === costanti.REQ_FRIENDS)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_friends') + ' (' + numReqFriends.value + ')',
|
||||
value: costanti.REQ_FRIENDS
|
||||
})
|
||||
if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_sent_friends') + ' (' + numAskSentFriends.value + ')',
|
||||
value: costanti.ASK_SENT_FRIENDS
|
||||
})
|
||||
if (numAskTrust.value > 0 || props.modelValue === costanti.ASK_TRUST)
|
||||
mybutt.push({ label: t('mypages.request_trust') + ' (' + numAskTrust.value + ')', value: costanti.ASK_TRUST })
|
||||
if (numTrusted.value > 0 || props.modelValue === costanti.TRUSTED)
|
||||
mybutt.push({ label: t('mypages.trusted') + ' (' + numTrusted.value + ')', value: costanti.TRUSTED })
|
||||
if (numRejected.value > 0 || props.modelValue === costanti.REJECTED)
|
||||
mybutt.push({ label: t('mypages.rejected') + ' (' + numRejected.value + ')', value: costanti.REJECTED })
|
||||
|
||||
return mybutt
|
||||
})
|
||||
|
||||
const numFriends = computed(() => {
|
||||
const arr = userStore.my.profile.friends
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numReqFriends = computed(() => {
|
||||
const arr = userStore.my.profile.req_friends
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numAskSentFriends = computed(() => {
|
||||
const arr = userStore.my.profile.asked_friends
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numAskTrust = computed(() => {
|
||||
if (!listTrusted.value)
|
||||
return 0
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numTrusted = computed(() => {
|
||||
if (!listTrusted.value)
|
||||
return 0
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador)
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numRejected = computed(() => {
|
||||
if (!listTrusted.value)
|
||||
return 0
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === false)
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
function loadFriends() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
userStore.loadFriends(username.value).then((ris) => {
|
||||
console.log('ris', ris)
|
||||
if (ris) {
|
||||
userStore.my.profile.friends = ris.listFriends ? ris.listFriends : []
|
||||
userStore.my.profile.req_friends = ris.listRequestFriends ? ris.listRequestFriends : []
|
||||
userStore.my.profile.asked_friends = ris.listSentRequestFriends ? ris.listSentRequestFriends : []
|
||||
listTrusted.value = ris.listTrusted ? ris.listTrusted : []
|
||||
filtroutente.value = [{ userId: userStore.my._id }]
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function setRequestTrust(usernameDest: string, value: any) {
|
||||
let msg = ''
|
||||
if (value) {
|
||||
msg = t('db.domanda_trusted', { username: usernameDest })
|
||||
} else {
|
||||
msg = t('db.domanda_rejectedtrust', { username: usernameDest })
|
||||
}
|
||||
|
||||
$q.dialog({
|
||||
message: msg,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.SETTRUST, value).then((res) => {
|
||||
if (res) {
|
||||
const myuser: IUserFields = listTrusted.value.find((rec: IUserFields) => rec.username === usernameDest)!
|
||||
if (myuser) {
|
||||
myuser.verified_by_aportador = value
|
||||
if (value) {
|
||||
// add to my friends
|
||||
userStore.my.profile.friends = [...userStore.my.profile.friends, res]
|
||||
} else {
|
||||
// REMOVE to Trusted
|
||||
listTrusted.value = listTrusted.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
}
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.trusted'))
|
||||
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function setRequestFriendship(usernameDest: string, value: boolean) {
|
||||
let msg = ''
|
||||
if (value) {
|
||||
msg = t('db.domanda_ask_friend', { username: usernameDest })
|
||||
} else {
|
||||
msg = t('db.domanda_revoke_friend', { username: usernameDest })
|
||||
}
|
||||
|
||||
$q.dialog({
|
||||
message: msg,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REQFRIEND, value)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req Friends
|
||||
userStore.my.profile.asked_friends.push(res)
|
||||
tools.showPositiveNotif($q, t('db.askedtofriend', { username: usernameDest }))
|
||||
} else {
|
||||
// REMOVE to req Friends
|
||||
userStore.my.profile.asked_friends = userStore.my.profile.asked_friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.revoketofriend', { username: usernameDest }))
|
||||
}
|
||||
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function addToMyFriends(usernameDest: string) {
|
||||
$q.dialog({
|
||||
message: t('db.domanda_addtofriend', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.SETFRIEND, null)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
console.log('res = ', 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)
|
||||
tools.showPositiveNotif($q, t('db.addedfriend'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function removeFromMyFriends(usernameDest: string) {
|
||||
$q.dialog({
|
||||
message: t('db.domanda_removefriend', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
||||
if (res) {
|
||||
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.removedfriend'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function refuseReqFriends(usernameDest: string) {
|
||||
$q.dialog({
|
||||
message: t('db.domanda_removefriend', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
||||
if (res) {
|
||||
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((user: any) => user !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.removedfriend'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function cancelReqFriends(usernameDest: string) {
|
||||
$q.dialog({
|
||||
message: t('db.domanda_cancel_req_friend', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, null).then((res) => {
|
||||
if (res) {
|
||||
userStore.my.profile.asked_friends = userStore.my.profile.asked_friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.cancel_req_friend'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function blockUser(usernameDest: string) {
|
||||
$q.dialog({
|
||||
message: t('db.domanda_blockuser', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.BLOCK_USER, null).then((res) => {
|
||||
if (res) {
|
||||
userStore.my.profile.friends = userStore.my.profile.friends.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.blockedfriend'))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function setCmd(cmd: number, usernameDest: string, value: any = '') {
|
||||
if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
|
||||
setRequestTrust(usernameDest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
removeFromMyFriends(usernameDest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.BLOCK_USER) {
|
||||
blockUser(usernameDest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
|
||||
addToMyFriends(usernameDest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) {
|
||||
setRequestFriendship(usernameDest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
|
||||
refuseReqFriends(usernameDest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
|
||||
cancelReqFriends(usernameDest)
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
username.value = userStore.my.username
|
||||
loadFriends()
|
||||
|
||||
}
|
||||
|
||||
function updateValue(val: number) {
|
||||
emit('update:modelValue', val)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
shared_consts,
|
||||
filtroutente,
|
||||
listfriendsfiltered,
|
||||
setCmd,
|
||||
updateValue,
|
||||
myoptions,
|
||||
}
|
||||
}
|
||||
})
|
||||
53
src/components/CMyFriends/CMyFriends.vue
Executable file
53
src/components/CMyFriends/CMyFriends.vue
Executable file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div v-if="finder" class="q-gutter-sm q-pa-sm q-pb-sm">
|
||||
<q-btn-toggle
|
||||
:model-value="modelValue"
|
||||
@update:model-value="updateValue"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
push
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="myoptions"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="finder" class="">
|
||||
|
||||
<div v-if="modelValue === costanti.FIND_PEOPLE">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-list>
|
||||
<span v-for="(contact, index) in listfriendsfiltered" :key="index" class="q-my-sm" clickable>
|
||||
<CMyUser
|
||||
:mycontact="contact"
|
||||
@setCmd="setCmd"
|
||||
:visu="modelValue">
|
||||
</CMyUser>
|
||||
</span>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-list class="width-container">
|
||||
<span class="q-my-sm" clickable>
|
||||
<CMyUser
|
||||
:mycontact="mycontact"
|
||||
@setCmd="setCmd"
|
||||
:visu="visu">
|
||||
</CMyUser>
|
||||
</span>
|
||||
</q-list>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyFriends.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyFriends';
|
||||
</style>
|
||||
|
||||
1
src/components/CMyFriends/index.ts
Executable file
1
src/components/CMyFriends/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMyFriends} from './CMyFriends.vue'
|
||||
@@ -81,6 +81,7 @@ export default defineComponent({
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
userStore,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -32,6 +32,39 @@
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.REQ_FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.SETFRIEND, contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd(shared_consts.FRIENDSCMD.REQFRIEND, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.ASK_SENT_FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd(shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, contact.username)">
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.ASK_TRUST">
|
||||
<q-item-label>
|
||||
<q-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)"/>
|
||||
@@ -44,21 +77,44 @@
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.SETFRIEND, contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</q-item-section>
|
||||
<q-list v-if="!userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.REQFRIEND, contact.username, true)">
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_friend') }}</q-item-section>
|
||||
<q-item-section>{{ $t('friends.reject_trust') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.REEJECTED">
|
||||
<q-item-section side v-if="visu === costanti.FIND_PEOPLE">
|
||||
<q-item-label>
|
||||
<q-btn v-if="contact.username !== userStore.my.username" rounded :icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.REQFRIEND, contact.username, true)">
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.REQFRIEND, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, contact.username)">
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.REJECTED">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
|
||||
@@ -112,24 +112,12 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function getFilterCustom() {
|
||||
/*if (props.username) {
|
||||
return [
|
||||
{ username: props.username }
|
||||
]
|
||||
} else {
|
||||
return props.filtercustom
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
colmySkills,
|
||||
getdefaultnewrec,
|
||||
extraparams,
|
||||
getFilterCustom,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -36,4 +36,5 @@ export * from './CFacebookFrame'
|
||||
export * from './CVerifyEmail'
|
||||
export * from './CMyUser'
|
||||
export * from './CVerifyTelegram'
|
||||
export * from './CMyFriends'
|
||||
// export * from './CPreloadImages'
|
||||
|
||||
Reference in New Issue
Block a user