PMCORE-3278

This commit is contained in:
Henry Jordan
2021-09-08 16:13:21 +00:00
parent 07492799cf
commit 938723e822
3 changed files with 44 additions and 2 deletions

View File

@@ -236,7 +236,8 @@ export let cases = {
usr_uid_target: data.userSelected, usr_uid_target: data.userSelected,
del_index: data.DEL_INDEX, del_index: data.DEL_INDEX,
reason: data.reasonReassign, reason: data.reasonReassign,
sendMail: data.notifyUser sendMail: data.notifyUser,
usr_uid_source: window.config.userConfig.usr_uid
}, },
keys: { keys: {
app_uid: data.APP_UID app_uid: data.APP_UID

View File

@@ -9,6 +9,15 @@
{{ $t('ID_REASSIGN_CASE') }} {{ $t('ID_REASSIGN_CASE') }}
<i class="fas fa-undo"></i> <i class="fas fa-undo"></i>
</template> </template>
<b-alert
:show="dataAlert.dismissCountDown"
dismissible
:variant="dataAlert.variant"
@dismissed="dataAlert.dismissCountDown = 0"
@dismiss-count-down="countDownChanged"
>
{{ dataAlert.message }}
</b-alert>
<b-container fluid> <b-container fluid>
<b-row class="my-1"> <b-row class="my-1">
<b-col sm="3"> <b-col sm="3">
@@ -56,7 +65,7 @@
variant="success" variant="success"
@click="reassignCase" @click="reassignCase"
> >
{{ $t("ID_PAUSE") }} {{ $t("ID_REASSIGN") }}
</b-button> </b-button>
</div> </div>
</div> </div>
@@ -75,6 +84,12 @@ export default {
mounted() {}, mounted() {},
data() { data() {
return { return {
dataAlert: {
dismissSecs: 5,
dismissCountDown: 0,
message: "",
variant: "danger",
},
data: null, data: null,
locale: 'en-US', locale: 'en-US',
users: [], users: [],
@@ -145,8 +160,31 @@ export default {
that.$parent.$refs["vueCardView"].getData(); that.$parent.$refs["vueCardView"].getData();
} }
} }
})
.catch((e) => {
if(e.response.data && e.response.data.error){
that.showAlert(e.response.data.error.message, "danger");
}
}); });
}, },
/**
* 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> </script>

View File

@@ -143,4 +143,7 @@ ScriptVariables::add('SYS_LANG', SYS_LANG);
ScriptVariables::add('TRANSLATIONS', $translation); ScriptVariables::add('TRANSLATIONS', $translation);
ScriptVariables::add('FORMATS', $conf->getFormats()); ScriptVariables::add('FORMATS', $conf->getFormats());
ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED'])); ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
ScriptVariables::add('userConfig', array(
"usr_uid" => $_SESSION['USER_LOGGED']
));
echo View::make('Views::home.home', compact("userCanAccess"))->render(); echo View::make('Views::home.home', compact("userCanAccess"))->render();