Group Page : visibility, some info, members views.
This commit is contained in:
@@ -164,9 +164,6 @@ export const costanti = {
|
||||
|
||||
BINARY_CHECK: 1,
|
||||
|
||||
RISERVATO_PASSWORD: 1,
|
||||
NASCOSTO_CERCA: 2,
|
||||
|
||||
VISUTABLE_LISTA: 2,
|
||||
VISUTABLE_SCHEDA_USER: -1,
|
||||
VISUTABLE_SCHEDA_GROUP: -3,
|
||||
|
||||
@@ -520,13 +520,13 @@ export const colSubSkills = [
|
||||
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: 'name', label_trans: 'reg.name' }),
|
||||
AddCol({
|
||||
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
|
||||
}),
|
||||
AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({
|
||||
// AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
|
||||
/* AddCol({
|
||||
name: 'profile.born_city_id', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.select_by_server,
|
||||
jointable: 'cities',
|
||||
tablesel: 'cities',
|
||||
@@ -535,6 +535,8 @@ export const colmyUserPeople = [
|
||||
remote_field: 'comune',
|
||||
noshowlabel: true,
|
||||
}),
|
||||
|
||||
*/
|
||||
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
|
||||
// AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
|
||||
]
|
||||
@@ -585,11 +587,11 @@ export const colmyUserGroup = [
|
||||
jointable: 'visibilGroup',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
}),
|
||||
AddCol({
|
||||
/*AddCol({
|
||||
name: 'pwd', label_trans: 'groups.pwd', fieldtype: costanti.FieldType.crypted,
|
||||
visibleif: costanti.BINARY_CHECK, visib_field: 'visibility', visib_value: costanti.RISERVATO_PASSWORD,
|
||||
visibleif: costanti.BINARY_CHECK, visib_field: 'visibility', visib_value: shared_consts.Visibility_Group.PASSWORD,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit,
|
||||
}),
|
||||
}),*/
|
||||
AddCol({
|
||||
name: 'admins',
|
||||
label_trans: 'groups.admins',
|
||||
|
||||
@@ -5155,6 +5155,22 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
iAmPartOfThisGroup(grp: IMyGroup) {
|
||||
const userStore = useUserStore()
|
||||
return userStore.my.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0
|
||||
},
|
||||
|
||||
iCanShowGroupsMember(grp: IMyGroup) {
|
||||
|
||||
if (grp && grp.visibility!.includes(shared_consts.Visibility_Group.PRIVATE)) {
|
||||
// Only if I am part of this group
|
||||
return this.iAmPartOfThisGroup(grp)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
},
|
||||
|
||||
iAmTheCreatorOfTheGroup(groupname: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
@@ -1056,9 +1056,9 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
return Api.SendReq('/mygroup/load', 'POST', data)
|
||||
.then((res) => {
|
||||
return res.data
|
||||
return {data: res.data, status: res.status}
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
return {data: null, status: error.status}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user