diff --git a/src/modules/login/components/LogoutMain.vue b/src/modules/login/components/LogoutMain.vue index 5bcb33c4f5f9f2fa8144e215f21acd9be86821a6..46d710b853c0979bbb7c0584f5d48f0e2395b62b 100644 --- a/src/modules/login/components/LogoutMain.vue +++ b/src/modules/login/components/LogoutMain.vue @@ -5,36 +5,10 @@ {{ $t("page.logout.title") }} </b-card-title> - <!-- Buttons --> + <!-- Logout Message & Login Button --> <div class="v_gapped_container"> - <!-- ORCiD Logout Button --> - <b-button - v-if="isLoggedInWithOrcid" - variant="primary" - @click.prevent="logOutFromOrcid" - > - <b-img - class="d-inline mr-1" - alt="ORCID logo" - src="https://info.orcid.org/wp-content/uploads/2019/11/orcid_24x24.png" - /> - <span>{{ $t("page.logout.button_orcid") }}</span> - </b-button> - - <!-- Shibboleth Logout Button --> - <b-button - v-if="isLoggedInWithShibboleth" - variant="primary" - @click="logOutFromShibboleth" - > - {{ $t("page.logout.button_shibboleth") }} - </b-button> - <!-- Logout Success --> - <b-card-body - v-if="!isLoggedInWithOrcid && !isLoggedInWithShibboleth" - class="h6 text-primary text-center" - > + <b-card-body v-if="isLoggedOut" class="h6 text-primary text-center"> {{ $t("page.logout.success") }} </b-card-body> @@ -48,7 +22,6 @@ <script lang="ts"> import { defineComponent } from "vue"; -import type { DFNAAIInstitution } from "../types"; import "@/plugins/deprecated/vue-multiselect"; // import the store for current module @@ -63,41 +36,17 @@ export default defineComponent({ return { loginStore }; }, - data() { - return { - isLoggedInWithOrcid: null as boolean | null, - }; - }, - computed: { - isLoggedInWithShibboleth(): boolean | null { - const query = this.$route.query["loggedInWithShibboleth"]; + isLoggedOut(): boolean | null { + const query = this.$route.query["logout"]; if (query) { return Boolean(JSON.parse(query as string)); } return null; }, - selectedInstitution(): DFNAAIInstitution | null { - return this.loginStore.selectedInstitution; - }, - }, - - async created() { - this.isLoggedInWithOrcid = await this.loginStore.getOrcidLoginStatus(); }, methods: { - async logOutFromOrcid() { - // Set the parameter logUserOut = true - await this.loginStore.getOrcidLoginStatus(true); - }, - - logOutFromShibboleth() { - if (this.selectedInstitution) { - this.loginStore.logoutFromShibboleth(this.selectedInstitution); - } - }, - logBackIn() { this.$router.push({ name: "login" }); }, diff --git a/src/modules/login/i18n/de.ts b/src/modules/login/i18n/de.ts index 18e5027ac8acfef8703ef7877c0f16f7ae0058e1..31007c94a2d363a320245d95b290eeca183ea8f4 100644 --- a/src/modules/login/i18n/de.ts +++ b/src/modules/login/i18n/de.ts @@ -41,8 +41,6 @@ export default { title: "Ausloggen", success: "Sie wurden erfolgreich ausgeloggt", log_in: "Wiederholt einloggen", - button_orcid: "Von ORCiD ausloggen", - button_shibboleth: "Von Shibboleth ausloggen", }, tos: { diff --git a/src/modules/login/i18n/en.ts b/src/modules/login/i18n/en.ts index 9642bf7da0ff9427adf1dade495c278f4e696d69..5f4274fd266a81281721b6b7c4203956b96c2404 100644 --- a/src/modules/login/i18n/en.ts +++ b/src/modules/login/i18n/en.ts @@ -41,8 +41,6 @@ export default { title: "Logout", success: "You have been successfully logged out", log_in: "Log back in", - button_orcid: "Logout from ORCiD", - button_shibboleth: "Logout from Shibboleth", }, tos: { diff --git a/src/modules/search/pages/Search.vue b/src/modules/search/pages/Search.vue index fa662c2f7d672d4d3d82fedca796a01e1247ae2b..31dd300c0f0113ab186caf925d228d97fb329e35 100644 --- a/src/modules/search/pages/Search.vue +++ b/src/modules/search/pages/Search.vue @@ -28,7 +28,9 @@ <b-form-select v-model="selectedProject" :options="allProjectsOptions" - @change="queryData(searchText, selectedPage, paginationPageSize)" + @change=" + queryData(searchText, selectedPage, paginationPageSize) + " > <template #first> <b-form-select-option :value="null"> @@ -41,7 +43,9 @@ <b-form-select v-model="selectedResource" :options="projectResourcesOptions" - @change="queryData(searchText, selectedPage, paginationPageSize)" + @change=" + queryData(searchText, selectedPage, paginationPageSize) + " > <template #first> <b-form-select-option :value="null"> @@ -56,7 +60,9 @@ id="searchButton" variant="primary" :disabled="resultsViewLoading" - @click="queryData(searchText, selectedPage, paginationPageSize)" + @click=" + queryData(searchText, selectedPage, paginationPageSize) + " > {{ $t("page.search.search") }} <b-spinner v-if="resultsViewLoading" variant="secondary" /> @@ -161,7 +167,9 @@ <!-- Show footer if there are results and only on the last page --> <div v-if=" - foot.items.length > 0 && pagination && !pagination.HasNext + foot.items.length > 0 && + pagination && + !pagination.HasNext " class="p-2 text-center text-muted border-top" > @@ -244,10 +252,10 @@ export default defineComponent({ resultsViewFields: ["type"], resultsViewLoading: true, - + paginationPerPageOptions: [5, 10, 20, 50], selectedPage: 1, - paginationPageSize: 10 + paginationPageSize: 10, }; }, @@ -290,7 +298,7 @@ export default defineComponent({ }); }, paginationTotalRows(): number { - if(this.searchStore.pagination?.TotalCount){ + if (this.searchStore.pagination?.TotalCount) { return this.searchStore.pagination.TotalCount; } else return 0; }, @@ -301,9 +309,7 @@ export default defineComponent({ const result: ItemSearchResult[] = []; if (this.searchResults) { result.push( - ...this.searchResults.filter((item) => - this.isFilteredItem(item) - ) + ...this.searchResults.filter((item) => this.isFilteredItem(item)) ); } return result; @@ -315,7 +321,11 @@ export default defineComponent({ watch: { searchText() { - this.queryData(this.searchText, this.selectedPage, this.paginationPageSize); + this.queryData( + this.searchText, + this.selectedPage, + this.paginationPageSize + ); }, selectedProject() { @@ -330,13 +340,21 @@ export default defineComponent({ // resultsForTable() { // this.assignResultsFilter(); // }, - + selectedPage() { - this.queryData(this.searchText, this.selectedPage, this.paginationPageSize); + this.queryData( + this.searchText, + this.selectedPage, + this.paginationPageSize + ); }, - + paginationPageSize() { - this.queryData(this.searchText, this.selectedPage, this.paginationPageSize); + this.queryData( + this.searchText, + this.selectedPage, + this.paginationPageSize + ); }, }, @@ -375,7 +393,12 @@ export default defineComponent({ this.resultsViewLoading = true; // attach search query, resulting in "/search?q=<searchTerm>" this.$router.push({ name: "search", query: { q: query } }); - await this.searchStore.retrieveSearchResults(query, pageNumber, pageSize, this.selectedProject); + await this.searchStore.retrieveSearchResults( + query, + pageNumber, + pageSize, + this.selectedProject + ); this.resultsViewLoading = false; }, async retrieveResources() { @@ -397,13 +420,13 @@ export default defineComponent({ this.projectSubProjects = []; } }, - assignResultsFilter(content: ItemSearchResult[] | null = null) { - if (content) { - this.filteredResults = content; - } else { - this.filteredResults = this.resultsForTable; - } - }, + assignResultsFilter(content: ItemSearchResult[] | null = null) { + if (content) { + this.filteredResults = content; + } else { + this.filteredResults = this.resultsForTable; + } + }, }, }); </script> diff --git a/src/modules/search/store.ts b/src/modules/search/store.ts index e09952677d6e71f559b553d46be90aff67502880..67c9092c20ced5dc3328fdd45dab19ea19a4fd6d 100644 --- a/src/modules/search/store.ts +++ b/src/modules/search/store.ts @@ -20,7 +20,7 @@ export const useSearchStore = defineStore({ */ state: (): SearchState => ({ searchResults: null, - pagination: null + pagination: null, }), /* @@ -56,12 +56,19 @@ export const useSearchStore = defineStore({ if (projectObject && projectObject.id) { adaptedQuery = `(${adaptedQuery}) + (belongsToProject: "https://purl.org/coscine/projects/${projectObject.id}")`; } - const response = await SearchApi.searchSearch(adaptedQuery, undefined, undefined, undefined, pageNumber, pageSize); - - if(response.headers["x-pagination"]){ + const response = await SearchApi.searchSearch( + adaptedQuery, + undefined, + undefined, + undefined, + pageNumber, + pageSize + ); + + if (response.headers["x-pagination"]) { this.pagination = JSON.parse(response.headers["x-pagination"]); } - + this.searchResults = response.data; return true; } catch (error) {