Skip to content

Commit

Permalink
feat: update impact report story category and external news uri on si…
Browse files Browse the repository at this point in the history
…te search results (#866)
  • Loading branch information
pghorpade authored Nov 6, 2024
1 parent b900cba commit 597b627
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 218 deletions.
5 changes: 4 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
export default defineNuxtConfig({
// debug: true,
sourcemap: true,

// General stuff
future: {
compatibilityVersion: 4,
},
devtools: {
enabled: true,
timeline: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"nuxt-graphql-request": "^7.0.5",
"sass": "^1.66.1",
"ucla-library-design-tokens": "^5.27.0",
"ucla-library-website-components": "^3.31.0"
"ucla-library-website-components": "^3.32.0"
},
"engines": {
"pnpm": "^9.12.1"
Expand Down
15 changes: 14 additions & 1 deletion pages/search-site/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// COMPONENTS
import { MastheadSecondary, SearchGeneric, SectionWrapper, DividerWayFinder, RichText, SectionCardsWithIllustrations, SearchResult, SectionPagination } from 'ucla-library-website-components'
// HELPERS
import _get from 'lodash/get'
// UTILITIES
import config from '../utils/searchConfig'
import queryFilterHasValues from '../utils/queryFilterHasValues'
Expand Down Expand Up @@ -109,7 +112,17 @@ const parsedSearchResults = computed(() => {
...obj._source,
to: obj._source.uri ? obj._source.uri : obj._source.to,
}
} else {
} else if (obj._source.externalResourceUrl != null) {
return {
...obj._source,
to: obj._source.externalResourceUrl != null
? _get(obj._source, 'externalResourceUrl', '')
: obj._source.uri
? `/${obj._source.uri}`
: `/${obj._source.to}`,
}
}
else {
return {
...obj._source,
to: obj._source.uri
Expand Down
13 changes: 8 additions & 5 deletions plugins/update-library-alert.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ export default defineNuxtPlugin((nuxtApp) => { //
const globalStore = useGlobalStore()
// console.log('Nuxt plugin client side called from Default layout')
const alerts = async () => {
// console.log('Nuxt plugin ready to call graphQL API in Default layout')
const response = await $fetch('https://libguides-proxy.library.ucla.edu/api/libguides/global/proxy')
try {
// console.log('Nuxt plugin ready to call graphQL API in Default layout')
const response = await $fetch('https://libguides-proxy.library.ucla.edu/api/libguides/global/proxy')

// console.log('Pinia store Global Data object:' + JSON.stringify(data))
if (response) {
globalStore.globals.libraryAlert = response.libraryAlert
if (response) {
globalStore.globals.libraryAlert = response.libraryAlert
}
} catch (error) {
console.error('Error fetching alerts:', error)
}
}
return {
Expand Down
Loading

6 comments on commit 597b627

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.