Friends, search
This commit is contained in:
@@ -11,7 +11,7 @@ PROVA_PAOLO="PROVA ENV FUNZIONA!"
|
|||||||
LANG_DEFAULT="it"
|
LANG_DEFAULT="it"
|
||||||
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
|
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
|
||||||
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
|
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
|
||||||
MONGODB_HOST="http://192.168.1.8:3000"
|
MONGODB_HOST="http://192.168.0.200:3000"
|
||||||
LOGO_REG="freeplanet-logo-full.svg"
|
LOGO_REG="freeplanet-logo-full.svg"
|
||||||
TEST_NAME="Paolo"
|
TEST_NAME="Paolo"
|
||||||
TEST_SURNAME="Arena"
|
TEST_SURNAME="Arena"
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ module.exports = configure((ctx) => ({
|
|||||||
https: false,
|
https: false,
|
||||||
port: 8083,
|
port: 8083,
|
||||||
open: false, // opens browser window automatically
|
open: false, // opens browser window automatically
|
||||||
|
liveReload: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
|
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ if (workbox) {
|
|||||||
registerRoute(
|
registerRoute(
|
||||||
new RegExp(/\.(?:png|gif|jpg|jpeg)$/),
|
new RegExp(/\.(?:png|gif|jpg|jpeg)$/),
|
||||||
new CacheFirst({
|
new CacheFirst({
|
||||||
cacheName: 'images',
|
cacheName: 'images-upload',
|
||||||
plugins: [
|
plugins: [
|
||||||
// Ensure that only requests that result in a 200 status are cached
|
// Ensure that only requests that result in a 200 status are cached
|
||||||
new CacheableResponsePlugin({
|
new CacheableResponsePlugin({
|
||||||
@@ -314,9 +314,9 @@ if (workbox) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
registerRoute(
|
registerRoute(
|
||||||
new RegExp(/.*\/(?:statics).*$/),
|
new RegExp(/.*\/(?:public).*$/),
|
||||||
new CacheFirst({
|
new CacheFirst({
|
||||||
cacheName: 'statics',
|
cacheName: 'public',
|
||||||
plugins: [
|
plugins: [
|
||||||
// Ensure that only requests that result in a 200 status are cached
|
// Ensure that only requests that result in a 200 status are cached
|
||||||
new CacheableResponsePlugin({
|
new CacheableResponsePlugin({
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ register(process.env.SERVICE_WORKER_FILE ? process.env.SERVICE_WORKER_FILE : '',
|
|||||||
// $('#newvers').addClass('btnNewVersShow').removeClass("btnNewVersHide")
|
// $('#newvers').addClass('btnNewVersShow').removeClass("btnNewVersHide")
|
||||||
},
|
},
|
||||||
updated(registration) {
|
updated(registration) {
|
||||||
|
document.dispatchEvent(
|
||||||
|
new CustomEvent('swUpdated', { detail: registration })
|
||||||
|
)
|
||||||
console.log('New content is available; please refresh.')
|
console.log('New content is available; please refresh.')
|
||||||
},
|
},
|
||||||
offline() {
|
offline() {
|
||||||
|
|||||||
@@ -41,11 +41,14 @@ export const shared_consts = {
|
|||||||
|
|
||||||
FILTER_MYSKILL_SKILL: 1,
|
FILTER_MYSKILL_SKILL: 1,
|
||||||
|
|
||||||
|
OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
|
||||||
|
|
||||||
FRIENDSCMD: {
|
FRIENDSCMD: {
|
||||||
SETTRUST: 121,
|
SETTRUST: 121,
|
||||||
SETFRIEND: 132,
|
SETFRIEND: 132,
|
||||||
REMOVE_FROM_MYFRIENDS: 144,
|
REMOVE_FROM_MYFRIENDS: 144,
|
||||||
BLOCK_USER: 155,
|
BLOCK_USER: 155,
|
||||||
|
FIND_PEOPLE: 166,
|
||||||
},
|
},
|
||||||
|
|
||||||
REPORT_FILT_RESP: 1,
|
REPORT_FILT_RESP: 1,
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<q-chip>
|
<q-chip>
|
||||||
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
||||||
<img
|
<img
|
||||||
:src="`../../public/images/avatar/` + getWhereIcon(myevent.wherecode)"
|
:src="`images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||||
alt="Località">
|
alt="Località">
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
<q-avatar v-else color="blue" font-size="20px" text-color="white" icon="home">
|
<q-avatar v-else color="blue" font-size="20px" text-color="white" icon="home">
|
||||||
@@ -837,7 +837,7 @@
|
|||||||
<q-chip>
|
<q-chip>
|
||||||
<q-avatar v-if="getWhereIcon(event.wherecode)">
|
<q-avatar v-if="getWhereIcon(event.wherecode)">
|
||||||
<img
|
<img
|
||||||
:src="`../../public/images/avatar/` + getWhereIcon(event.wherecode)"
|
:src="`images/avatar/` + getWhereIcon(event.wherecode)"
|
||||||
:alt="event.wherecode">
|
:alt="event.wherecode">
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
<q-avatar color="blue" font-size="20px" text-color="white" icon="home">
|
<q-avatar color="blue" font-size="20px" text-color="white" icon="home">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { IGallery, IImgGallery } from 'model'
|
|||||||
import { CMyPage } from '@/components/CMyPage'
|
import { CMyPage } from '@/components/CMyPage'
|
||||||
import { tools } from '@store/Modules/tools'
|
import { tools } from '@store/Modules/tools'
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
|
import { costanti } from '@costanti'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'CGallery',
|
name: 'CGallery',
|
||||||
@@ -246,7 +247,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getfullname(rec: any) {
|
function getfullname(rec: any) {
|
||||||
return 'upload/' + props.directory + '/' + rec.imagefile
|
return costanti.DIR_UPLOAD + props.directory + '/' + rec.imagefile
|
||||||
}
|
}
|
||||||
|
|
||||||
function copytoclipboard(rec: any) {
|
function copytoclipboard(rec: any) {
|
||||||
@@ -306,7 +307,7 @@ export default defineComponent({
|
|||||||
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
||||||
return 'images/images/pdf.jpg'
|
return 'images/images/pdf.jpg'
|
||||||
else
|
else
|
||||||
return 'upload/' + props.directory + '/' + gallerylistery.imagefile
|
return costanti.DIR_UPLOAD + props.directory + '/' + gallerylistery.imagefile
|
||||||
} else {
|
} else {
|
||||||
return 'images/noimg.png';
|
return 'images/noimg.png';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
accept=".jpg, image/*, .pdf"
|
accept=".jpg, image/*, .pdf"
|
||||||
:url="getUrl()"
|
:url="getUrl()"
|
||||||
:headers="tools.getheaders()"
|
:headers="tools.getheaders()"
|
||||||
:max-file-size="2000000"
|
:max-file-size="3000000"
|
||||||
multiple
|
multiple
|
||||||
auto-upload
|
auto-upload
|
||||||
hide-upload-btn
|
hide-upload-btn
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
} from '../../model'
|
} from '../../model'
|
||||||
import { lists } from '../../store/Modules/lists'
|
import { lists } from '../../store/Modules/lists'
|
||||||
import { IParamsQuery } from '../../model/GlobalStore'
|
import { IParamsQuery } from '../../model/GlobalStore'
|
||||||
|
import { CMyUser } from '../CMyUser'
|
||||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||||
import { CMyFieldDb } from '../CMyFieldDb'
|
import { CMyFieldDb } from '../CMyFieldDb'
|
||||||
import { CMySelect } from '../CMySelect'
|
import { CMySelect } from '../CMySelect'
|
||||||
@@ -53,6 +54,11 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
hint: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'Cerca',
|
||||||
|
},
|
||||||
prop_search: {
|
prop_search: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -68,6 +74,16 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
showType: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
finder_noNull: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
vertical: {
|
vertical: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -131,6 +147,10 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: {},
|
default: {},
|
||||||
},
|
},
|
||||||
|
options: {
|
||||||
|
required: false,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
prop_pagination: {
|
prop_pagination: {
|
||||||
type: Object as PropType<IPagination>,
|
type: Object as PropType<IPagination>,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -148,7 +168,7 @@ export default defineComponent({
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect },
|
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyUser },
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@@ -272,10 +292,10 @@ export default defineComponent({
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
// if (userStore.isAdmin || userStore.isManager)
|
if (userStore.isAdmin || userStore.isManager)
|
||||||
// return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// emulate 'SELECT count(*) FROM ...WHERE...'
|
// emulate 'SELECT count(*) FROM ...WHERE...'
|
||||||
@@ -397,7 +417,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (false && nosearch && props.finder) {
|
if ((false && nosearch && props.finder) || (props.finder_noNull && nosearch)) {
|
||||||
returnedData.value = []
|
returnedData.value = []
|
||||||
returnedCount = 0
|
returnedCount = 0
|
||||||
return true
|
return true
|
||||||
@@ -423,6 +443,7 @@ export default defineComponent({
|
|||||||
descending,
|
descending,
|
||||||
userId: userStore.my._id,
|
userId: userStore.my._id,
|
||||||
codeId: '',
|
codeId: '',
|
||||||
|
options: props.options,
|
||||||
}
|
}
|
||||||
|
|
||||||
params.codeId = mycodeid.value
|
params.codeId = mycodeid.value
|
||||||
@@ -820,7 +841,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
|
|
||||||
function clickFunz(item: any, col: IColGridTable) {
|
function clickFunz(item: any, col: IColGridTable) {
|
||||||
if (col.action) {
|
if (!!col && col.action) {
|
||||||
|
|
||||||
const table = mytable.value
|
const table = mytable.value
|
||||||
const ok = translate('dialog.yes')
|
const ok = translate('dialog.yes')
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
|
|
||||||
<div v-if="prop_search" class="q-mr-sm">
|
<div v-if="prop_search" class="q-mr-sm">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="search" filled dense type="search" debounce="500" hint="Cerca"
|
v-model="search" filled dense type="search" debounce="500" :hint="hint"
|
||||||
v-on:keyup.enter="doSearch">
|
v-on:keyup.enter="doSearch">
|
||||||
<template v-slot:after>
|
<template v-slot:after>
|
||||||
<q-btn v-if="mytable" dense label="" color="primary" @click="refresh" icon="search"></q-btn>
|
<q-btn v-if="mytable" dense label="" color="primary" @click="refresh" icon="search"></q-btn>
|
||||||
@@ -251,7 +251,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<template v-slot:item="props">
|
<template v-slot:item="props">
|
||||||
|
<div v-if="showType === costanti.SHOW_USERINFO">
|
||||||
|
<CMyUser
|
||||||
|
:mycontact="props.row">
|
||||||
|
</CMyUser>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
|
v-else
|
||||||
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
|
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
|
||||||
:style="props.selected ? 'transform: scale(0.95);' : ''"
|
:style="props.selected ? 'transform: scale(0.95);' : ''"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<!-- Se c'è un link, allora -->
|
<!-- Se c'è un link, allora -->
|
||||||
<q-btn
|
<q-btn
|
||||||
class="text-center boldhigh" v-if="myevent.linkpdf" size="md" type="a"
|
class="text-center boldhigh" v-if="myevent.linkpdf" size="md" type="a"
|
||||||
:href="`../../public/` + myevent.linkpdf"
|
:href="myevent.linkpdf"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
ripple rounded :label="myevent.title"
|
ripple rounded :label="myevent.title"
|
||||||
:color="myevent.bgcolor" text-color="white" glossy>
|
:color="myevent.bgcolor" text-color="white" glossy>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<q-chip>
|
<q-chip>
|
||||||
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
|
||||||
<img
|
<img
|
||||||
:src="`../../public/images/avatar/` + getWhereIcon(myevent.wherecode)"
|
:src="`images/avatar/` + getWhereIcon(myevent.wherecode)"
|
||||||
alt="località">
|
alt="località">
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
<q-avatar
|
<q-avatar
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
<div class="row justify-start q-ma-md">
|
<div class="row justify-start q-ma-md">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="myevent.linkpdf"
|
v-if="myevent.linkpdf"
|
||||||
size="md" type="a" :href="`../../public/` + myevent.linkpdf"
|
size="md" type="a" :href="myevent.linkpdf"
|
||||||
target="_blank" rounded outline
|
target="_blank" rounded outline
|
||||||
color="primary" icon="info"
|
color="primary" icon="info"
|
||||||
:label="$t('cal.showpdf')">
|
:label="$t('cal.showpdf')">
|
||||||
|
|||||||
4
src/components/CMyUser/CMyUser.scss
Executable file
4
src/components/CMyUser/CMyUser.scss
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
.myflex{
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
86
src/components/CMyUser/CMyUser.ts
Executable file
86
src/components/CMyUser/CMyUser.ts
Executable file
@@ -0,0 +1,86 @@
|
|||||||
|
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||||
|
import { useUserStore } from '@store/UserStore'
|
||||||
|
import { IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||||
|
import { costanti } from '@costanti'
|
||||||
|
import { shared_consts } from '@/common/shared_vuejs'
|
||||||
|
import { tools } from '@store/Modules/tools'
|
||||||
|
import { useQuasar } from 'quasar'
|
||||||
|
import { useI18n } from '@/boot/i18n'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'CMyUser',
|
||||||
|
emits: ['setCmd'],
|
||||||
|
props: {
|
||||||
|
mycontact: {
|
||||||
|
type: Object as PropType<IUserFields | null>,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
myusername: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
visu: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, { emit }) {
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const $q = useQuasar()
|
||||||
|
const { t } = useI18n()
|
||||||
|
const $router = useRouter()
|
||||||
|
const $route = useRoute()
|
||||||
|
|
||||||
|
const username = ref('')
|
||||||
|
|
||||||
|
const contact = ref(<IUserFields | null>null)
|
||||||
|
|
||||||
|
watch(() => props.mycontact, (newval, oldval) => {
|
||||||
|
console.log('watch: mycontact')
|
||||||
|
mounted()
|
||||||
|
})
|
||||||
|
|
||||||
|
function mounted() {
|
||||||
|
if (!props.mycontact) {
|
||||||
|
if (props.myusername) {
|
||||||
|
username.value = props.myusername
|
||||||
|
//++Todo: carica contact
|
||||||
|
contact.value = null
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (props.mycontact) {
|
||||||
|
contact.value = props.mycontact
|
||||||
|
username.value = props.mycontact.username
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getImgUser(profile: IUserFields) {
|
||||||
|
return userStore.getImgByProfile(profile)
|
||||||
|
}
|
||||||
|
|
||||||
|
function naviga(path: string) {
|
||||||
|
$router.push(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCmd(cmd: number, myusername: string, value: any = '') {
|
||||||
|
emit('setCmd', cmd, myusername, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(mounted)
|
||||||
|
|
||||||
|
return {
|
||||||
|
contact,
|
||||||
|
costanti,
|
||||||
|
getImgUser,
|
||||||
|
naviga,
|
||||||
|
setCmd,
|
||||||
|
shared_consts,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
84
src/components/CMyUser/CMyUser.vue
Executable file
84
src/components/CMyUser/CMyUser.vue
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="contact">
|
||||||
|
<q-item class="q-my-sm" clickable>
|
||||||
|
<q-item-section avatar @click="naviga(`/my/` + contact.username)">
|
||||||
|
<q-avatar size="60px">
|
||||||
|
<q-img :src="getImgUser(contact)" :alt="contact.username" img-class="imgprofile" height="60px"/>
|
||||||
|
</q-avatar>
|
||||||
|
</q-item-section>
|
||||||
|
|
||||||
|
<q-item-section @click="naviga(`/my/` + contact.username)">
|
||||||
|
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
|
||||||
|
</q-item-label>
|
||||||
|
<q-item-label caption lines="1">{{ contact.email }}</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
|
||||||
|
<q-item-section side v-if="visu === costanti.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.REMOVE_FROM_MYFRIENDS, contact.username)">
|
||||||
|
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
<q-list style="min-width: 150px">
|
||||||
|
<q-item clickable icon="fas fa-ban" v-close-popup @click="setCmd(shared_consts.FRIENDSCMD.BLOCK_USER, contact.username)">
|
||||||
|
<q-item-section>{{ $t('friends.block_user') }}</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)"/>
|
||||||
|
</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-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section side v-if="visu === costanti.TRUSTED">
|
||||||
|
<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-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>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section side v-if="visu === costanti.REEJECTED">
|
||||||
|
<q-item-label>
|
||||||
|
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||||
|
<q-menu>
|
||||||
|
<q-list style="min-width: 200px">
|
||||||
|
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||||
|
@click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, true)">
|
||||||
|
<q-item-section>{{ $t('friends.accept_trust') }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
</q-item-label>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" src="./CMyUser.ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './CMyUser.scss';
|
||||||
|
</style>
|
||||||
1
src/components/CMyUser/index.ts
Executable file
1
src/components/CMyUser/index.ts
Executable file
@@ -0,0 +1 @@
|
|||||||
|
export { default as CMyUser } from './CMyUser.vue'
|
||||||
@@ -32,7 +32,7 @@ $textcol_scuro: darkblue;
|
|||||||
background-repeat: no-repeat !important;
|
background-repeat: no-repeat !important;
|
||||||
background-position: top;
|
background-position: top;
|
||||||
background-size: contain !important;
|
background-size: contain !important;
|
||||||
background-image: url(../../../public/images/landing_first_section.png) !important
|
background-image: url(/public/images/landing_first_section.png) !important
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +67,6 @@ $textcol_scuro: darkblue;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.carousel_img_3 {
|
.carousel_img_3 {
|
||||||
//background-image: url(../../public/images/cibo_sano.jpg);
|
|
||||||
background-size: cover !important;
|
background-size: cover !important;
|
||||||
background-position: 50% center !important;
|
background-position: 50% center !important;
|
||||||
background-repeat: no-repeat !important;
|
background-repeat: no-repeat !important;
|
||||||
|
|||||||
@@ -34,5 +34,6 @@ export * from './CMySingleEvent'
|
|||||||
// export * from './PagePolicy'
|
// export * from './PagePolicy'
|
||||||
export * from './CFacebookFrame'
|
export * from './CFacebookFrame'
|
||||||
export * from './CVerifyEmail'
|
export * from './CVerifyEmail'
|
||||||
|
export * from './CMyUser'
|
||||||
export * from './CVerifyTelegram'
|
export * from './CVerifyTelegram'
|
||||||
// export * from './CPreloadImages'
|
// export * from './CPreloadImages'
|
||||||
|
|||||||
@@ -10,12 +10,16 @@ function translate(params: any) {
|
|||||||
const stringa = messages[lang]
|
const stringa = messages[lang]
|
||||||
|
|
||||||
let ris = stringa
|
let ris = stringa
|
||||||
if (ris) {
|
try {
|
||||||
msg.forEach((param: any) => {
|
if (ris) {
|
||||||
ris = ris[param]
|
msg.forEach((param: any) => {
|
||||||
})
|
ris = ris[param]
|
||||||
} else {
|
})
|
||||||
console.log('ERRORE IN TRANSLATE! ', params, ' NON ESISTE!')
|
} else {
|
||||||
|
console.log('ERRORE IN TRANSLATE! ', params, ' NON ESISTE!')
|
||||||
|
return params
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,10 @@ export default function () {
|
|||||||
function getMyImgforIcon() {
|
function getMyImgforIcon() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const mypath = userStore.getImgByUsername(userStore.my.username)
|
const mypath = userStore.getImgByUsername(userStore.my.username)
|
||||||
let img_small = tools.baseurl(mypath) + '/' + serv_constants.PREFIX_IMG_SMALL + tools.getLastItem(mypath);
|
const filename = tools.getLastItem(mypath)
|
||||||
|
let img_small = tools.baseurl(mypath) + '/' + serv_constants.PREFIX_IMG_SMALL + filename
|
||||||
console.log('img_small', img_small)
|
console.log('img_small', img_small)
|
||||||
return (img_small !== '') ? `img:${img_small}` : 'fas fa-user'
|
return (filename !== '') ? `img:${img_small}` : 'fas fa-user'
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIconCart() {
|
function getIconCart() {
|
||||||
|
|||||||
@@ -475,6 +475,7 @@ export interface IParamsQuery {
|
|||||||
lookup2?: IParLookup
|
lookup2?: IParLookup
|
||||||
lookup3?: IParLookup
|
lookup3?: IParLookup
|
||||||
lookup4?: IParLookup
|
lookup4?: IParLookup
|
||||||
|
options?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IColGridTable {
|
export interface IColGridTable {
|
||||||
|
|||||||
@@ -180,8 +180,15 @@ const msg_it = {
|
|||||||
friendsadded: 'Aggiunto alla lista di Amici',
|
friendsadded: 'Aggiunto alla lista di Amici',
|
||||||
blockedfriend: 'Utente Bloccato',
|
blockedfriend: 'Utente Bloccato',
|
||||||
removedfriend: 'Rimosso dalla lista di Amici',
|
removedfriend: 'Rimosso dalla lista di Amici',
|
||||||
|
addedfriend: 'Aggiunto alla lista di Amici',
|
||||||
|
domanda_trusted: 'Accettare la Fiducia a {username}?',
|
||||||
|
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
|
||||||
|
domanda_blockuser: 'Bloccare {username}?',
|
||||||
|
domanda: 'Domanda',
|
||||||
trusted: 'Accettato la Fiducia',
|
trusted: 'Accettato la Fiducia',
|
||||||
rejected: 'Rifiutato la Fiducia',
|
rejected: 'Rifiutato la Fiducia',
|
||||||
|
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
||||||
|
domanda_removefriend: 'Rimuovi dagli Amici {username}?',
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -819,14 +826,17 @@ const msg_it = {
|
|||||||
date_updated: 'Ult. Aggiornamento',
|
date_updated: 'Ult. Aggiornamento',
|
||||||
},
|
},
|
||||||
mypages: {
|
mypages: {
|
||||||
|
find_people: 'Cerca Persone',
|
||||||
friends: 'Amici',
|
friends: 'Amici',
|
||||||
request_trust: 'Richieste di Fiducia',
|
request_trust: 'Richieste',
|
||||||
trusted: 'Accettati',
|
trusted: 'Accettati',
|
||||||
rejected: 'Rifiutati',
|
rejected: 'Rifiutati',
|
||||||
},
|
},
|
||||||
friends: {
|
friends: {
|
||||||
accept: 'Accetta',
|
accept_trust: 'Accetta Fiducia',
|
||||||
reject: 'Rifiuta',
|
accept_friend: 'Accetta Amicizia',
|
||||||
|
reject_trust: 'Rifiuta Fiducia',
|
||||||
|
reject_friend: 'Rifiuta Fiducia',
|
||||||
remove_from_myfriends: 'Rimuovi dagli Amici',
|
remove_from_myfriends: 'Rimuovi dagli Amici',
|
||||||
block_user: 'Blocca Utente',
|
block_user: 'Blocca Utente',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,15 @@ export const costanti = {
|
|||||||
CONFIG_ID_STATE_CONN: '2',
|
CONFIG_ID_STATE_CONN: '2',
|
||||||
CONFIG_ID_SHOW_TYPE_TODOS: '3',
|
CONFIG_ID_SHOW_TYPE_TODOS: '3',
|
||||||
|
|
||||||
|
SHOW_USERINFO: 1,
|
||||||
|
|
||||||
|
DIR_UPLOAD: 'upload/', // upload/
|
||||||
|
|
||||||
FRIENDS: 1,
|
FRIENDS: 1,
|
||||||
ASK_TRUST: 2,
|
ASK_TRUST: 2,
|
||||||
TRUSTED: 3,
|
TRUSTED: 3,
|
||||||
REEJECTED: 4,
|
REEJECTED: 4,
|
||||||
|
FIND_PEOPLE: 10,
|
||||||
|
|
||||||
FILTER_TUTTI: -100,
|
FILTER_TUTTI: -100,
|
||||||
|
|
||||||
|
|||||||
@@ -384,6 +384,19 @@ export const colSubSkills = [
|
|||||||
AddCol(DeleteRec),
|
AddCol(DeleteRec),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const colmyUserPeople = [
|
||||||
|
// AddCol({ name: '_id', label_trans: 'reg.id' }),
|
||||||
|
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
|
||||||
|
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||||
|
AddCol({
|
||||||
|
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
|
||||||
|
}),
|
||||||
|
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
|
||||||
|
// AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const colmySkills = [
|
export const colmySkills = [
|
||||||
/*AddCol({
|
/*AddCol({
|
||||||
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.string, jointable: 'users',
|
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.string, jointable: 'users',
|
||||||
|
|||||||
@@ -3368,7 +3368,7 @@ export const tools = {
|
|||||||
return mystr.replace(/\//g, '-')
|
return mystr.replace(/\//g, '-')
|
||||||
},
|
},
|
||||||
geturlrelativeprofile() {
|
geturlrelativeprofile() {
|
||||||
return 'upload/profile'
|
return costanti.DIR_UPLOAD + 'profile'
|
||||||
},
|
},
|
||||||
getvers() {
|
getvers() {
|
||||||
return process.env.APP_VERSION
|
return process.env.APP_VERSION
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { useTodoStore } from '@store/Todos'
|
|||||||
import { Router } from 'vue-router'
|
import { Router } from 'vue-router'
|
||||||
import { useProjectStore } from '@store/Projects'
|
import { useProjectStore } from '@store/Projects'
|
||||||
import { shared_consts } from '@/common/shared_vuejs'
|
import { shared_consts } from '@/common/shared_vuejs'
|
||||||
|
import { costanti } from '@costanti'
|
||||||
|
|
||||||
export const DefaultUser: IUserFields = {
|
export const DefaultUser: IUserFields = {
|
||||||
_id: '',
|
_id: '',
|
||||||
@@ -171,7 +172,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
const myrec = this.getUserByUsername(username)
|
const myrec = this.getUserByUsername(username)
|
||||||
// console.log('myrec', myrec)
|
// console.log('myrec', myrec)
|
||||||
if (myrec && myrec.profile && !!myrec.profile.img && myrec.profile.img !== '' && myrec.profile.img !== 'undefined') {
|
if (myrec && myrec.profile && !!myrec.profile.img && myrec.profile.img !== '' && myrec.profile.img !== 'undefined') {
|
||||||
return 'upload/profile/' + this.my.username + '/' + myrec.profile.img
|
return costanti.DIR_UPLOAD+'profile/' + this.my.username + '/' + myrec.profile.img
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
@@ -180,7 +181,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
if (userparam.profile && userparam.profile.img) {
|
if (userparam.profile && userparam.profile.img) {
|
||||||
return 'upload/profile/' + userparam.username + '/' + userparam.profile.img
|
return costanti.DIR_UPLOAD + 'profile/' + userparam.username + '/' + userparam.profile.img
|
||||||
}
|
}
|
||||||
}catch (e) {}
|
}catch (e) {}
|
||||||
return 'images/noimg.png'
|
return 'images/noimg.png'
|
||||||
@@ -843,7 +844,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
async setFriendsCmd($q: any, t: any, usernameOrig: string, usernameDest: string, cmd: number, value: any) {
|
async setFriendsCmd($q: any, t: any, usernameOrig: string, usernameDest: string, cmd: number, value: any) {
|
||||||
return Api.SendReq('/users/friends/cmd', 'POST', {usernameOrig, usernameDest, cmd, value})
|
return Api.SendReq('/users/friends/cmd', 'POST', {usernameOrig, usernameDest, cmd, value})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return !!res
|
return res.data
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@@ -3,22 +3,23 @@ import { CTitleBanner } from '@/components/CTitleBanner'
|
|||||||
import { CProfile } from '@/components/CProfile'
|
import { CProfile } from '@/components/CProfile'
|
||||||
import { CSkill } from '@/components/CSkill'
|
import { CSkill } from '@/components/CSkill'
|
||||||
import { CDateTime } from '@/components/CDateTime'
|
import { CDateTime } from '@/components/CDateTime'
|
||||||
|
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||||
|
import { CMyUser } from '@/components/CMyUser'
|
||||||
import { tools } from '@store/Modules/tools'
|
import { tools } from '@store/Modules/tools'
|
||||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
import { computed, defineComponent, onMounted, ref } from 'vue'
|
||||||
import { useUserStore } from '@store/UserStore'
|
import { useUserStore } from '@store/UserStore'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
|
||||||
import { useI18n } from '@/boot/i18n'
|
import { useI18n } from '@/boot/i18n'
|
||||||
import { toolsext } from '@store/Modules/toolsext'
|
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
import { IUserFields, IUserProfile } from 'model'
|
import { ISearchList, IUserFields } from 'model'
|
||||||
import { shared_consts } from '@/common/shared_vuejs'
|
import { shared_consts } from '@/common/shared_vuejs'
|
||||||
|
import { colmyUserPeople } from '@store/Modules/fieldsTable'
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'myuser',
|
name: 'myuser',
|
||||||
components: { CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime },
|
components: { CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CGridTableRec, CMyUser},
|
||||||
props: {},
|
props: {},
|
||||||
setup() {
|
setup() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -28,21 +29,25 @@ export default defineComponent({
|
|||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const username = ref('')
|
const username = ref('')
|
||||||
const filter = ref(costanti.FRIENDS)
|
const filter = ref(costanti.FIND_PEOPLE)
|
||||||
const listFriends = ref([])
|
const listFriends = ref(<IUserFields[]>[])
|
||||||
const listTrusted = ref([])
|
const listTrusted = ref(<IUserFields[]>[])
|
||||||
|
|
||||||
const filtroutente = ref(<any[]>[])
|
const filtroutente = ref(<any[]>[])
|
||||||
|
|
||||||
|
const arrfilterand: any = ref([])
|
||||||
|
const filtercustom: any = ref([])
|
||||||
|
const searchList = ref(<ISearchList[]>[])
|
||||||
|
|
||||||
const listfriendsfiltered = computed(() => {
|
const listfriendsfiltered = computed(() => {
|
||||||
let arr: any[] = []
|
let arr: any[] = []
|
||||||
if (filter.value === costanti.FRIENDS) {
|
if (filter.value === costanti.FRIENDS) {
|
||||||
arr = listFriends.value
|
arr = listFriends.value
|
||||||
}else if (filter.value === costanti.ASK_TRUST) {
|
} else if (filter.value === 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 (filter.value === costanti.TRUSTED) {
|
} else if (filter.value === costanti.TRUSTED) {
|
||||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador)
|
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador)
|
||||||
}else if (filter.value === costanti.REEJECTED) {
|
} else if (filter.value === costanti.REEJECTED) {
|
||||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === false)
|
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,51 +89,142 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mounted() {
|
|
||||||
username.value = userStore.my.username
|
|
||||||
loadFriends()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getImgUser(profile: IUserFields) {
|
|
||||||
return userStore.getImgByProfile(profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
function setRequestTrust(usernameDest: string, value: any) {
|
function setRequestTrust(usernameDest: string, value: any) {
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.SETTRUST, value).then((res) => {
|
let msg = ''
|
||||||
if (res) {
|
if (value) {
|
||||||
const myuser: IUserFields|undefined = listTrusted.value.find((rec: IUserFields) => rec.username === usernameDest )
|
msg = t('db.domanda_trusted', { username: usernameDest })
|
||||||
if (myuser) {
|
} else {
|
||||||
listFriends.value.push(myuser)
|
msg = t('db.domanda_rejectedtrust', { username: usernameDest })
|
||||||
listTrusted.value = listTrusted.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
}
|
||||||
}
|
|
||||||
tools.showPositiveNotif($q, t('db.trusted'))
|
|
||||||
|
|
||||||
} else {
|
$q.dialog({
|
||||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
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 Trusted
|
||||||
|
listFriends.value.push(myuser)
|
||||||
|
} else {
|
||||||
|
// REMOVE to Trusted and to Friends
|
||||||
|
listFriends.value = listFriends.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tools.showPositiveNotif($q, t('db.trusted'))
|
||||||
|
|
||||||
|
} 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)
|
||||||
|
listFriends.value = [...listFriends.value, res]
|
||||||
|
tools.showPositiveNotif($q, t('db.addedfriend'))
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFromMyFriends(usernameDest: string) {
|
function removeFromMyFriends(usernameDest: string) {
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
$q.dialog({
|
||||||
if (res) {
|
message: t('db.domanda_removefriend', { username: usernameDest }),
|
||||||
listFriends.value = listFriends.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
ok: { label: t('dialog.yes'), push: true },
|
||||||
tools.showPositiveNotif($q, t('db.removedfriend'))
|
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) {
|
||||||
|
listFriends.value = listFriends.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||||
|
tools.showPositiveNotif($q, t('db.removedfriend'))
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function blockUser(usernameDest: string) {
|
function blockUser(usernameDest: string) {
|
||||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, null).then((res) => {
|
$q.dialog({
|
||||||
if (res) {
|
message: t('db.domanda_blockuser', { username: usernameDest }),
|
||||||
listFriends.value = listFriends.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
ok: { label: t('dialog.yes'), push: true },
|
||||||
tools.showPositiveNotif($q, t('db.blockedfriend'))
|
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) {
|
||||||
|
listFriends.value = listFriends.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||||
|
tools.showPositiveNotif($q, t('db.blockedfriend'))
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function naviga(path: string) {
|
function setCmd(cmd: number, usernameDest: string, value: any = '') {
|
||||||
$router.push(path)
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function mounted() {
|
||||||
|
username.value = userStore.my.username
|
||||||
|
loadFriends()
|
||||||
|
|
||||||
|
searchList.value = []
|
||||||
|
filtercustom.value = []
|
||||||
|
arrfilterand.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
function extraparams() {
|
||||||
|
let lk_tab = 'users'
|
||||||
|
let lk_LF = 'userId'
|
||||||
|
let lk_FF = '_id'
|
||||||
|
let lk_as = 'user'
|
||||||
|
let af_objId_tab = 'myId'
|
||||||
|
|
||||||
|
return {
|
||||||
|
lookup1: {
|
||||||
|
lk_tab,
|
||||||
|
lk_LF,
|
||||||
|
lk_FF,
|
||||||
|
lk_as,
|
||||||
|
af_objId_tab,
|
||||||
|
lk_proj: {
|
||||||
|
username: 1,
|
||||||
|
name: 1,
|
||||||
|
'profile.img': 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
@@ -137,7 +233,7 @@ export default defineComponent({
|
|||||||
listfriends: listFriends,
|
listfriends: listFriends,
|
||||||
tools,
|
tools,
|
||||||
costanti,
|
costanti,
|
||||||
getImgUser,
|
shared_consts,
|
||||||
filtroutente,
|
filtroutente,
|
||||||
filter,
|
filter,
|
||||||
listfriendsfiltered,
|
listfriendsfiltered,
|
||||||
@@ -145,10 +241,12 @@ export default defineComponent({
|
|||||||
numAskTrust,
|
numAskTrust,
|
||||||
numTrusted,
|
numTrusted,
|
||||||
numRejected,
|
numRejected,
|
||||||
setRequestTrust,
|
arrfilterand,
|
||||||
removeFromMyFriends,
|
filtercustom,
|
||||||
blockUser,
|
searchList,
|
||||||
naviga,
|
colmyUserPeople,
|
||||||
|
extraparams,
|
||||||
|
setCmd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
color="white"
|
color="white"
|
||||||
text-color="primary"
|
text-color="primary"
|
||||||
:options="[
|
:options="[
|
||||||
|
{label: $t('mypages.find_people'), value: costanti.FIND_PEOPLE},
|
||||||
{label: $t('mypages.friends') + ' (' + numFriends + ')', value: costanti.FRIENDS},
|
{label: $t('mypages.friends') + ' (' + numFriends + ')', value: costanti.FRIENDS},
|
||||||
{label: $t('mypages.request_trust') + ' (' + numAskTrust + ')', value: costanti.ASK_TRUST},
|
{label: $t('mypages.request_trust') + ' (' + numAskTrust + ')', value: costanti.ASK_TRUST},
|
||||||
{label: $t('mypages.trusted') + ' (' + numTrusted + ')', value: costanti.TRUSTED},
|
{label: $t('mypages.trusted') + ' (' + numTrusted + ')', value: costanti.TRUSTED},
|
||||||
@@ -20,75 +21,42 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-list>
|
<div v-if="filter === costanti.FIND_PEOPLE">
|
||||||
<q-item v-for="(contact, index) in listfriendsfiltered" :key="index" class="q-my-sm" clickable>
|
<CGridTableRec
|
||||||
<q-item-section avatar @click="naviga(`/my/` + contact.username)">
|
prop_mytable="users"
|
||||||
<q-avatar size="60px">
|
prop_mytitle=""
|
||||||
<q-img :src="getImgUser(contact)" :alt="contact.username" img-class="imgprofile" height="60px" />
|
:prop_mycolumns="colmyUserPeople"
|
||||||
</q-avatar>
|
prop_colkey="_id"
|
||||||
</q-item-section>
|
col_title="username"
|
||||||
|
:vertical="true"
|
||||||
|
nodataLabel=" "
|
||||||
|
:prop_search="true"
|
||||||
|
hint="Username da trovare"
|
||||||
|
:finder="true"
|
||||||
|
:finder_noNull="true"
|
||||||
|
:options="shared_consts.OPTIONS_SEARCH_ONLY_FULL_WORDS"
|
||||||
|
:butt_modif_new="false"
|
||||||
|
noresultLabel="Username non trovato"
|
||||||
|
:arrfilters="arrfilterand"
|
||||||
|
:filtercustom="filtercustom"
|
||||||
|
:prop_searchList="searchList"
|
||||||
|
:showType="costanti.SHOW_USERINFO"
|
||||||
|
keyMain=""
|
||||||
|
:extraparams="extraparams()">
|
||||||
|
|
||||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
</CGridTableRec>
|
||||||
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
|
</div>
|
||||||
</q-item-label>
|
<div v-else>
|
||||||
<q-item-label caption lines="1">{{ contact.email }}</q-item-label>
|
<q-list>
|
||||||
</q-item-section>
|
<span v-for="(contact, index) in listfriendsfiltered" :key="index" class="q-my-sm" clickable>
|
||||||
|
<CMyUser
|
||||||
|
:mycontact="contact"
|
||||||
<q-item-section side v-if="filter === costanti.FRIENDS">
|
@setCmd="setCmd"
|
||||||
<q-item-label>
|
:visu="filter">
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
</CMyUser>
|
||||||
<q-menu>
|
</span>
|
||||||
<q-list style="min-width: 150px">
|
</q-list>
|
||||||
<q-item clickable icon="fas fa-user-minus" v-close-popup @click="removeFromMyFriends(contact.username)">
|
</div>
|
||||||
<q-item-section>{{$t('friends.remove_from_myfriends')}}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
<q-list style="min-width: 150px">
|
|
||||||
<q-item clickable icon="fas fa-ban" v-close-popup @click="blockUser(contact.username)">
|
|
||||||
<q-item-section>{{$t('friends.block_user')}}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section side v-if="filter === costanti.ASK_TRUST">
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn color="positive" :label="$t('friends.accept')" @click="setRequestTrust(contact.username, true)"/>
|
|
||||||
</q-item-label>
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn color="negative" :label="$t('friends.reject')" @click="setRequestTrust(contact.username, false)"/>
|
|
||||||
</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section side v-if="filter === costanti.TRUSTED">
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
|
||||||
<q-menu>
|
|
||||||
<q-list style="min-width: 200px">
|
|
||||||
<q-item clickable v-close-popup @click="removeFromMyFriends(contact.username)">
|
|
||||||
<q-item-section>{{$t('friends.reject')}}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section side v-if="filter === costanti.REEJECTED">
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
|
||||||
<q-menu>
|
|
||||||
<q-list style="min-width: 200px">
|
|
||||||
<q-item clickable icon="fas fa-user-minus" v-close-popup @click="setRequestTrust(contact.username, false)">
|
|
||||||
<q-item-section>{{$t('friends.accept')}}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user