PMCORE-3109: UI- Create avatar user info component

This commit is contained in:
Rodrigo Quelca
2021-07-30 17:45:28 +00:00
parent 0585f8fd8d
commit 13dea03415
2 changed files with 42 additions and 6 deletions

View File

@@ -8,11 +8,14 @@
:options="options"
ref="table"
>
<div slot="actions" slot-scope="props">
<div slot="actions" slot-scope="props">
<div>
<ellipsis v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
<ellipsis v-if="dataEllipsis" :data="dataEllipsis"> </ellipsis>
</div>
</div>
<div slot="owner" slot-scope="props">
<OwnerCell :data="props.row.owner" />
</div>
</v-server-table>
</div>
@@ -21,13 +24,16 @@
<script>
import Api from "./Api/CaseList";
import ButtonFleft from "../../../components/home/ButtonFleft.vue";
import Ellipsis from '../../../components/utils/ellipsis.vue';
import Ellipsis from "../../../components/utils/ellipsis.vue";
import utils from "../../../utils/utils";
import OwnerCell from "../../../components/vuetable/OwnerCell";
export default {
name: "Tables",
props: ["module"],
components: {
ButtonFleft,
Ellipsis
Ellipsis,
OwnerCell
},
data() {
return {
@@ -125,9 +131,10 @@ export default {
});
return new Promise((resolutionFunc, rejectionFunc) => {
Api.getCaseList(filters, that.module)
.then((response) => {
.then((response) => {
dt = that.formatDataResponse(response.data.data);
resolutionFunc({
data: response.data.data,
data: dt,
count: response.data.total
});
})
@@ -135,6 +142,32 @@ export default {
rejectionFunc(e);
});
});
},
formatDataResponse(response){
let that = this,
data = [],
userDataFormat;
debugger;
_.forEach(response, (v) => {
userDataFormat = utils.userNameDisplayFormat({
userName: v.userName || "",
firstName: v.userFirstname || "",
lastName: v.userLastname || "",
format: window.config.FORMATS.format || null
});
v["owner"] = {
userAvatar: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
window.config.SYS_URI +
`users/users_ViewPhotoGrid?pUID=${v.userId}` : "",
userInfo: userDataFormat || "",
userEmail: v.userEmail,
userId: v.userId,
userPosition: v.userPosition || ""
}
data.push(v);
});
return data;
}
}
};

View File

@@ -6,6 +6,8 @@ use ProcessMaker\Core\System;
global $translation;
global $RBAC;
$conf = new Configurations();
if ($RBAC->userCanAccess("PM_SETUP") != 1 || $RBAC->userCanAccess("PM_SETUP_ADVANCE") != 1) {
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels");
exit(0);
@@ -30,4 +32,5 @@ ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
ScriptVariables::add('SYS_URI', SYS_URI);
ScriptVariables::add('SYS_LANG', SYS_LANG);
ScriptVariables::add('TRANSLATIONS', $translation);
ScriptVariables::add('FORMATS', $conf->getFormats());
echo View::make('Views::admin.settings.customCasesList', compact("userCanAccess"))->render();