Skip to content

Commit

Permalink
feat: APPS-2904 (#857)
Browse files Browse the repository at this point in the history
* add commit to move to a different branch

* feat: Fix draft previews

* fix: package lock
  • Loading branch information
pghorpade authored Sep 27, 2024
1 parent 9884827 commit 1491fa6
Show file tree
Hide file tree
Showing 7 changed files with 1,537 additions and 1,663 deletions.
5 changes: 2 additions & 3 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLayoutState } from './composables/useLayoutState'
provide('theme', computed(() => ''))
const { enabled, state } = usePreviewMode()
// console.log('App.vue', enabled.value, state.token)
console.log('App.vue', enabled.value, state.token)
const route = useRoute()
const globalStore = useGlobalStore()
Expand Down Expand Up @@ -40,6 +40,7 @@ const { $alerts } = useNuxtApp()
const { $layoutData } = useNuxtApp()
watch(globalStore.header, (newVal, oldVal) => {
console.log('Global store changed for draft previews', newVal, oldVal)
setLayoutData(globalStore)
})
onMounted(async () => {
Expand All @@ -48,8 +49,6 @@ onMounted(async () => {
if (process.env.NODE_ENV !== 'development' && (route.query?.preview === 'true' || enabled.value) && (route.query?.token !== undefined || state?.token !== undefined)) {
await $layoutData()
}
classes.value.push({ 'has-scrolled': globalStore.sTop })
classes.value.push({ 'has-scrolled-past-header': globalStore.sTop >= 150 })
await $alerts()
})
Expand Down
7 changes: 3 additions & 4 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// components need to be imported for nitro crawling in static mode
import { HeaderSmart, SectionWrapper, SiteNotificationAlert, FooterPrimary, FooterSock } from 'ucla-library-website-components'
provide('theme', computed(() => ''))
const shouldIncludeExtraScript = computed(() => {
if (useRuntimeConfig().public.hostName.includes('stage'))
return true
Expand Down Expand Up @@ -40,7 +41,7 @@ useHead({
: [])
]
})
const { enabled, state } = usePreviewMode()
const layoutCustomProps = useAttrs()
const globalStore = useGlobalStore()
// console.log('In default layout:', globalStore.header)
Expand Down Expand Up @@ -80,7 +81,7 @@ watch(globalStore.header, (newVal, oldVal) => {
})
onMounted(async () => {
// console.log('onMounted in Default layout')
console.log('In default layout', enabled.value, state?.token)
/* document.addEventListener('visibilitychange', async () => {
if (document.visibilityState === 'visible') {
const data = await $graphql.default.request(Globals)
Expand All @@ -102,8 +103,6 @@ onMounted(async () => {
console.log('In SSG refresh layout data as state is not maintained after an error response')
await $layoutData()
}
classes.value.push({ 'has-scrolled': globalStore.sTop })
classes.value.push({ 'has-scrolled-past-header': globalStore.sTop >= 150 })
await $alerts()
})
</script>
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"lint": "eslint . --ext .vue,.js,.ts --ignore-path .gitignore",
"lint:fix": "eslint --fix . --ext .vue,.js,.ts --ignore-path .gitignore",
"typecheck": "nuxi typecheck",
"test": "pnpm lint && pnpm typecheck",
"library": ""
"test": "pnpm lint && pnpm typecheck"
},
"dependencies": {
"@nuxtjs/sitemap": "^5.1.1",
Expand All @@ -41,6 +40,6 @@
"nuxt-graphql-request": "^7.0.5",
"sass": "^1.66.1",
"ucla-library-design-tokens": "^5.22.0",
"ucla-library-website-components": "^3.14.1"
"ucla-library-website-components": "^3.24.0"
}
}
27 changes: 0 additions & 27 deletions plugins/browser-events.client.js

This file was deleted.

23 changes: 0 additions & 23 deletions plugins/getScrollInfo.client.js

This file was deleted.

Loading

8 comments on commit 1491fa6

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66f73272a708be00cd520c5f--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66f7bb683f3aa47d78b707b6--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66f863e61465ed4e72106d86--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66f90d046d45dce7dafff722--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66f9b56751839c5bf53f3f87--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66fa5ec864540afabe1f2820--uclalibrary.netlify.app

@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.

πŸŽ‰ Published on https://www.library.ucla.edu as production
πŸš€ Deployed on https://66fb06e459784a249307d65f--uclalibrary.netlify.app

Please sign in to comment.