diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 7b7b1097f..ae4c4ceb5 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -1,21 +1,23 @@ + + +en: + Go to Salix: Go to Salix +es: + Go to Salix: Ir a Salix + diff --git a/src/components/PinnedModules.vue b/src/components/PinnedModules.vue index 2df7db390..1193c951a 100644 --- a/src/components/PinnedModules.vue +++ b/src/components/PinnedModules.vue @@ -2,69 +2,90 @@ import { onMounted, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useNavigationStore } from 'src/stores/useNavigationStore'; +import { getUrl } from 'src/composables/getUrl'; +import { useRoute } from 'vue-router'; const navigation = useNavigationStore(); const { t } = useI18n(); +const route = useRoute(); onMounted(() => { navigation.fetchPinned(); }); +defineExpose({ + redirect, +}); + const pinnedModules = computed(() => navigation.getPinnedModules()); + +async function redirect() { + let section = route.path.substring(1); + if (!route.path.includes('/')) return (window.location.href = await getUrl(section)); + section = section.substring(0, section.indexOf('/')); + if (route?.params?.id) + return (window.location.href = await getUrl( + `${section}/${route.params.id}/summary` + )); + return (window.location.href = await getUrl(section + 'dashboard')); +} + + +en: + Home: Home +es: + Home: Inicio + diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index 7cf260a73..d87af6cab 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -5,12 +5,7 @@ const customer = reactive({ name: '', }); -watch( - () => customer.name, - () => { - console.log('customer.name changed'); - } -); +watch(() => customer.name);