Lista Amici
Richieste di Fiducia Accettati Rifiutati
This commit is contained in:
@@ -24,6 +24,7 @@ const msg_website_it = {
|
||||
home: 'Home',
|
||||
profile: 'Profilo',
|
||||
profile2: 'ProfiloU',
|
||||
profile3: 'Profilo3',
|
||||
test: 'Test',
|
||||
projects: 'Progetti',
|
||||
report: 'Report Ore',
|
||||
|
||||
@@ -379,10 +379,10 @@ const baseroutes: IListRoutes[] = [
|
||||
{
|
||||
active: true,
|
||||
order: 120,
|
||||
path: '/profile',
|
||||
path: '/myprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile',
|
||||
component: () => import('@/views/user/editprofile/editprofile.vue'),
|
||||
component: () => import('@/views/user/myprofile/myprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
|
||||
5
docs/bozza.txt
Normal file
5
docs/bozza.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
ellipsis-h
|
||||
caret-square-down
|
||||
caret-down
|
||||
|
||||
user-minus
|
||||
@@ -41,6 +41,13 @@ export const shared_consts = {
|
||||
|
||||
FILTER_MYSKILL_SKILL: 1,
|
||||
|
||||
FRIENDSCMD: {
|
||||
SETTRUST: 121,
|
||||
SETFRIEND: 132,
|
||||
REMOVE_FROM_MYFRIENDS: 144,
|
||||
BLOCK_USER: 155,
|
||||
},
|
||||
|
||||
REPORT_FILT_RESP: 1,
|
||||
REPORT_FILT_ATTIVITA: 2,
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
</div>
|
||||
|
||||
<div v-if="isLogged()" id="user-actions" class="column justify-center q-gutter-sm q-ma-sm center-150">
|
||||
<q-btn rounded color="primary" icon="person" to="/profile">{{ t('pages.profile') }}</q-btn>
|
||||
<q-btn rounded color="primary" icon="person" :to="`/my/`+getMyUsername()">{{ t('pages.profile') }}</q-btn>
|
||||
<!--<q-btn round color="warning" icon="lock"></q-btn>-->
|
||||
<q-btn rounded color="negative" icon="exit_to_app" @click='logoutHandler'>{{ t('login.esci') }}</q-btn>
|
||||
</div>
|
||||
|
||||
@@ -895,3 +895,10 @@ $heightBtn: 100%;
|
||||
.wrap_anywhere {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.imgprofile{
|
||||
border: 0px solid rgb(29, 118, 13);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 0 45px rgba(246, 246, 246, 0.2);
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
@@ -379,14 +379,25 @@ const baseroutes: IListRoutes[] = [
|
||||
{
|
||||
active: true,
|
||||
order: 120,
|
||||
path: '/profile',
|
||||
path: '/myprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile',
|
||||
component: () => import('@/views/user/editprofile/editprofile.vue'),
|
||||
component: () => import('@/views/user/myprofile/myprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: true,
|
||||
infooter: true,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 120,
|
||||
path: '/editprofile',
|
||||
materialIcon: 'fas fa-user',
|
||||
name: 'pages.profile3',
|
||||
component: () => import('@/views/user/editprofile/editprofile.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 130,
|
||||
|
||||
@@ -177,6 +177,11 @@ const msg_it = {
|
||||
recdelfailed: 'Errore durante la cancellazione del Record',
|
||||
duplicatedrecord: 'Vuoi Duplicare il record',
|
||||
recdupfailed: 'Errore durante la duplicazione del Record',
|
||||
friendsadded: 'Aggiunto alla lista di Amici',
|
||||
blockedfriend: 'Utente Bloccato',
|
||||
removedfriend: 'Rimosso dalla lista di Amici',
|
||||
trusted: 'Accettato la Fiducia',
|
||||
rejected: 'Rifiutato la Fiducia',
|
||||
},
|
||||
components: {
|
||||
authentication: {
|
||||
@@ -360,6 +365,8 @@ const msg_it = {
|
||||
legenda: 'Legenda',
|
||||
aportador_solidario: 'Chi ti ha Invitato',
|
||||
verified_by_aportador: 'Verificato dall\'Invitante',
|
||||
blocked: 'Bloccato',
|
||||
username_who_block: 'Bloccato da',
|
||||
username_regala_invitato: 'Username del Destinatario del regalo',
|
||||
aportador_solidario_nome_completo: 'Nominativo Invitante',
|
||||
aportador_solidario_nome_completo_orig: 'Invitante Originario',
|
||||
@@ -815,6 +822,13 @@ const msg_it = {
|
||||
friends: 'Amici',
|
||||
request_trust: 'Richieste di Fiducia',
|
||||
trusted: 'Accettati',
|
||||
rejected: 'Rifiutati',
|
||||
},
|
||||
friends: {
|
||||
accept: 'Accetta',
|
||||
reject: 'Rifiuta',
|
||||
remove_from_myfriends: 'Rimuovi dagli Amici',
|
||||
block_user: 'Blocca Utente',
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ export const costanti = {
|
||||
FRIENDS: 1,
|
||||
ASK_TRUST: 2,
|
||||
TRUSTED: 3,
|
||||
REEJECTED: 4,
|
||||
|
||||
FILTER_TUTTI: -100,
|
||||
|
||||
|
||||
@@ -1288,6 +1288,8 @@ export const fieldsTable = {
|
||||
AddCol({ name: 'note', label_trans: 'reg.note' }),
|
||||
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: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
|
||||
AddCol({
|
||||
name: 'profile.resplist',
|
||||
field: 'profile',
|
||||
|
||||
@@ -838,6 +838,17 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
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})
|
||||
.then((res) => {
|
||||
return !!res
|
||||
}).catch((error) => {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
return {}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -13,6 +13,7 @@ import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { IUserFields, IUserProfile } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -21,7 +22,9 @@ export default defineComponent({
|
||||
props: {},
|
||||
setup() {
|
||||
const userStore = useUserStore()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const username = ref('')
|
||||
@@ -36,9 +39,11 @@ export default defineComponent({
|
||||
if (filter.value === costanti.FRIENDS) {
|
||||
arr = listFriends.value
|
||||
}else if (filter.value === costanti.ASK_TRUST) {
|
||||
arr = listTrusted.value.filter((user: IUserFields) => !user.verified_by_aportador)
|
||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
|
||||
}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) {
|
||||
arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === false)
|
||||
}
|
||||
|
||||
return arr
|
||||
@@ -50,15 +55,20 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const numAskTrust = computed(() => {
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => !user.verified_by_aportador)
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador === undefined)
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numAskTrusted = computed(() => {
|
||||
const numTrusted = computed(() => {
|
||||
const arr = listTrusted.value.filter((user: IUserFields) => user.verified_by_aportador)
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
const numRejected = computed(() => {
|
||||
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) {
|
||||
@@ -83,6 +93,44 @@ export default defineComponent({
|
||||
return userStore.getImgByProfile(profile)
|
||||
}
|
||||
|
||||
function setRequestTrust(usernameDest: string, value: any) {
|
||||
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.SETTRUST, value).then((res) => {
|
||||
if (res) {
|
||||
const myuser: IUserFields|undefined = listTrusted.value.find((rec: IUserFields) => rec.username === usernameDest )
|
||||
if (myuser) {
|
||||
listFriends.value.push(myuser)
|
||||
listTrusted.value = listTrusted.value.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.trusted'))
|
||||
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function removeFromMyFriends(usernameDest: string) {
|
||||
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) {
|
||||
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.blockedfriend'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -95,7 +143,12 @@ export default defineComponent({
|
||||
listfriendsfiltered,
|
||||
numFriends,
|
||||
numAskTrust,
|
||||
numAskTrusted,
|
||||
numTrusted,
|
||||
numRejected,
|
||||
setRequestTrust,
|
||||
removeFromMyFriends,
|
||||
blockUser,
|
||||
naviga,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,32 +7,85 @@
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
push
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="[
|
||||
{label: $t('mypages.friends') + ' (' + numFriends + ')', value: costanti.FRIENDS},
|
||||
{label: $t('mypages.request_trust') + ' (' + numAskTrust + ')', value: costanti.ASK_TRUST},
|
||||
{label: $t('mypages.trusted') + ' (' + numAskTrusted + ')', value: costanti.TRUSTED}
|
||||
{label: $t('mypages.trusted') + ' (' + numTrusted + ')', value: costanti.TRUSTED},
|
||||
{label: $t('mypages.rejected') + ' (' + numRejected + ')', value: costanti.REEJECTED}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-list bordered>
|
||||
<q-item v-for="(contact, index) in listfriendsfiltered" :key="index" class="q-my-sm" clickable v-ripple>
|
||||
<q-item-section avatar>
|
||||
<q-avatar>
|
||||
<img :src="getImgUser(contact)" :alt="contact.username">
|
||||
<q-list>
|
||||
<q-item v-for="(contact, index) in listfriendsfiltered" :key="index" 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>
|
||||
<q-item-label>{{ contact.name }} {{ contact.surname }}</q-item-label>
|
||||
<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>
|
||||
<q-icon name="chat_bubble" color="green" />
|
||||
|
||||
<q-item-section side v-if="filter === 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="removeFromMyFriends(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="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>
|
||||
|
||||
@@ -11,8 +11,3 @@
|
||||
}
|
||||
}
|
||||
|
||||
.imgprofile{
|
||||
border: 4px solid rgb(29, 118, 13);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 0 45px rgba(246, 246, 246, 0.2);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export default defineComponent({
|
||||
const $route = useRoute()
|
||||
const { t } = useI18n()
|
||||
|
||||
const username = computed(() => $route.params.username.toString())
|
||||
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
|
||||
const filtroutente = ref(<any[]>[])
|
||||
const showPic = ref(false)
|
||||
@@ -35,6 +35,10 @@ export default defineComponent({
|
||||
return userStore.my.profile
|
||||
}
|
||||
|
||||
function myusername() {
|
||||
return userStore.my.username
|
||||
}
|
||||
|
||||
function loadProfile() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
@@ -46,7 +50,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => username, (to: any, from: any) => {
|
||||
watch(() => username.value, (to: any, from: any) => {
|
||||
loadProfile()
|
||||
})
|
||||
|
||||
@@ -83,6 +87,7 @@ export default defineComponent({
|
||||
getLinkUserTelegram,
|
||||
filtroutente,
|
||||
showPic,
|
||||
myusername,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<div class="">
|
||||
<q-avatar size="140px">
|
||||
<img :src="getImgUser()" :alt="username" class="imgprofile" @click="showPic = true">
|
||||
<q-img :src="getImgUser()" :alt="username" img-class="imgprofile" height="140px" @click="showPic = true" />
|
||||
</q-avatar>
|
||||
</div>
|
||||
|
||||
@@ -18,13 +18,21 @@
|
||||
{{ myuser.username }}
|
||||
</div>
|
||||
<div class="col-12 text-h7">
|
||||
{{ myuser.profile.born_city }} ({{ myuser.profile.nationality }})
|
||||
<span v-if="myuser.profile.born_city">{{ myuser.profile.born_city }}</span> <span v-if="myuser.profile.nationality">({{ myuser.profile.nationality }})</span>
|
||||
</div>
|
||||
|
||||
<div class="col-12 text-h8 q-mt-sm">
|
||||
{{ myuser.profile.biografia }}
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
v-if="myuser.username === myusername()" icon="fas fa-pencil-alt"
|
||||
color="blue"
|
||||
size="md"
|
||||
:label="$t('otherpages.modifprof')"
|
||||
to="/editprofile">
|
||||
</q-btn>
|
||||
|
||||
<div class="col-12 row justify-evenly q-mt-md">
|
||||
<q-btn
|
||||
v-if="getLinkUserTelegram()" icon="fab fa-telegram"
|
||||
@@ -34,14 +42,6 @@
|
||||
:label="$t('msgs.message')"
|
||||
:href="getLinkUserTelegram()" target="__blank">
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="false"
|
||||
icon="fab fa-telegram"
|
||||
color="white"
|
||||
text-color="black"
|
||||
size="md"
|
||||
rounded>
|
||||
</q-btn>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,16 +54,12 @@
|
||||
|
||||
<div class="col-6 text-h6">
|
||||
<CDateTime
|
||||
v-if="checkifShow('profile.dateofbirth')"
|
||||
v-if="checkifShow('profile.dateofbirth') && !!myuser.profile.dateofbirth"
|
||||
v-model:value="myuser.profile.dateofbirth"
|
||||
:label="$t('reg.dateofbirth')"
|
||||
:canEdit="false">
|
||||
</CDateTime>
|
||||
|
||||
<div v-if="myuser.profile.born_city"
|
||||
class="col-6 text-h7">
|
||||
{{ myuser.profile.born_city }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -71,7 +67,7 @@
|
||||
</CTitleBanner>
|
||||
|
||||
<CTitleBanner
|
||||
class="" title="Competenze e Talenti" bgcolor="bg-primary" clcolor="text-white"
|
||||
class="" title="Competenze e Talenti" bgcolor="bg-positive" clcolor="text-white"
|
||||
myclass="myshad" :canopen="true">
|
||||
|
||||
<CSkill
|
||||
|
||||
Reference in New Issue
Block a user