diff --git a/front/.env b/front/.env
index 5d71c140..ad275068 100644
--- a/front/.env
+++ b/front/.env
@@ -3,7 +3,7 @@ VUE_APP_API_URL="{API_URL}"
PUBLIC_PATH = "{PUBLIC_PATH}"
VUE_APP_STATUS = "development"
-VUE_APP_VERSION = "1.10.3"
+VUE_APP_VERSION = "1.10.4"
#==================================
diff --git a/front/src/components/Affaires/Facturation/Emoluments/emoluments.html b/front/src/components/Affaires/Facturation/Emoluments/emoluments.html
index 2e609dd1..d18e49fb 100644
--- a/front/src/components/Affaires/Facturation/Emoluments/emoluments.html
+++ b/front/src/components/Affaires/Facturation/Emoluments/emoluments.html
@@ -1200,7 +1200,7 @@
Répartition des émoluments dans les factures
{{ form_detail.travauxBureau28.nom }} |
{{ form_detail.travauxBureau28.unite }} |
{{ form_detail.travauxBureau28.prix_unitaire }} CHF |
- |
+ |
{{ form_detail.travauxBureau28.montant }} CHF |
|
@@ -1308,7 +1308,7 @@ Répartition des émoluments dans les factures
{{ form_detail.travauxBureau37.nom }} |
{{ form_detail.travauxBureau37.unite }} |
{{ form_detail.travauxBureau37.prix_unitaire }} CHF |
- |
+ |
{{ form_detail.travauxBureau37.montant }} CHF |
|
diff --git a/front/src/components/Login/Login.vue b/front/src/components/Login/Login.vue
index 01b65a10..50a250fc 100644
--- a/front/src/components/Login/Login.vue
+++ b/front/src/components/Login/Login.vue
@@ -33,15 +33,15 @@ export default {
headers: {"Accept": "application/json"}
}
)
- .then(response =>{
+ .then(response => {
if(response && response.data && response.data.id){
- this.processLogin(response.data);
-
- if (process.env.VUE_APP_SERVICE_MO === response.data.service) {
- this.$router.push(this.$route.query.redirect || { name: "Cockpit"});
- } else {
- this.$router.push(this.$route.query.redirect || { name: "Preavis"});
- }
+ this.processLogin(response.data).then(() => {
+ if (process.env.VUE_APP_SERVICE_MO === response.data.service) {
+ this.$router.push(this.$route.query.redirect || { name: "Cockpit"});
+ } else {
+ this.$router.push(this.$route.query.redirect || { name: "Preavis"});
+ }
+ });
} else {
this.showProgess = false;
this.$refs.userpass.value = "";
@@ -78,20 +78,23 @@ export default {
/**
* Process login
*/
- processLogin (data) {
- localStorage.setItem('infolica_user', JSON.stringify(data));
- setCurrentUserFunctions().then(() => {
- this.$root.$emit("notesMaj_hasAdminRights");
+ async processLogin (data) {
+ return new Promise((resolve) => {
+ localStorage.setItem('infolica_user', JSON.stringify(data));
+ setCurrentUserFunctions().then(() => {
+ this.$root.$emit("notesMaj_hasAdminRights");
+ });
+ this.$root.$emit('infolica_user_logged_in', data);
+ localStorage.removeItem('infolica_cockpit_searchParams');
+ resolve();
});
- this.$root.$emit('infolica_user_logged_in', data);
- localStorage.removeItem('infolica_cockpit_searchParams');
},
/**
* Process logout
*/
processLogout () {
- localStorage.setItem('infolica_user', null);
+ localStorage.removeItem('infolica_user');
this.$root.$emit('notesMaj_set_default_params');
this.$root.$emit('infolica_user_logged_out');
diff --git a/front/src/components/Notifications/Notifications.vue b/front/src/components/Notifications/Notifications.vue
index 024bbb11..7f776a5f 100644
--- a/front/src/components/Notifications/Notifications.vue
+++ b/front/src/components/Notifications/Notifications.vue
@@ -41,7 +41,7 @@ export default {
this.msg = msg;
this.isError = true;
this.showSnackbar = true;
- this.duration = 10000;
+ this.duration = 7500;
});
//Show Alert Dialog
diff --git a/front/src/services/exceptionsHandler.js b/front/src/services/exceptionsHandler.js
index 6e06e797..6ba772f8 100644
--- a/front/src/services/exceptionsHandler.js
+++ b/front/src/services/exceptionsHandler.js
@@ -12,8 +12,14 @@ export const handleException = function (error, component) {
}
//Not authorized
else if(code === 403){
- let a = component.$router.push({name: "Login", query: { redirect: component.$router.currentRoute.path }});
- a.then(() => { component.$root.$emit("ShowError", "Veuillez vous connecter pour continuer") });
+ const currentRoute = component.$router.currentRoute;
+ if (currentRoute.name !== 'Login') {
+ const a = component.$router.push({name: "Login", query: { redirect: currentRoute.path }});
+ a.then(() => {
+ localStorage.removeItem('infolica_user');
+ component.$root.$emit("ShowError", "Veuillez vous connecter pour continuer") ;
+ });
+ }
}
//Custom error
else if(error && error.msg){
diff --git a/front/src/services/helper.js b/front/src/services/helper.js
index 4498c17b..32cd511b 100644
--- a/front/src/services/helper.js
+++ b/front/src/services/helper.js
@@ -5,15 +5,7 @@ const moment = require('moment')
* Check if the user is logged in
*/
export const checkLogged = function () {
- var session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
-
- //Set current user functions
- if(session_user){
- setCurrentUserFunctions();
- } else {
- alert("Veuillez vous connecter pour continuer");
- }
-
+ let session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
return session_user !== null;
};
@@ -22,7 +14,7 @@ export const checkLogged = function () {
* Check permission
*/
export const checkPermission = function (fonction) {
- var session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
+ let session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
if(session_user && session_user.fonctions && session_user.fonctions.indexOf(fonction) > -1){
return true;
@@ -36,7 +28,7 @@ export const checkPermission = function (fonction) {
* Get current user role id
*/
export const getCurrentUserRoleId = function () {
- var session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
+ let session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
return (session_user && session_user.role_id) ? session_user.role_id : null;
};
@@ -52,8 +44,8 @@ export const setCurrentUserFunctions = async function () {
})
.then(response =>{
if(response && response.data){
- var session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
-
+ let session_user = JSON.parse(localStorage.getItem('infolica_user')) || null;
+
if(session_user){
session_user.fonctions = response.data.fonctions;
session_user.role_id = response.data.role_id;