diff --git a/docker-compose.yml b/docker-compose.yml index 33d8c2809..6494739f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,4 +11,7 @@ services: replicas: ${FRONT_REPLICAS:?} placement: constraints: - - node.role == worker \ No newline at end of file + - node.role == worker + resources: + limits: + memory: 1G diff --git a/src/boot/axios.js b/src/boot/axios.js index 2f454188e..cbd5e7213 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -58,9 +58,12 @@ const onResponseError = (error) => { break; } - if (session.isLoggedIn && response.status === 401) { + if (session.isLoggedIn() && response.status === 401) { session.destroy(); Router.push({ path: '/login' }); + } else if(!session.isLoggedIn()) + { + message = 'login.loginError'; } Notify.create({ diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 7f2fb579f..8839bd030 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -127,7 +127,7 @@ async function togglePinned(item, event) { diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 6bc00d5ce..a7504705a 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -70,7 +70,7 @@ async function saveDarkMode(value) { } async function saveLanguage(value) { - const query = `/Accounts/${user.value.id}`; + const query = `/VnUsers/${user.value.id}`; await axios.patch(query, { lang: value, }); diff --git a/src/composables/getUrl.js b/src/composables/getUrl.js new file mode 100644 index 000000000..63eb63c0b --- /dev/null +++ b/src/composables/getUrl.js @@ -0,0 +1,19 @@ +import axios from 'axios'; + +export async function getUrl(route, appName = 'salix') { + let url; + const env = process.env.NODE_ENV === 'development' ? 'dev' : process.env.NODE_ENV; + const filter = { + where: {and: [ + {appName: appName}, + {environment: env} + ]} + }; + + await axios.get('Urls/findOne', {params: {filter}}) + .then(res => { + url = res.data.url + route; + }); + + return url; +} diff --git a/src/composables/useRole.js b/src/composables/useRole.js index b8da153d3..95b585283 100644 --- a/src/composables/useRole.js +++ b/src/composables/useRole.js @@ -5,7 +5,7 @@ export function useRole() { const state = useState(); async function fetch() { - const { data } = await axios.get('Accounts/acl'); + const { data } = await axios.get('VnUsers/acl'); const roles = data.roles.map((userRoles) => userRoles.role.name); const userData = { @@ -13,7 +13,6 @@ export function useRole() { name: data.user.name, nickname: data.user.nickname, lang: data.user.lang || 'es', - darkMode: data.user.userConfig.darkMode, }; state.setUser(userData); state.setRoles(roles); diff --git a/src/composables/useSession.js b/src/composables/useSession.js index 62cb8a28b..008337b02 100644 --- a/src/composables/useSession.js +++ b/src/composables/useSession.js @@ -1,5 +1,7 @@ import { useState } from './useState'; import { useRole } from './useRole'; +import { useUserConfig } from './useUserConfig'; + export function useSession() { function getToken() { @@ -36,11 +38,10 @@ export function useSession() { } async function login(token, keepLogin) { - const { fetch } = useRole(); - setToken({ token, keepLogin }); - await fetch(); + await useRole().fetch(); + await useUserConfig().fetch(); } function isLoggedIn() { diff --git a/src/composables/useUserConfig.js b/src/composables/useUserConfig.js new file mode 100644 index 000000000..767ffb54e --- /dev/null +++ b/src/composables/useUserConfig.js @@ -0,0 +1,17 @@ +import axios from 'axios'; +import { useState } from './useState'; + +export function useUserConfig() { + const state = useState(); + + async function fetch() { + const { data } = await axios.get('UserConfigs/getUserConfig'); + const user = state.getUser().value; + user.darkMode = data.darkMode; + state.setUser(user); + } + + return { + fetch, + }; +} diff --git a/src/css/fonts/icomoon.eot b/src/css/fonts/icomoon.eot index f85902086..6a158c806 100644 Binary files a/src/css/fonts/icomoon.eot and b/src/css/fonts/icomoon.eot differ diff --git a/src/css/fonts/icomoon.svg b/src/css/fonts/icomoon.svg index b4208013b..38d4ab015 100644 --- a/src/css/fonts/icomoon.svg +++ b/src/css/fonts/icomoon.svg @@ -3,7 +3,7 @@ Generated by IcoMoon - + @@ -98,7 +98,7 @@ - + @@ -108,7 +108,9 @@ + + @@ -132,4 +134,4 @@ - \ No newline at end of file + diff --git a/src/css/fonts/icomoon.ttf b/src/css/fonts/icomoon.ttf index b69a35035..b484f2a60 100644 Binary files a/src/css/fonts/icomoon.ttf and b/src/css/fonts/icomoon.ttf differ diff --git a/src/css/fonts/icomoon.woff b/src/css/fonts/icomoon.woff index aa2d01bfb..087d63f5e 100644 Binary files a/src/css/fonts/icomoon.woff and b/src/css/fonts/icomoon.woff differ diff --git a/src/css/icons.scss b/src/css/icons.scss index 920a59626..29ee53ede 100644 --- a/src/css/icons.scss +++ b/src/css/icons.scss @@ -26,12 +26,6 @@ -moz-osx-font-smoothing: grayscale; } -.icon-pin:before { - content: '\e950'; -} -.icon-pin_off:before { - content: '\e95b'; -} .icon-frozen:before { content: '\e900'; } @@ -56,7 +50,7 @@ .icon-greenery:before { content: '\e907'; } -.icon-planta:before { +.icon-plant:before { content: '\e908'; } .icon-handmade:before { @@ -401,3 +395,18 @@ .icon-trolley:before { content: '\e95c'; } +.icon-agency-term:before { + content: '\e950'; +} +.icon-client-unpaid:before { + content: '\e95b'; +} +.icon-trolley:before { + content: '\e95c'; +} +.icon-grafana:before { + content: '\e965'; +} +.icon-troncales:before { + content: '\e967'; +} diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a4b53e891..a43c5fe7c 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -361,6 +361,7 @@ export default { list: 'List', basicData: 'Basic data', summary: 'Summary', + notifications: 'Notifications', }, list: { name: 'Name', @@ -394,6 +395,12 @@ export default { role: 'Role', sipExtension: 'Extension', }, + notificationsManager: { + activeNotifications: 'Active notifications', + availableNotifications: 'Available notifications', + subscribed: 'Subscribed to the notification', + unsubscribed: 'Unsubscribed from the notification', + }, imageNotFound: 'Image not found', }, wagon: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index cd052fe3f..6328c8f5d 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -361,6 +361,7 @@ export default { list: 'Listado', basicData: 'Datos básicos', summary: 'Resumen', + notifications: 'Notificaciones', }, list: { name: 'Nombre', @@ -394,6 +395,12 @@ export default { role: 'Rol', sipExtension: 'Extensión', }, + notificationsManager: { + activeNotifications: 'Notificaciones activas', + availableNotifications: 'Notificaciones disponibles', + subscribed: 'Se ha suscrito a la notificación', + unsubscribed: 'Se ha dado de baja de la notificación', + }, imageNotFound: 'No se ha encontrado la imagen', }, wagon: { diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 2c878b74b..2691bbc51 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -1,12 +1,36 @@