diff --git a/components/search_results/free_text/EntitySearchResults.vue b/components/search_results/free_text/EntitySearchResults.vue deleted file mode 100644 index e7d949efe41d069060a2e42f2c67df5f8e34c4ff..0000000000000000000000000000000000000000 --- a/components/search_results/free_text/EntitySearchResults.vue +++ /dev/null @@ -1,61 +0,0 @@ -<template> - <SearchResultsCard - :store-module-name="storeModuleName" - :dataset-state="datasetState" - /> -</template> - -<script> -import CompoundResults from '~/web-components-submodule/store/datasets/generators/eubopen/searchResults/CompoundResults.js' -import TargetResults from '~/web-components-submodule/store/datasets/generators/eubopen/searchResults/TargetResults.js' -import { datasetMixin } from '~/web-components-submodule/mixins/datasets/datasetMixin.js' -import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js' -import SearchResultsCard from '~/web-components-submodule/components/common/SearchResults/SearchResultsCard.vue' - -export default { - components: { - SearchResultsCard, - }, - mixins: [datasetMixin], - props: { - storeModuleName: { - type: String, - default: () => `eubopen_search_results`, - }, - entityResultsConfig: { - type: Object, - default: () => {}, - }, - }, - data() { - return { - propertiesGroups: { - 1: { id: 'eubopen_search_results', selected: true, allHeaders: [] }, - }, - entityID: this.entityResultsConfig.entityID, - searchTerm: this.entityResultsConfig.searchTerm, - pluralEntityName: - EntityNames[this.entityResultsConfig.entityID].pluralEntityName, - } - }, - computed: { - starterParams() { - if ( - this.entityResultsConfig.entityID === - EntityNames.EubopenCompound.entityID - ) - return CompoundResults.getSearchResultsStarterParams( - this.propertiesGroups, - this.entityResultsConfig.searchQuery.es_query - ) - - return TargetResults.getSearchResultsStarterParams( - this.propertiesGroups, - this.entityResultsConfig.searchQuery.es_query - ) - }, - }, -} -</script> - -<style></style> diff --git a/components/search_results/free_text/FreeTextResults.vue b/components/search_results/free_text/FreeTextResults.vue deleted file mode 100644 index 4fac2a5b53a945c8e2acad02f8dfd961b246312f..0000000000000000000000000000000000000000 --- a/components/search_results/free_text/FreeTextResults.vue +++ /dev/null @@ -1,119 +0,0 @@ -<template> - <div> - <v-container v-if="searching"> - <div class="d-flex flex-column align-center"> - <div class="text-overline">Searching...</div> - <br /> - - <v-progress-linear indeterminate /> - </div> - </v-container> - <v-tabs - v-else - v-model="selectedTab" - show-arrows - :vertical="makeTabsVertical" - > - <v-tab - v-for="entityResults in resultsPerEntity" - :key="`tab-${entityResults.entityID}`" - > - {{ getPluralEntityName(entityResults.entityID) }} - </v-tab> - <v-tabs-items v-model="selectedTab"> - <v-tab-item - v-for="entityResults in resultsPerEntity" - :key="`tab-item-${entityResults.entityID}`" - > - <EntitySearchResults - :entity-results-config="entityResults" - :store-module-name="`eubopen-${entityResults.entityID}-search-results`" - /> - </v-tab-item> - </v-tabs-items> - </v-tabs> - </div> -</template> - -<script> -import RequestNotifications from '@/web-components-submodule/utils/RequestNotifications.js' -import EntityNames from '~/web-components-submodule/standardisation/EntityNames.js' -import ESProxyService from '~/web-components-submodule/services/ESProxyService.js' -import EntitySearchResults from '~/components/search_results/free_text/EntitySearchResults.vue' -import ErrorTracking from '~/web-components-submodule/tracking/ErrorTracking.js' - -export default { - components: { - EntitySearchResults, - }, - props: { - searchTerm: { - type: String, - default: () => {}, - }, - }, - data() { - return { - searching: true, - selectedTab: 0, - resultsPerEntity: [], - } - }, - computed: { - makeTabsVertical() { - switch (this.$vuetify.breakpoint.name) { - case 'xs': - return false - case 'sm': - return false - default: - return true - } - }, - }, - mounted() { - this.getSearchParams() - }, - methods: { - getSearchParams() { - ESProxyService.getEubopenSearchParams(this.searchTerm) - .then((response) => { - const data = response.data - const entitiesResults = data.entities - const highestScoringEntity = data.highest_scoring_entity - const resultsPerEntity = [] - let currentIndex = 0 - for (const [entityKey, entityResults] of Object.entries( - entitiesResults - )) { - resultsPerEntity.push({ - entityID: entityKey, - searchQuery: entityResults, - searchTerm: this.searchTerm, - }) - if (entityKey === highestScoringEntity) { - this.selectedTab = currentIndex - } - currentIndex += 1 - } - this.resultsPerEntity = resultsPerEntity - this.searching = false - }) - .catch((error) => { - ErrorTracking.trackError(error, this) - - RequestNotifications.dispatchRequestErrorNotification( - error, - this.$store.dispatch, - `There was an error while loading the suggested search terms!` - ) - }) - }, - getPluralEntityName(entityID) { - return EntityNames[entityID].pluralEntityName - }, - }, -} -</script> - -<style></style> diff --git a/components/search_results/free_text/HeatmapResults.vue b/components/search_results/free_text/HeatmapResults.vue deleted file mode 100644 index de082ee59b434b3923d81a2011cf1a22236ed44d..0000000000000000000000000000000000000000 --- a/components/search_results/free_text/HeatmapResults.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <v-card flat> - <v-card-text> Heatmap </v-card-text> - </v-card> -</template> - -<script> -export default {} -</script> - -<style></style> diff --git a/pages/search/_term.vue b/pages/search/_term.vue index fec64f2fc2d9a190852578db3008979d9a112c85..37a6269ffc2ec6072b817220f14cc04660ecf5d3 100644 --- a/pages/search/_term.vue +++ b/pages/search/_term.vue @@ -8,7 +8,7 @@ </template> <script> -import FreeTextResults from '~/components/search_results/free_text/FreeTextResults.vue' +import FreeTextResults from '~/web-components-submodule/components/common/SearchResults/FreeText/FreeTextResults.vue' export default { components: { diff --git a/web-components-submodule b/web-components-submodule index f81fef0169491c7e605c3211ad9ccb87ee079f9c..908af8a7cbe8e364786c92533da196fa86d1e696 160000 --- a/web-components-submodule +++ b/web-components-submodule @@ -1 +1 @@ -Subproject commit f81fef0169491c7e605c3211ad9ccb87ee079f9c +Subproject commit 908af8a7cbe8e364786c92533da196fa86d1e696