- MyProfile

- Immagine profilo e small
This commit is contained in:
paoloar77
2022-01-03 21:53:41 +01:00
parent f31eb0ea99
commit 5375e9d728
37 changed files with 542 additions and 128 deletions

View File

@@ -49,6 +49,7 @@ export const costanti = {
hours: 8000,
crypted: 9000,
},
FieldTypeArr: [
{ label: 'Boolean', value: 1 },
{ label: 'Date', value: 2 },
@@ -59,5 +60,10 @@ export const costanti = {
{ label: 'Number', value: 64 },
],
TipoVisu: {
TESTO: 1,
LINK: 2,
BUTTON: 3,
},
}

View File

@@ -59,6 +59,8 @@ function AddCol(params: IColGridTable) {
action: (params.action === undefined) ? '' : params.action,
foredit: (params.foredit === undefined) ? true : params.foredit,
fieldtype: (params.fieldtype === undefined) ? costanti.FieldType.string : params.fieldtype,
tipovisu: (params.tipovisu === undefined) ? costanti.TipoVisu.TESTO : params.tipovisu,
link: (params.link === undefined) ? '' : params.link,
visuonlyEditVal: (params.visuonlyEditVal === undefined) ? false : params.visuonlyEditVal,
askaction: (params.askaction === undefined) ? '' : params.askaction,
jointable: (params.jointable === undefined) ? '' : params.jointable,
@@ -389,7 +391,7 @@ export const colmySkills = [
}), */
//AddCol({ name: 'name', label_trans: 'reg.name', fieldtype: costanti.FieldType.string }),
//AddCol({ name: 'surname', label_trans: 'reg.surname', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'username', label_trans: 'reg.username', foredit: false }),
AddCol({ name: 'username', label_trans: 'reg.username', foredit: false, tipovisu: costanti.TipoVisu.LINK, link: '/my/username' }),
AddCol({
name: 'idSkill',
label_trans: 'skill.name',
@@ -1309,6 +1311,10 @@ export const fieldsTable = {
AddCol({
name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality',
}),
AddCol({ name: 'profile.dateofbirth', label_trans: 'reg.dateofbirth', fieldtype: costanti.FieldType.onlydate }),
AddCol({ name: 'profile.born_city', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'profile.born_province', label_trans: 'reg.born_province', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'profile.born_country', label_trans: 'reg.born_country', fieldtype: costanti.FieldType.string }),
AddCol({
name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell',
}),
@@ -1457,6 +1463,7 @@ export const fieldsTable = {
tableRemotePickup: [
'countries',
'phones',
'cities',
],
tableWithUsername: [

View File

@@ -36,4 +36,24 @@ export const serv_constants = {
RIS_UNSUBSCRIBED_STR: 'unsubscribed',
RIS_UNSUBSCRIBED_NOT_EXIST: -5,
LIST_END: '10000000',
LIST_START: null,
PREFIX_IMG: 'm_',
PREFIX_IMG_SMALL: 'sm_',
Privacy: {
all: 'all',
friends: 'friends',
mygroup: 'mygroup',
onlyme: 'onlyme',
inherited: 'inherited'
},
TypeProj: {
TYPE_PROJECT: 1,
TYPE_SUBDIR: 2,
}
}

View File

@@ -96,7 +96,7 @@ export const tools = {
'yellow',
],
MAX_CHARACTERS: 60,
MAX_CHARACTERS: 200,
projects: 'projects',
todos: 'todos',
EMPTY: 0,
@@ -3338,7 +3338,7 @@ export const tools = {
return ''
},
getsuffisso() {
if (this.isTest()) return 'TEST: '
if (this.isTest()) return 'T: '
return ''
},
@@ -4360,7 +4360,16 @@ export const tools = {
col = 'green-5'
}
return col
}
},
baseurl(folder: string) {
return folder.substring(0, folder.lastIndexOf('/'))
},
getLastItem(thePath: string) {
return thePath.substring(thePath.lastIndexOf('/') + 1)
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {
// return navigator.languages[0]

View File

@@ -176,6 +176,16 @@ export const useUserStore = defineStore('UserStore', {
return ''
},
getImgByProfile(userparam: IUserFields): string {
try{
if (userparam.profile && userparam.profile.img) {
return 'upload/profile/' + userparam.username + '/' + userparam.profile.img
}
}catch (e) {}
return 'images/noimg.png'
},
getRefLink(username: string): string {
if (username === '')
username = this.my.username
@@ -805,5 +815,19 @@ export const useUserStore = defineStore('UserStore', {
return false
}
},
async loadUserProfile(username: string) {
const data = {
username
}
return Api.SendReq('/users/profile', 'POST', data)
.then((res) => {
return res.data
}).catch((error) => {
return {}
})
}
},
})