Merged in feature/PMCORE-2558 (pull request #7626)

PMCORE-2558

Approved-by: Rodrigo Quelca
This commit is contained in:
Henry Jonathan Quispe Quispe
2020-12-16 20:32:28 +00:00
committed by Rodrigo Quelca
8 changed files with 122 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="v-inline v-process-card" @click="data.onClick(data)">
<div :class="classCard()" @click="clickCard(data)">
<b-card
:sub-title="data.title"
class="overflow-hidden"
@@ -18,13 +18,22 @@ export default {
name: "ProcessCard",
props: {
data: Object,
disable: Boolean,
},
data() {
return {};
},
methods: {
classBtn(cls) {
return "btn v-btn-request " + cls;
classCard() {
if (this.disable) {
return "v-inline v-process-card v-disable";
}
return "v-inline v-process-card";
},
clickCard(data) {
if (!this.disable) {
this.data.onClick(data);
}
},
},
};
@@ -35,6 +44,10 @@ export default {
display: inline-block;
}
.v-disable {
opacity: 0.2;
}
.v-process-card {
margin-right: 15px;
margin-bottom: 15px;

View File

@@ -2,7 +2,7 @@
<div>
<h5>{{ data.title }}</h5>
<div v-for="item in data.items" :key="item.title" class="v-inline">
<process-card :data="item" />
<process-card :data="item" :disable="disable" />
</div>
</div>
</template>
@@ -16,6 +16,7 @@ export default {
},
props: {
data: Object,
disable: Boolean,
},
data() {
return {};

View File

@@ -1,6 +1,15 @@
<template>
<div id="case-detail" ref="case-detail" class="v-container-case-detail">
<div>
<b-alert
:show="dataAlert.dismissCountDown"
dismissible
:variant="dataAlert.variant"
@dismissed="dataAlert.dismissCountDown = 0"
@dismiss-count-down="countDownChanged"
>
{{ dataAlert.message }}
</b-alert>
<p class="">
<b-icon icon="arrow-left"></b-icon>
<button type="button" class="btn btn-link" @click="$emit('onLastPage')">
@@ -121,6 +130,12 @@ export default {
props: {},
data() {
return {
dataAlert: {
dismissSecs: 5,
dismissCountDown: 0,
message: "",
variant: "info",
},
dataCase: null,
newCase: {
title: this.$i18n.t("ID_NEW_CASE"),
@@ -202,10 +217,16 @@ export default {
})
)
.then((response) => {
if (response.data.success === "success") {
if (
response.data.success === "success" &&
response.data.message == ""
) {
that.attachDocuments = false;
this.dataAttachedDocuments.items = [];
that.dataAttachedDocuments.items = [];
that.getCasesNotes();
} else {
that.showAlert(response.data.message, "danger");
that.dataAttachedDocuments.items = [];
}
});
},
@@ -440,6 +461,24 @@ export default {
});
return data;
},
/**
* Show the alert message
* @param {string} message - message to be displayen in the body
* @param {string} type - alert type
*/
showAlert(message, type) {
this.dataAlert.message = message;
this.dataAlert.variant = type || "info";
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
},
/**
* Updates the alert dismiss value to update
* dismissCountDown and decrease
* @param {mumber}
*/
countDownChanged(dismissCountDown) {
this.dataAlert.dismissCountDown = dismissCountDown;
},
},
};
</script>

View File

@@ -85,8 +85,24 @@ export default {
this.onResize();
window.addEventListener("resize", this.onResize);
this.getMenu();
this.listenerIframe();
},
methods: {
/**
* Listener for iframes childs
*/
listenerIframe(){
let that = this,
eventMethod = window.addEventListener? "addEventListener": "attachEvent",
eventer = window[eventMethod],
messageEvent = eventMethod === "attachEvent"? "onmessage": "message";
eventer(messageEvent, function (e) {
if (e.data === "redirect=todo" || e.message === "redirect=todo"){
that.page = "todo";
}
});
},
/**
* Gets the menu from the server
*/

View File

@@ -23,7 +23,7 @@
/>
</div>
<div v-for="item in categoriesFiltered" :key="item.title">
<process-category :data="item" />
<process-category :data="item" :disable="disable" />
</div>
</b-modal>
</div>
@@ -44,6 +44,7 @@ export default {
mounted() {},
data() {
return {
disable: false,
filter: "",
categories: [],
categoriesFiltered: [],
@@ -152,6 +153,7 @@ export default {
},
startNewCase(dt) {
let self = this;
this.disable = true;
api.cases
.start(dt)
.then(function (data) {
@@ -161,9 +163,11 @@ export default {
DEL_INDEX: 1,
ACTION: "draft",
};
self.disable = false;
self.$parent.$parent.page = "XCase";
})
.catch((err) => {
self.disable = false;
throw new Error(err);
});
},

View File

@@ -18,10 +18,6 @@ Vue.use(BootstrapVue);
Vue.use(BootstrapVueIcons);
Vue.use(VueI18n);
Vue.use(ServerTable, {}, false, 'bootstrap3', {});
//TODO REMOVE THIS SECTION
window.PMAPI2 = {
apiClient: require('axios')
};
window.ProcessMaker = {
apiClient: require('axios')
};

View File

@@ -1,6 +1,15 @@
<template>
<div>
<b-modal ref="modal-comments" hide-footer size="xl">
<b-alert
:show="dataAlert.dismissCountDown"
dismissible
:variant="dataAlert.variant"
@dismissed="dataAlert.dismissCountDown = 0"
@dismiss-count-down="countDownChanged"
>
{{ dataAlert.message }}
</b-alert>
<div class="row">
<div class="col-sm-8">
<case-comments
@@ -43,6 +52,12 @@ export default {
mounted() {},
data() {
return {
dataAlert: {
dismissSecs: 5,
dismissCountDown: 0,
message: "",
variant: "info",
},
dataCase: null,
attachDocuments: false,
dataComments: {
@@ -77,10 +92,16 @@ export default {
})
)
.then((response) => {
if (response.data.success === "success") {
if (
response.data.success === "success" &&
response.data.message == ""
) {
that.attachDocuments = false;
this.dataAttachedDocuments.items = [];
that.dataAttachedDocuments.items = [];
that.getCasesNotes();
} else {
that.showAlert(response.data.message, "danger");
that.dataAttachedDocuments.items = [];
}
});
},
@@ -165,6 +186,24 @@ export default {
}
return nameFormat;
},
/**
* Show the alert message
* @param {string} message - message to be displayen in the body
* @param {string} type - alert type
*/
showAlert(message, type) {
this.dataAlert.message = message;
this.dataAlert.variant = type || "info";
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
},
/**
* Updates the alert dismiss value to update
* dismissCountDown and decrease
* @param {mumber}
*/
countDownChanged(dismissCountDown) {
this.dataAlert.dismissCountDown = dismissCountDown;
},
},
};
</script>

View File

@@ -30,7 +30,7 @@ if (isset($_GET['ux'])) {
if (isset($_GET['ux'])) {
echo 'if (typeof window.parent.ux_env != \'undefined\') {';
}
echo " window.parent.location.href = '$url';";
echo ' parent.parent.postMessage("redirect=todo","*");';
if (isset($_GET['ux'])) {
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures::getSingleton()->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09') && $statusPMGmail) {