Skip to content

Commit

Permalink
DMATF-14 | Run linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajborowski committed Sep 2, 2024
1 parent 9c82ee3 commit 3aa1bfa
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions hermes-console/src/views/search/SearchView.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
<script setup lang="ts">
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router';
import { onMounted, ref } from 'vue';
import { SearchFilter, useSearch } from '@/composables/search/useSearch';
import { useI18n } from 'vue-i18n';
import ConsoleAlert from '@/components/console-alert/ConsoleAlert.vue';
import LoadingSpinner from '@/components/loading-spinner/LoadingSpinner.vue';
import SubscriptionSearchResults from '@/views/search/subscription-search-results/SubscriptionSearchResults.vue';
import TopicSearchResults from '@/views/search/topic-search-results/TopicSearchResults.vue';
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router';
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const searchCollectionValues = ['subscriptions', 'topics'];
const searchCollections = [
{ title: t('search.collection.subscriptions'), value: searchCollectionValues[0] },
{
title: t('search.collection.subscriptions'),
value: searchCollectionValues[0],
},
{ title: t('search.collection.topics'), value: searchCollectionValues[1] },
];
const selectedSearchCollection = ref(searchCollectionValues.includes(route.query.collection) ? route.query.collection : searchCollectionValues[0]);
const selectedSearchCollection = ref(
searchCollectionValues.includes(route.query.collection)
? route.query.collection
: searchCollectionValues[0],
);
const searchFilterValues = [SearchFilter.ENDPOINT, SearchFilter.NAME, SearchFilter.OWNER];
const searchFilterValues = [
SearchFilter.ENDPOINT,
SearchFilter.NAME,
SearchFilter.OWNER,
];
const searchFilters = [
{ title: t('search.filter.endpoint'), value: searchFilterValues[0] },
{ title: t('search.filter.name'), value: searchFilterValues[1] },
{ title: t('search.filter.owner'), value: searchFilterValues[2] },
];
const selectedSearchFilter = ref(searchFilterValues.includes(route.query.filter) ? route.query.filter : searchFilterValues[0]);
const selectedSearchFilter = ref(
searchFilterValues.includes(route.query.filter)
? route.query.filter
: searchFilterValues[0],
);
const searchPattern = ref(route.query.pattern || '');
Expand Down Expand Up @@ -66,8 +81,14 @@
}
onBeforeRouteUpdate((to) => {
selectedSearchCollection.value = searchCollectionValues.includes(to.query.collection) ? to.query.collection : searchCollectionValues[0];
selectedSearchFilter.value = searchFilterValues.includes(to.query.filter) ? to.query.filter : searchFilterValues[0];
selectedSearchCollection.value = searchCollectionValues.includes(
to.query.collection,
)
? to.query.collection
: searchCollectionValues[0];
selectedSearchFilter.value = searchFilterValues.includes(to.query.filter)
? to.query.filter
: searchFilterValues[0];
searchPattern.value = to.query.pattern || '';
search();
});
Expand Down

0 comments on commit 3aa1bfa

Please sign in to comment.