Remove unused things
gitea/hedera-web/pipeline/pr-dev There was a failure building this commit Details
gitea/hedera-web/pipeline/pr-beta This commit looks good Details

This commit is contained in:
William Buezas 2025-04-23 16:07:47 +02:00
parent 9c0ec3e29d
commit 9423bcb211
3 changed files with 32 additions and 142 deletions

View File

@ -1,107 +0,0 @@
<script setup>
import { onMounted, ref, inject } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import VnInput from 'src/components/common/VnInput.vue';
const props = defineProps({
searchFn: {
type: Function,
default: null
},
placeholder: {
type: String,
default: ''
},
sqlQuery: {
type: String,
default: null
},
searchField: {
type: String,
default: 'search'
}
});
const emit = defineEmits(['onSearch', 'onSearchError']);
const jApi = inject('jApi');
const { t } = useI18n();
const router = useRouter();
const route = useRoute();
const searchTerm = ref('');
const search = async () => {
try {
let data = null;
router.replace({
query: searchTerm.value ? { search: searchTerm.value } : {}
});
if (!searchTerm.value) {
emit('onSearchError');
return;
}
if (props.sqlQuery) {
data = await jApi.query(props.sqlQuery, {
[props.searchField]: searchTerm.value
});
} else if (props.searchFn) {
data = props.searchFn(searchTerm.value);
}
emit('onSearch', data);
} catch (error) {
console.error('Error searching:', error);
emit('onSearchError');
}
};
onMounted(() => {
if (route.query.search) {
searchTerm.value = route.query.search;
search();
}
});
</script>
<template>
<VnInput
v-model="searchTerm"
@keyup.enter="search()"
:placeholder="props.placeholder || t('search')"
bg-color="white"
is-outlined
:clearable="false"
class="searchbar"
data-cy="searchBar"
>
<template #prepend>
<QIcon name="search" class="cursor-pointer" @click="search()" />
</template>
</VnInput>
</template>
<style lang="scss" scoped>
@import 'src/css/responsive';
.searchbar {
@include mobile {
max-width: 120px;
}
}
</style>
<i18n lang="yaml">
en-US:
search: Search
es-ES:
search: Buscar
ca-ES:
search: Cercar
fr-FR:
search: Rechercher
pt-PT:
search: Pesquisar
</i18n>

View File

@ -1,15 +1,14 @@
<script setup>
import { ref, onMounted, inject } from 'vue';
const jApi = inject('jApi');
const api = inject('api');
const news = ref([]);
const showPreview = ref(false);
const selectedImageSrc = ref('');
const fetchData = async () => {
const newsResponse = await api.get('News');
const newsResponse = await api.get('News');
news.value = newsResponse.data;
news.value = newsResponse.data;
};
const showImagePreview = src => {

View File

@ -13,7 +13,6 @@ import { useAppStore } from 'stores/app';
import { storeToRefs } from 'pinia';
import { onUserId } from 'src/utils/onUserId';
const jApi = inject('jApi');
const api = inject('api');
const { t } = useI18n();
const { openConfirmationModal } = useVnConfirm();
@ -25,44 +24,44 @@ const router = useRouter();
const loading = ref(false);
const orders = ref([]);
const getOrders = async (clientFk) => {
const getOrders = async clientFk => {
try {
loading.value = true;
const filter = {
where: {
clientFk,
isConfirmed: false,
source_app: 'WEB',
},
include: [
{
relation: 'address',
scope: {
fields: ['nickname', 'city'],
}
where: {
clientFk,
isConfirmed: false,
source_app: 'WEB'
},
{
relation: 'agencyMode',
scope: {
fields: ['description'],
}
},
],
fields: [
'id',
'landed',
'delivery_method_id',
'taxableBase',
'addressFk',
'agencyModeFk'
]
include: [
{
relation: 'address',
scope: {
fields: ['nickname', 'city']
}
},
{
relation: 'agencyMode',
scope: {
fields: ['description']
}
}
],
fields: [
'id',
'landed',
'delivery_method_id',
'taxableBase',
'addressFk',
'agencyModeFk'
]
};
const { data: salixOrders } = await api.get('Orders', {
params: {
filter: JSON.stringify(filter)
}
params: {
filter: JSON.stringify(filter)
}
});
orders.value = salixOrders;
@ -89,7 +88,6 @@ const loadOrder = orderId => {
};
onUserId(getOrders);
</script>
<template>