From 0fbe83d7373c8507dd25f3460c7df5fd9a0b94fd Mon Sep 17 00:00:00 2001 From: Alexandro Uc Date: Wed, 1 Apr 2026 20:39:45 -0600 Subject: [PATCH] local search & fix texts --- src/assets/main.css | 18 -------------- src/assets/styles/fonts.css | 15 ++++++++++++ src/components/MakeProposalModal.vue | 2 +- src/i18n/en.js | 5 +++- src/i18n/es.js | 5 +++- src/layouts/AdminLayout.vue | 4 +--- src/layouts/components/NavBar.vue | 9 ++++--- src/layouts/components/Sidebar.vue | 2 +- src/main.js | 1 + src/services/company.js | 2 -- src/stores/privacy.js | 4 ++++ src/views/auth/CompleteRegisterView.vue | 2 +- src/views/company/MyCompanyView.vue | 21 +++++++++++++++- src/views/contacts/ContactsView.vue | 25 +++++++++++++------- src/views/loads/modals/ProposalsModal.vue | 2 +- src/views/searchs/CarriersView.vue | 5 +++- src/views/searchs/components/CardCompany.vue | 6 ++--- 17 files changed, 81 insertions(+), 47 deletions(-) create mode 100644 src/assets/styles/fonts.css diff --git a/src/assets/main.css b/src/assets/main.css index bfeda21..472276a 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -40,24 +40,6 @@ body { border-radius: 3rem !important; } -/* Fuentes */ - .font-bold { - font-weight: bold; - } - - .fsize-1 { - font-size: 1rem; - } - - .fsize-1-5 { - font-size: 1.5rem; - } - - .fsize-2 { - font-size: 2rem; - } -/* *********** */ - .divider { display: block; height: 2px; diff --git a/src/assets/styles/fonts.css b/src/assets/styles/fonts.css new file mode 100644 index 0000000..667c920 --- /dev/null +++ b/src/assets/styles/fonts.css @@ -0,0 +1,15 @@ +.font-bold { + font-weight: bold; +} + +.fsize-1 { + font-size: 1rem; +} + +.fsize-1-5 { + font-size: 1.5rem; +} + +.fsize-2 { + font-size: 2rem; +} \ No newline at end of file diff --git a/src/components/MakeProposalModal.vue b/src/components/MakeProposalModal.vue index a5b7a68..78e8ca9 100644 --- a/src/components/MakeProposalModal.vue +++ b/src/components/MakeProposalModal.vue @@ -198,7 +198,7 @@ diff --git a/src/i18n/en.js b/src/i18n/en.js index 412549c..4a4b227 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -159,7 +159,8 @@ const en = { loading: 'Please wait!', savingChanes: 'Saving changes', observerWarehouse: 'Warehouse observers will receive notifications about the load location, including arrival and departure times, and will be able to view the cargo on the warehouse dashboard.', - observerClient: 'Observers will receive notifications about the load, including the loading and unloading date, as well as any changes in the load status. They can monitor the cargo on their customer dashboard.' + observerClient: 'Observers will receive notifications about the load, including the loading and unloading date, as well as any changes in the load status. They can monitor the cargo on their customer dashboard.', + notDriverAssign: 'This offer does not include an assigned driver. Please request that the carrier assign an operator to continue the loading process.' }, global: { signIn: "Sign In", @@ -208,6 +209,8 @@ const en = { delivered: 'Delivered', downloading: 'Downloading', add: 'Add', + dashboard: 'Dashboard', + notDriver: 'Without driver' }, login: { title: 'Sign in', diff --git a/src/i18n/es.js b/src/i18n/es.js index fc56a9c..47b7b1b 100644 --- a/src/i18n/es.js +++ b/src/i18n/es.js @@ -162,7 +162,8 @@ const es = { loading: 'Por favor espere!', savingChanes: 'Guardando cambios', observerWarehouse: 'Los observadores de bodega recibirán notificaciones sobre la ubicación de la carga, incluyendo la hora de llegada y salida, podran visualizar la carga en el panel de bodega.', - observerClient: 'Los observadores recibirán notificaciones sobre la carga, incluyendo la fecha de carga y descarga, así como cualquier cambio en el estado de la carga. podran monitorer la carga en el panel de clientes.' + observerClient: 'Los observadores recibirán notificaciones sobre la carga, incluyendo la fecha de carga y descarga, así como cualquier cambio en el estado de la carga. podran monitorer la carga en el panel de clientes.', + notDriverAssign: 'Oferta sin conductor asignado. Solicite al transportista que asigne un operador para continuar con el proceso de carga.' }, global: { signIn: 'Ingresar', @@ -211,6 +212,8 @@ const es = { delivered: 'Entregado', downloading: 'Descargando', add: 'Agregar', + dashboard: 'Panel', + notDriver: 'Sin conductor' }, login: { title: 'Iniciar sesión', diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index 4d7f985..4a6cf66 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -4,8 +4,6 @@ import Sidebar from './components/Sidebar.vue'; import ProfilePopup from '../views/profile/modals/ProfilePopup.vue'; import NotificationsPopup from './components/NotificationsPopup.vue'; -import ConfigPopup from './components/ConfigPopup.vue'; - diff --git a/src/layouts/components/NavBar.vue b/src/layouts/components/NavBar.vue index fe10b15..c06befe 100644 --- a/src/layouts/components/NavBar.vue +++ b/src/layouts/components/NavBar.vue @@ -75,13 +75,16 @@ - + + + diff --git a/src/layouts/components/Sidebar.vue b/src/layouts/components/Sidebar.vue index af848ab..570e1f6 100644 --- a/src/layouts/components/Sidebar.vue +++ b/src/layouts/components/Sidebar.vue @@ -65,7 +65,7 @@ Dashboard + class="nav-link" :to="{name: 'home'}">{{ t('global.dashboard') }}
  • { export const updateMyUserProfile = async(formData) => { try { const endpoint = `/v1/users/profile`; - console.log(formData); const {data} = await api.patch(endpoint, formData); return { msg: "success", @@ -224,7 +223,6 @@ export const getPrivateListService = async() => { try { const endpoint = `/v1/groups/private`; const {data} = await api.get(endpoint); - console.log(data); return { msg: 'success', data: data diff --git a/src/stores/privacy.js b/src/stores/privacy.js index 0c8d710..c6e2c9f 100644 --- a/src/stores/privacy.js +++ b/src/stores/privacy.js @@ -6,6 +6,7 @@ export const usePrivacyStore = defineStore('privacy', () => { const privacy = ref(false); const privateListRef = ref([]); + const loading = ref(false); const privateList = ref([]); @@ -20,7 +21,9 @@ export const usePrivacyStore = defineStore('privacy', () => { } const getPrivateList = async (id) => { + loading.value = true; const response = await getPrivateListService(); + loading.value = false; if(response.msg == 'success') { privateList.value = response.data.allowedCompanies || []; privateListRef.value = privateList.value.map((e) => e._id); @@ -60,6 +63,7 @@ export const usePrivacyStore = defineStore('privacy', () => { } return { + loading, privacy, privateListRef, privateList, diff --git a/src/views/auth/CompleteRegisterView.vue b/src/views/auth/CompleteRegisterView.vue index c89957f..786293f 100644 --- a/src/views/auth/CompleteRegisterView.vue +++ b/src/views/auth/CompleteRegisterView.vue @@ -98,7 +98,7 @@ localStorage.setItem('id', result.data._id); localStorage.setItem('session', auth.sesion); - localStorage.setItem('access', auth.accessToken); + localStorage.setItem('access', auth.token); const userData = { "first_name" : user.name, diff --git a/src/views/company/MyCompanyView.vue b/src/views/company/MyCompanyView.vue index d3cbede..396ac35 100644 --- a/src/views/company/MyCompanyView.vue +++ b/src/views/company/MyCompanyView.vue @@ -8,16 +8,21 @@ import EditCompanyModal from './modals/EditCompanyModal.vue'; import { storeToRefs } from 'pinia'; import { useI18n } from 'vue-i18n'; +import CustomSwitch from '../../components/CustomSwitch.vue'; +import { usePrivacyStore } from '../../stores/privacy'; const auth = useAuthStore() + const privacyStore = usePrivacyStore(); const company = useCompanyStore(); const { user } = storeToRefs(auth); const { t, locale } = useI18n() + const privacy = ref(false); onMounted(() => { if(user.value) { getInitialData() } + privacy.value = privacyStore.privacy; }); watch(user, () => { @@ -26,6 +31,10 @@ } }) + watch(privacy, () => { + privacyStore.updatePrivacy(privacy.value); + }) + const getInitialData = async() => { await company.getCompanyData(); } @@ -36,7 +45,7 @@ diff --git a/src/views/contacts/ContactsView.vue b/src/views/contacts/ContactsView.vue index 86c3e57..1099f74 100644 --- a/src/views/contacts/ContactsView.vue +++ b/src/views/contacts/ContactsView.vue @@ -7,27 +7,34 @@ import Spiner from '../../components/ui/Spiner.vue'; const privateStore = usePrivacyStore(); + const contacts = ref([]); const { t } = useI18n(); - const loading = ref(false); const query = ref(''); let timeout = null; - onMounted(() => { - privateStore.getPrivateList(); + onMounted( async () => { + await privateStore.getPrivateList(); + contacts.value = privateStore.privateList; }); watch(query, (newValue) => { clearTimeout(timeout); timeout = setTimeout(() => { - if (newValue.length >= 2) { - search(); - } + search(); }, 400); }); const search = () => { - console.log('Searching:', query.value); + if(query.value.length > 0) { + contacts.value = privateStore.privateList.filter( + (e) => e.company_name + .toLowerCase() + .includes(query.value.toLocaleLowerCase())); + console.log(values.length); + } else { + contacts.value = privateStore.privateList; + } }; @@ -38,12 +45,12 @@ v-model:saerch="query" />
    -
    +
    diff --git a/src/views/loads/modals/ProposalsModal.vue b/src/views/loads/modals/ProposalsModal.vue index fad9acb..2d885ea 100644 --- a/src/views/loads/modals/ProposalsModal.vue +++ b/src/views/loads/modals/ProposalsModal.vue @@ -215,7 +215,7 @@
    - Oferta sin conductor asignado. Solicite al transportista que asigne un operador para continuar con el proceso de carga. + {{ t('messages.notDriverAssign') }}
    diff --git a/src/views/searchs/CarriersView.vue b/src/views/searchs/CarriersView.vue index d8791d9..b392a9f 100644 --- a/src/views/searchs/CarriersView.vue +++ b/src/views/searchs/CarriersView.vue @@ -9,7 +9,9 @@ import Cities from '../../components/ui/Cities.vue'; import Pagination from '../../components/Pagination.vue'; import { useI18n } from 'vue-i18n'; + import { usePrivacyStore } from '../../stores/privacy'; + const privacyStore = usePrivacyStore(); const {loading, companies, getCompaniesData, companiesTotal, currentCompaniesPage} = useDirectory(); const query = ref(''); const selectedTruckType = ref([]); @@ -22,10 +24,11 @@ const limit = 10; - onMounted(() => { + onMounted( async () => { filterQuery.value.company_type = 'carrier'; filterQuery.value.limit = 'elements=' + limit; filterQuery.value.page = "page=0"; + await privacyStore.getPrivateList(); getCompaniesData(filterQuery.value); }); diff --git a/src/views/searchs/components/CardCompany.vue b/src/views/searchs/components/CardCompany.vue index 6ff075a..b194172 100644 --- a/src/views/searchs/components/CardCompany.vue +++ b/src/views/searchs/components/CardCompany.vue @@ -83,11 +83,9 @@

    {{ t('labels.infoCompany') }}: {{company.company_description}}

    -
    +