- Aggiornato grafica Pagina Gruppi

- Lista Utenti appartenenti al gruppo
- Lista richieste gruppo
- Nome e Cognome tolti
This commit is contained in:
paoloar77
2022-02-08 23:06:22 +01:00
parent 980ff4b48e
commit a2f7f7a8d2
97 changed files with 1141 additions and 441 deletions

View File

@@ -38,7 +38,7 @@ export default defineComponent({
myval = searchList.value.find((rec) => (rec.table === 'sectors'))
if (myval) {
const ris = myval.value || 0
// console.log('idSector=', ris)
console.log('idSector=', ris)
return ris
} else {
return 0

View File

@@ -208,6 +208,7 @@ export default defineComponent({
const newRecordBool = ref(false)
const editRecordBool = ref(false)
const newRecord: any = ref({})
const recSaved: any = ref({})
const recModif: any = ref({})
const mytable = ref('')
@@ -945,6 +946,7 @@ export default defineComponent({
console.log('Edit', item)
selItem(item, col)
recModif.value = item
recSaved.value = {...item}
editRecordBool.value = true
} else {
@@ -1243,6 +1245,16 @@ export default defineComponent({
})
}
function cancelrecModif() {
recModif.value = {...recSaved.value}
if (recModif.value._id) {
const indrec = serverData.value.findIndex((rec: any) => rec._id === recModif.value._id)
if (indrec >= 0)
serverData.value[indrec] = recModif.value
editRecordBool.value = false
}
}
async function saverecModif() {
console.log('saverecModif')
const mydata = {
@@ -1259,7 +1271,7 @@ export default defineComponent({
// console.log('ris', ris)
if (ris) {
editRecordBool.value = false
const indrec = serverData.value.findIndex((rec: IMySkill) => rec._id === ris._id)
const indrec = serverData.value.findIndex((rec: any) => rec._id === ris._id)
console.log('indrec', indrec, serverData.value[indrec])
mycolumns.value.forEach((col: IColGridTable) => {
if (!col.foredit) {
@@ -1347,6 +1359,7 @@ export default defineComponent({
getusernamesel,
saveNewRecord,
saverecModif,
cancelrecModif,
hidewindow,
isfinishLoading,
getlabelAddRow,
@@ -1372,6 +1385,7 @@ export default defineComponent({
editRecordBool,
newRecord,
recModif,
recSaved,
lists,
refresh,
spinner_visible,

View File

@@ -120,6 +120,7 @@
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server">
</CMySelect>
@@ -144,6 +145,7 @@
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:filter="item.filter"
:options="valoriopt(item, false)"
:useinput="true">
</CMySelect>
@@ -164,6 +166,7 @@
stack-label
:useinput="item.useinput"
:options="valoriopt(item, item.addall)"
:filter="item.filter"
class="combowidth"
:option-value="fieldsTable.getKeyByTable(item.table)"
>
@@ -513,7 +516,7 @@
</q-card-section>
<q-card-actions align="center">
<q-btn flat :label="$t('dialog.ok')" color="primary" @click="saverecModif"></q-btn>
<q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup></q-btn>
<q-btn flat :label="$t('dialog.cancel')" color="primary" @click="cancelrecModif"></q-btn>
</q-card-actions>
</q-card>
</q-dialog>

View File

@@ -21,7 +21,7 @@ export default defineComponent({
required: false,
},
optlab: {
type: String,
type: [String, Function],
required: true,
},
optval: {
@@ -111,7 +111,7 @@ export default defineComponent({
if (mydata.label)
mydata.label = mydata.label[0]
} else {
mydata.label = rec[props.optlab]
mydata.label = tools.getValueByFunzOrVal(rec, props.optlab)
}
// console.log('mydata.label', mydata.label)
@@ -141,7 +141,7 @@ export default defineComponent({
if (mydata.label)
mydata.label = mydata.label[0]
} else {
mydata.label = rec[props.optlab]
mydata.label = tools.getValueByFunzOrVal(rec, props.optlab)
}
if (props.opticon)
@@ -155,7 +155,7 @@ export default defineComponent({
} else {
if (tools.isBitActive(myval.value, rec[props.optval])) {
const mydata = {
label: t(rec[props.optlab]),
label: t(tools.getValueByFunzOrVal(rec, props.optlab)),
value: rec[props.optval],
valbool: tools.isBitActive(myval.value, rec[props.optval]),
icon: '',

View File

@@ -37,7 +37,9 @@ export default defineComponent({
setup(props, { emit }) {
const $q = useQuasar()
const editor = ref(null)
const editorRef = ref(<any>null)
const editor = ref('')
//const myvalue = toRef(props, 'value')
const myvalue = ref('')
const mycolor = ref('')
@@ -58,7 +60,8 @@ export default defineComponent({
const toolbarcomp = ref([
['left', 'center', 'right', 'justify'],
['bold', 'italic', 'underline', 'strike'],
[
['token', 'hr', 'link', 'custom_btn'],
['print', 'fullscreen'], [
{
label: $q.lang.editor.formatting,
icon: $q.iconSet.editor.formatting,
@@ -112,7 +115,7 @@ export default defineComponent({
])
function changeval(newval: any) {
console.log('myEditor: changeval', newval)
// console.log('myEditor: changeval', newval)
emit('update:value', newval)
}
@@ -171,6 +174,29 @@ export default defineComponent({
myvalue.value = props.value
}
function onPaste (evt: any) {
// Let inputs do their thing, so we don't break pasting of links.
if (evt.target.nodeName === 'INPUT') return
let text, onPasteStripFormattingIEPaste
evt.preventDefault()
evt.stopPropagation()
if (evt.originalEvent && evt.originalEvent.clipboardData.getData) {
text = evt.originalEvent.clipboardData.getData('text/plain')
editorRef.value.runCmd('insertText', text)
}
else if (evt.clipboardData && evt.clipboardData.getData) {
text = evt.clipboardData.getData('text/plain')
editorRef.value.runCmd('insertText', text)
}
/*else if (ClipboardEvent.clipboardData && ClipboardEvent.clipboardData.getData) {
if (!onPasteStripFormattingIEPaste) {
onPasteStripFormattingIEPaste = true
editorRef.value.runCmd('ms-pasteTextOnly', text)
}
onPasteStripFormattingIEPaste = false
}*/
}
onMounted(mounted)
return {
@@ -185,6 +211,8 @@ export default defineComponent({
setcolor,
pasteCapture,
tools,
onPaste,
editorRef,
}
}
})

View File

@@ -25,7 +25,7 @@
</q-btn>
<q-editor
ref="editor"
ref="editorRef"
content-class="wrap_anywhere"
toolbar-text-color="white"
toolbar-toggle-color="yellow-8"
@@ -33,7 +33,7 @@
:toolbar="toolbarcomp"
:fonts="myfonts"
@update:model-value="changeval"
@paste="evt => pasteCapture(evt)"
@paste="onPaste"
@keyup.enter.stop
v-model="myvalue">
</q-editor>

View File

@@ -1,6 +1,6 @@
<template>
<div class="text-center">
<div v-if="visuElem()" class="row items-center justify-center q-gutter-md q-ma-xs">
<div v-if="visuElem()" class="row items-center justify-center q-ma-xs">
<div class="q-ma-xs">
<q-field rounded outlined bg-color="blue-1" dense style="min-width:110px;">
@@ -36,6 +36,8 @@
:myimg="myimg"
:canModify="canModify"
:canEdit="canEdit"
:id="id"
:idmain="idmain"
:visulabel="true"
:mycol="col"
:tablesel="tablesel"
@@ -47,6 +49,7 @@
</CMyPopupEdit>
</div>
<slot></slot>
</div>
</div>
</template>

View File

@@ -204,72 +204,12 @@ export default defineComponent({
})
}
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: IFriends) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.removedfriend'))
}
})
})
}
function setCmd($q: any, cmd: number, usernameDest: string, value: any, groupname: string) {
tools.setCmd($q, cmd, usernameDest, value, username.value)
function refuseReqFriends(usernameDest: string) {
$q.dialog({
message: t('db.domanda_revoke_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.REMOVE_FROM_MYFRIENDS, null).then((res) => {
if (res) {
userStore.my.profile.req_friends = userStore.my.profile.req_friends.filter((user: IFriends) => user.username !== usernameDest)
tools.showPositiveNotif($q, t('db.removedfriend'))
}
})
})
}
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: IFriends) => 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) {
tools.addToMyFriends($q, username.value, usernameDest)
} else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) {
tools.setRequestFriendship($q, username.value, usernameDest, value)
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
refuseReqFriends(usernameDest)
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
tools.cancelReqFriends($q, username.value, usernameDest)
}
}

View File

@@ -81,6 +81,7 @@ export default defineComponent({
setCmd,
shared_consts,
userStore,
$q,
}
},
})

View File

@@ -19,12 +19,12 @@
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="setCmd(shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, grp.groupname)">
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</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.GROUPSCMD.BLOCK_GROUP, grp.groupname)">
<q-item clickable icon="fas fa-ban" v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.BLOCK_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.block_group') }}</q-item-section>
</q-item>
</q-list>
@@ -38,7 +38,7 @@
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('groups.reject_ask_group') }}</q-item-section>
</q-item>
</q-list>
@@ -52,7 +52,7 @@
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="setCmd(shared_consts.GROUPSCMD.CANCEL_REQ_GROUP, grp.groupname)">
@click="tools.setCmd($q, shared_consts.GROUPSCMD.CANCEL_REQ_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.cancel_ask_group') }}</q-item-section>
</q-item>
</q-list>
@@ -65,17 +65,17 @@
<q-btn rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
<q-menu>
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, true)">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), true, grp.groupname)">
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('groups.cancel_ask_group') }}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUPS, grp.groupname)">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUPS, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</q-item-section>
</q-item>
</q-list>

View File

@@ -103,7 +103,8 @@ export default defineComponent({
userStore.loadGroups(username.value).then((ris) => {
// console.log('ris', ris)
if (ris) {
userStore.my.profile.mygroups = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.my.profile.mygroups = ris.mygroups ? ris.mygroups : []
userStore.my.profile.list_usersgroup = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.groups = ris.listgroups ? ris.listgroups : []
userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : []
filtroutente.value = [{ userId: userStore.my._id }]
@@ -113,36 +114,6 @@ export default defineComponent({
}
}
function blockGroup(usernameDest: string) {
$q.dialog({
message: t('db.domanda_blockgroup', { groupname: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setGroupsCmd($q, t, username.value, usernameDest, shared_consts.GROUPSCMD.BLOCK_GROUP, null).then((res) => {
if (res) {
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== usernameDest)
tools.showPositiveNotif($q, t('db.blockedgroup'))
}
})
})
}
function setCmd(cmd: number, groupnameDest: string, value: any = '') {
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
tools.removeFromMyGroups($q, username.value, groupnameDest)
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_GROUP) {
blockGroup(groupnameDest)
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
tools.addToMyGroups($q, username.value, groupnameDest)
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
tools.setRequestGroup($q, username.value, groupnameDest, value)
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
tools.cancelReqGroups($q, username.value, groupnameDest)
}
}
function mounted() {
username.value = userStore.my.username
loadGroups()
@@ -161,7 +132,6 @@ export default defineComponent({
shared_consts,
filtroutente,
listgroupsfiltered,
setCmd,
updateValue,
myoptions,
}

View File

@@ -23,7 +23,6 @@
<span v-for="(grp, index) in listgroupsfiltered" :key="index" class="q-my-sm" clickable>
<CMyGroup
:mygrp="grp"
@setCmd="setCmd"
:visu="modelValue">
</CMyGroup>
</span>
@@ -35,7 +34,6 @@
<span class="q-my-sm" clickable>
<CMyGroup
:mygrp="mygrp"
@setCmd="setCmd"
:visu="visu">
</CMyGroup>
</span>

View File

@@ -231,8 +231,6 @@ export default defineComponent({
}
}
console.log('col.value', col.value)
// console.log('CMyFieldDb crea', myvalue)
}
@@ -251,10 +249,13 @@ export default defineComponent({
function changeval(newval: any) {
console.log('changeval update:row', newval)
emit('update:row', props.row)
if (!props.isrec) {
emit('update:row', props.row)
}
if (props.isInModif)
OpenEdit()
}
function getrealval(newval: any) {

View File

@@ -126,6 +126,10 @@ export default defineComponent({
type: String,
required: false,
default: '',
},
filter: {
type: Function,
required: false,
}
},
components: {},
@@ -194,7 +198,7 @@ export default defineComponent({
// console.log('----------- arrtempOpt.value', arrtempOpt.value)
localStorage.setItem(props.tablesel + num + props.optval, id)
localStorage.setItem(props.tablesel + num + props.optlab, rec[`${props.optlab}`])
localStorage.setItem(props.tablesel + num + props.optlab, tools.getValueByFunzOrVal(rec, props.optlab))
num += 1
localStorage.setItem(props.tablesel + 'NUM', num.toString())
@@ -320,7 +324,7 @@ export default defineComponent({
}
if (props.tablesel === 'friendsandme') {
debugger;
// debugger;
}
if (props.multiple) {
@@ -349,7 +353,7 @@ export default defineComponent({
if (props.funcgetvaluebyid)
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
else
myvalue.value = rec[`${props.optlab}`]
myvalue.value = tools.getValueByFunzOrVal(rec, props.optlab)
} else {
// if (!props.useinput) {
if (props.value) {
@@ -372,13 +376,16 @@ export default defineComponent({
function updateArrOptions() {
let myarr: any = []
// console.log(props.col.jointable, props.filter)
if (props.col.jointable) {
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.col.filter)
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.filter)
// console.log('optionsreal.value', optionsreal.value)
} else {
optionsreal.value = props.options
}
// console.log('optionsreal.value', optionsreal.value)
myarr = optionsreal.value
if (!fieldsTable.tableRemotePickup.includes(props.tablesel)) {
@@ -386,7 +393,7 @@ export default defineComponent({
// console.log('needle', needle, 'props.multiple', props.multiple)
if (props.filter_table) {
console.log(' FILTERTABLE', props.filter_field, myarr)
// console.log(' FILTERTABLE', props.filter_field, myarr)
if (props.multiple) {
myarr = myarr.filter((rec: any) => rec[props.filter_field] === needle)
} else {
@@ -578,6 +585,7 @@ export default defineComponent({
abortFilterFn,
newvaluefuncfirst,
getIcon,
tools,
}
}
})

View File

@@ -105,7 +105,7 @@
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label> {{ scope.opt[optlab] }}</q-item-label>
<q-item-label> {{ tools.getValueByFunzOrVal(scope.opt,optlab) }}</q-item-label>
</q-item-section>
</q-item>
</template>
@@ -139,7 +139,7 @@
</template>
<template
v-slot:selected-item="scope">
<div v-if="scope.opt[optlab]">
<div v-if="tools.getValueByFunzOrVal(scope.opt,optlab)">
<q-chip
removable
dense
@@ -149,7 +149,7 @@
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" :icon="scope.opt.icon ? scope.opt.icon : ''" size="12px"/>
{{ scope.opt[optlab] }}
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
</q-chip>
</div>
</template>
@@ -158,7 +158,7 @@
v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[optlab] }}</q-item-label>
<q-item-label>{{ tools.getValueByFunzOrVal(opt,optlab) }}</q-item-label>
<q-item-label v-if="'hint' in opt" class="hint">{{ opt['hint'] }}</q-item-label>
</q-item-section>
<q-item-section side>
@@ -200,7 +200,7 @@
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
</q-item-section>
<q-item-section>
<q-item-label>{{ scope.opt[optlab] }}</q-item-label>
<q-item-label>{{ tools.getValueByFunzOrVal(scope.opt,optlab) }}</q-item-label>
<q-item-label v-if="'hint' in scope.opt" class="hint">{{ scope.opt['hint'] }}</q-item-label>
</q-item-section>
</q-item>

View File

@@ -73,8 +73,8 @@ export default defineComponent({
$router.push(path)
}
function setCmd(cmd: number, myusername: string, value: any = '') {
emit('setCmd', cmd, myusername, value)
function setCmd($q: any, cmd: number, myusername: string, value: any, groupname: string) {
emit('setCmd', $q, cmd, myusername, value, groupname)
}
onMounted(mounted)

View File

@@ -8,7 +8,7 @@
</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><strong>{{ contact.username }}</strong> <span v-if="contact.name">({{ contact.name }} {{ contact.surname }})</span>
</q-item-label>
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
</q-item-section>
@@ -19,12 +19,12 @@
<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)">
@click="setCmd($q, 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 clickable icon="fas fa-ban" v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.BLOCK_USER, contact.username, '', '')">
<q-item-section>{{ $t('friends.block_user') }}</q-item-section>
</q-item>
</q-list>
@@ -32,18 +32,18 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.REQ_FRIENDS">
<q-item-section side v-else-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 clickable v-close-popup @click="setCmd($q, 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)">
@click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, contact.username, false, '')">
<q-item-section>{{ $t('friends.reject_ask_friend') }}</q-item-section>
</q-item>
</q-list>
@@ -51,7 +51,7 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.REQ_ADD_USER_TO_GROUP">
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_GROUP">
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
@@ -79,7 +79,7 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.REQ_REMOVE_USER_TO_GROUP">
<q-item-section side v-else-if="visu === costanti.REQ_REMOVE_USER_TO_GROUP">
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
@@ -95,13 +95,13 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.ASK_SENT_FRIENDS">
<q-item-section side v-else-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)">
@click="setCmd($q, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, contact.username, '', '')">
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
</q-item>
</q-list>
@@ -109,25 +109,25 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.ASK_TRUST">
<q-item-section side v-else-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-btn color="positive" :label="$t('friends.accept_trust')" @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, contact.username, true, '')"/>
</q-item-label>
<q-item-label>
<q-btn color="negative" :label="$t('friends.refuse_trust')" @click="setCmd(shared_consts.FRIENDSCMD.SETTRUST, contact.username, false)"/>
<q-btn color="negative" :label="$t('friends.refuse_trust')" @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, contact.username, false, '')"/>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.TRUSTED">
<q-item-section side v-else-if="visu === costanti.TRUSTED">
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<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 clickable v-close-popup @click="setCmd($q, 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 clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, contact.username, false, '')">
<q-item-section>{{ $t('friends.reject_trust') }}</q-item-section>
</q-item>
</q-list>
@@ -135,22 +135,22 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.FIND_PEOPLE">
<q-item-section side v-else-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 clickable v-close-popup @click="setCmd($q, 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 clickable v-close-popup @click="setCmd($q, 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 clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, contact.username, '', '')">
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
</q-item>
</q-list>
@@ -158,13 +158,13 @@
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.REJECTED">
<q-item-section side v-else-if="visu === costanti.REJECTED">
<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)">
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, contact.username, true, '')">
<q-item-section>{{ $t('friends.accept_trust') }}</q-item-section>
</q-item>
</q-list>

View File

@@ -22,6 +22,7 @@ import { complexity, registereduser, aportadorexist } from '../../validation'
// import 'vue3-tel-input/dist/vue3-tel-input.css'
import { useRoute, useRouter } from 'vue-router'
import { static_data } from '@/db/static_data'
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
@@ -49,6 +50,11 @@ export default defineComponent({
required: false,
default: false,
},
show_namesurname: {
type: Boolean,
required: false,
default: true,
},
},
setup(props, { emit }) {
const $q = useQuasar()
@@ -65,8 +71,8 @@ export default defineComponent({
const signup = reactive(<ISignupOptions>{
email: process.env.TEST_EMAIL || '',
username: process.env.TEST_USERNAME || '',
name: process.env.TEST_NAME || '',
surname: process.env.TEST_SURNAME || '',
name: static_data.functionality.SHOW_NAMESURNAME ? (process.env.TEST_NAME || '') : '',
surname: static_data.functionality.SHOW_NAMESURNAME ? (process.env.TEST_SURNAME || '') : '',
password: process.env.TEST_PASSWORD || '',
repeatPassword: process.env.TEST_PASSWORD || '',
terms: !process.env.PROD,
@@ -75,7 +81,7 @@ export default defineComponent({
})
const validations: any = computed(() => {
return {
let valid: any = {
repeatPassword: {
required,
repeatPassword: sameAs(signup.password),
@@ -90,12 +96,6 @@ export default defineComponent({
minLength: minLength(6),
registereduser,
},
name: {
required,
},
surname: {
required,
},
terms: {
required,
},
@@ -104,6 +104,17 @@ export default defineComponent({
required
}
}
if (props.show_namesurname) {
valid.name = {
required,
}
valid.surname = {
required,
}
}
return valid
})
// @ts-ignore
@@ -176,8 +187,10 @@ export default defineComponent({
return
} */
signup.name = tools.CapitalizeAllWords(signup.name)
signup.surname = tools.CapitalizeAllWords(signup.surname)
if (signup.name) {
signup.name = tools.CapitalizeAllWords(signup.name)
signup.surname = tools.CapitalizeAllWords(signup.surname)
}
$q.loading.show({ message: t('reg.incorso') })

View File

@@ -2,7 +2,8 @@
<div>
<div class="text-center">
<p>
<logo></logo><CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
<logo></logo>
<CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
</p>
</div>
@@ -53,7 +54,7 @@
debounce="3000"
:rules="[ myRuleEmail ]"
lazy-rules
:label="$t('reg.email')">
:label="$t('reg.email_reg')">
<template v-slot:prepend>
<q-icon name="email"/>
@@ -69,9 +70,10 @@
:error="v$.username.$error"
@keydown.space="(event) => event.preventDefault()"
maxlength="20"
:hint="$t('reg.username_hint')"
debounce="1000"
:error-message="tools.errorMsg( 'username', v$.username)"
:label="$t('reg.username')">
:label="$t('reg.username_reg')">
<template v-slot:prepend>
<q-icon name="person"/>
@@ -79,37 +81,40 @@
</q-input>
<q-input
v-model="signup.name"
rounded outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'name', v$.name)"
:label="$t('reg.name')">
<div v-if="show_namesurname">
<q-input
v-model="signup.name"
rounded outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'name', v$.name)"
:label="$t('reg.name')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
</q-input>
<q-input
v-model="signup.surname"
rounded outlined
:error="v$.surname.$error"
@blur="v$.surname.$touch"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'surname', v$.surname)"
:label="$t('reg.surname')">
<q-input
v-model="signup.surname"
rounded outlined
:error="v$.surname.$error"
@blur="v$.surname.$touch"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'surname', v$.surname)"
:label="$t('reg.surname')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
</q-input>
</div>
<q-input
v-model="signup.password"
@@ -120,7 +125,7 @@
:error-message="`${tools.errorMsg( 'password', v$.password)}`"
maxlength="30"
debounce="1000"
:label="$t('reg.password')">
:label="$t('reg.password_reg')">
<template v-slot:prepend>
<q-icon name="vpn_key"/>
@@ -203,10 +208,11 @@
</div>
<div class="wrapper">
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()' :label="$t('reg.submit')">
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()'
:label="$t('reg.submit')">
</q-btn>
</div>
<br /><br /><br />
<br/><br/><br/>
</div>
</div>
@@ -215,5 +221,5 @@
<script lang="ts" src="./CSignUp.ts">
</script>
<style lang="scss" scoped>
@import './CSignUp.scss';
@import './CSignUp.scss';
</style>

View File

@@ -13,7 +13,7 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ user.name }} {{ user.surname }} {{ getindorder(user) }}<br>
<q-item-label><span v-if="user.name">{{ user.name }} {{ user.surname }}</span> {{ getindorder(user) }}<br>
<span class="text-grey">({{ getusername(user) }}) <strong>{{ getquanti(user)}}</strong></span>
<br><!--<span v-if="isextralist(user)" class="notreg">{{ $t('dashboard.notreg') }}</span>-->
</q-item-label>

View File

@@ -98,7 +98,6 @@
</div>-->
<!-- BUTTON USER BAR -->
<q-btn
class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && !isLogged()" dense flat round
icon="menu"