Skip to content

Commit

Permalink
Merge branch '137-pre-release-changes' of https://github.com/ejp-rd-v…
Browse files Browse the repository at this point in the history
…p/vp-dp-frontend into 138-unused-filters-shouldnt-be-sent-to-beacon-services
  • Loading branch information
LarieSB committed Aug 15, 2024
2 parents ae7d78b + 6213d58 commit d810c98
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
12 changes: 6 additions & 6 deletions components/dialogs/AcceptFunctionalCookiesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export default {
return {
dialog: true,
usedCookies: [
'auth._refresh_token.keycloak',
'auth._refresh_token_expiration.keycloak',
'auth._token.keycloak',
'auth._token_expiration.keycloak',
'auth.keycloak.pkce_state',
'auth.strategy',
// 'auth._refresh_token.keycloak',
// 'auth._refresh_token_expiration.keycloak',
// 'auth._token.keycloak',
// 'auth._token_expiration.keycloak',
// 'auth.keycloak.pkce_state',
// 'auth.strategy',
'cookiesAccepted'
]
}
Expand Down
8 changes: 7 additions & 1 deletion components/search/DiscoverySearchResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default {
if(!this.loggedIn) {
this.searchParams = this.discardFiltersNeedingAuthorization(this.searchParams)
}
console.log('Query sent to backend:', JSON.stringify(this.searchParams,null, 2)); // Log the query parameters before the request
this.$axios.$get('/api/v1/search',
{ params: this.searchParams, paramsSerializer (params) { return Common.paramsSerializer(params) } })
.then(function (res) {
Expand Down Expand Up @@ -106,8 +107,13 @@ export default {
//final solution
const data = '{ "url": "https://vp.ejprarediseases.org/", "humanReadable": "", "resources": [' + idObjects.substring(0,idObjects.length-1) + '] }';
// Create headers object
const headers = {};
if (this.loggedIn) {
headers['Authorization'] = `Bearer ${this.auth.user.token }`; // 'auth.user.token' contains the token for the logged-in user
}
this.$axios.$post(url, JSON.parse(data))
this.$axios.$post(url, JSON.parse(data), { headers })
.then(response => {
this.negotiatorRedirectUrl = response.redirectUrl;
//console.log(this.negotiatorUrl)
Expand Down
10 changes: 10 additions & 0 deletions components/search/SuggestedCodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
this.relatedCodes = []
for (let orphaCode of this.currentOrphaCodes) {
this.hierarchyParams.orphaCode = orphaCode
console.log('Query Parameters:', JSON.stringify(this.hierarchyParams.orphaCode, null, 2)); // Log the query parameters before the request
this.$axios.$get('/api/v1/hierarchy',
{ params: this.hierarchyParams, paramsSerializer (params) { return Common.paramsSerializer(params) } })
.then(function (res) {
Expand All @@ -35,6 +36,7 @@ export default {
return result
})
this.relatedCodes.push(...res)
this.relatedCodes = this.removeDuplicates(this.relatedCodes);
this.relatedCodes = this.relatedCodes.filter(item => !this.currentOrphaCodes.includes(item.code))
}
this.loadingRelatedCodes = false
Expand All @@ -44,6 +46,14 @@ export default {
}.bind(this))
}
},
removeDuplicates(items) {
const seen = new Set();
return items.filter(item => {
const duplicate = seen.has(item.code);
seen.add(item.code);
return !duplicate;
});
},
emitCodeStatusChanged(orphaCode) {
if(this.selectedCodes.includes(orphaCode)) {
this.$emit('selectOrphaCode', orphaCode)
Expand Down

0 comments on commit d810c98

Please sign in to comment.