Skip to content

Commit

Permalink
integrating all page templates from www-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Jul 20, 2024
1 parent cf8f068 commit a5e6c5c
Show file tree
Hide file tree
Showing 69 changed files with 4,431 additions and 34 deletions.
4 changes: 3 additions & 1 deletion apps/vue-storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ const preview: Preview = {
'EDU'
],
'Mixins',
['Overview']
['Overview'],
'Templates',
['WWW', 'EDU']
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ export default {
excludeStories: /.*(Data)$/
}

export const BlockStreamfieldTruncatedData = {
body: [
BlockKeyPointsData,
BlockHeadingData,
{
blockType: 'RichTextBlock',
value:
'<p>Lorem ipsum <a href="/missions/test-mission/">dolor</a> sit amet, consectetur adipiscing elit. Quisque vitae justo quis justo malesuada molestie. Cras sed tincidunt dui.</p><p>Integer imperdiet blandit neque vitae euismod. Nulla aliquet lacus nibh, vel tincidunt urna efficitur non. In et eros vitae ex posuere maximus quis eget urna. Suspendisse fringilla posuere velit sit amet posuere. Morbi malesuada bibendum vehicula. Donec faucibus ut erat ut mattis. Suspendisse ornare, quam at placerat cursus, dolor mi lacinia nunc, eget maximus augue nulla in dolor.</p>\n'
},
BlockImageComparisonData,
BlockHeadingData,
{
blockType: 'RichTextBlock',
value:
'<p>Lorem ipsum <a href="/missions/test-mission/">dolor</a> sit amet, consectetur adipiscing elit. Quisque vitae justo quis justo malesuada molestie. Cras sed tincidunt dui.</p><p>Integer imperdiet blandit neque vitae euismod. Nulla aliquet lacus nibh, vel tincidunt urna efficitur non. In et eros vitae ex posuere maximus quis eget urna. Suspendisse fringilla posuere velit sit amet posuere. Morbi malesuada bibendum vehicula. Donec faucibus ut erat ut mattis. Suspendisse ornare, quam at placerat cursus, dolor mi lacinia nunc, eget maximus augue nulla in dolor.</p>\n'
},
BlockIframeEmbedData
]
}
export const BlockStreamfieldData = {
body: [
BlockKeyPointsData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import imagePlanetJupiter from '@explorer-1/common-storybook/src/images/mission-highlights-800h-at-jupiter.png'
import imagePlanetEarth from '@explorer-1/common-storybook/src/images/mission-highlights-800h-earth-orbiting-on-earth.png'
import imageMoon from '@explorer-1/common-storybook/src/images/mission-highlights-800h-earths-moon.png'
import imageInterstellar from '@explorer-1/common-storybook/src/images/mission-highlights-800h-interstellar.jpg'
import imagePlanetMarsA from '@explorer-1/common-storybook/src/images/mission-highlights-800h-mars-orbiting.png'
import imagePlanetJupiter from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-at-jupiter.png'
import imagePlanetEarth from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-earth-orbiting-on-earth.png'
import imageMoon from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-earths-moon.png'
import imageInterstellar from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-interstellar.jpg'
import imagePlanetMarsA from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-mars-orbiting.png'
import HomepageMissionsCarousel from './HomepageMissionsCarousel.vue'
import HomepageMissionsCarouselItem from './HomepageMissionsCarouselItem.vue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import imageBgEarth from '@explorer-1/common-storybook/src/images/bg-earth-1440x810.jpg'
import imageBgPlanet from '@explorer-1/common-storybook/src/images/bg-planet-1440x810.jpg'
import imageBgStars from '@explorer-1/common-storybook/src/images/bg-stars-1440x810.jpg'
import imageInstrumentCuberrt from '@explorer-1/common-storybook/src/images/mission-cuberrt.png'
import imageInstrumentEcostress from '@explorer-1/common-storybook/src/images/mission-ecostress.png'
import imageInstrumentJason3 from '@explorer-1/common-storybook/src/images/mission-jason3.png'
import imageInstrumentOco2 from '@explorer-1/common-storybook/src/images/mission-oco2.png'
import imageInstrumentCuberrtWebP from '@explorer-1/common-storybook/src/images/mission-cuberrt.webp'
import imageInstrumentEcostressWebP from '@explorer-1/common-storybook/src/images/mission-ecostress.webp'
import imageInstrumentJason3WebP from '@explorer-1/common-storybook/src/images/mission-jason3.webp'
import imageInstrumentOco2WebP from '@explorer-1/common-storybook/src/images/mission-oco2.webp'
import imageBgEarth from '@explorer-1/common-storybook/src/public/images/bg-earth-1440x810.jpg'
import imageBgPlanet from '@explorer-1/common-storybook/src/public/images/bg-planet-1440x810.jpg'
import imageBgStars from '@explorer-1/common-storybook/src/public/images/bg-stars-1440x810.jpg'
import imageInstrumentCuberrt from '@explorer-1/common-storybook/src/public/images/mission-cuberrt.png'
import imageInstrumentEcostress from '@explorer-1/common-storybook/src/public/images/mission-ecostress.png'
import imageInstrumentJason3 from '@explorer-1/common-storybook/src/public/images/mission-jason3.png'
import imageInstrumentOco2 from '@explorer-1/common-storybook/src/public/images/mission-oco2.png'
import imageInstrumentCuberrtWebP from '@explorer-1/common-storybook/src/public/images/mission-cuberrt.webp'
import imageInstrumentEcostressWebP from '@explorer-1/common-storybook/src/public/images/mission-ecostress.webp'
import imageInstrumentJason3WebP from '@explorer-1/common-storybook/src/public/images/mission-jason3.webp'
import imageInstrumentOco2WebP from '@explorer-1/common-storybook/src/public/images/mission-oco2.webp'

import MissionDetailHero from './MissionDetailHero.vue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import imagePlanetJupiter from '@explorer-1/common-storybook/src/images/mission-highlights-800h-at-jupiter.png'
import imagePlanetEarth from '@explorer-1/common-storybook/src/images/mission-highlights-800h-earth-orbiting-on-earth.png'
import imageMoon from '@explorer-1/common-storybook/src/images/mission-highlights-800h-earths-moon.png'
import imageInterstellar from '@explorer-1/common-storybook/src/images/mission-highlights-800h-interstellar.jpg'
import imagePlanetMarsA from '@explorer-1/common-storybook/src/images/mission-highlights-800h-mars-orbiting.png'
import imagePlanetMarsB from '@explorer-1/common-storybook/src/images/mission-highlights-800h-on-mars.png'
import imagePlanetJupiter from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-at-jupiter.png'
import imagePlanetEarth from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-earth-orbiting-on-earth.png'
import imageMoon from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-earths-moon.png'
import imageInterstellar from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-interstellar.jpg'
import imagePlanetMarsA from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-mars-orbiting.png'
import imagePlanetMarsB from '@explorer-1/common-storybook/src/public/images/mission-highlights-800h-on-mars.png'

import MissionDetailHighlights from './MissionDetailHighlights.vue'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import NavDesktopDropdownMore from './../NavDesktop/NavDesktopDropdownMore.vue'
export default {
title: 'Navigation/Headers/EDU/NavDesktopEdu',
component: NavDesktop,
tags: ['!autodocs'],
excludeStories: /.*Data$/,
parameters: {
viewMode: 'canvas'
viewMode: 'canvas',
layout: 'fullscreen'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import NavMobile from './NavMobile.vue'
export default {
title: 'Navigation/Headers/EDU/NavMobile',
component: NavMobile,
tags: ['!autodocs'],
excludeStories: /.*Data$/,
parameters: {
viewMode: 'canvas',
layout: 'fullscreen',
viewport: {
defaultViewport: 'mobile2'
},
Expand Down
20 changes: 20 additions & 0 deletions packages/vue/src/store/curatedGallery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineStore } from 'pinia'
/** Stores the state of user preferences on curated gallery detail pages
*/

export interface State {
showGridView?: boolean
}

export const useCuratedGalleryStore = defineStore('curatedGallery', {
state: (): State => {
return {
showGridView: undefined
}
},
actions: {
updateView(value: boolean) {
this.showGridView = value
}
}
})
41 changes: 41 additions & 0 deletions packages/vue/src/store/search.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineStore } from 'pinia'
/** Stores the state of various user preferences on listing and search pages
*/

export interface SearchState {
showSidebar: boolean | undefined
showGridView: boolean | undefined
showSidebarForGalleries: boolean | undefined
showGridViewForGalleries: boolean | undefined
showGridViewForPodcasts: boolean | undefined
}

export const useSearchStore = defineStore('search', {
state: (): SearchState => {
return {
showSidebar: undefined,
showGridView: undefined,
showSidebarForGalleries: undefined,
showGridViewForGalleries: undefined,
showGridViewForPodcasts: undefined
}
},
actions: {
updateSidebar(value: boolean) {
this.showSidebar = value
},
updateGridView(value: boolean) {
this.showGridView = value
},
updateSidebarForGalleries(value: boolean) {
this.showSidebarForGalleries = value
},
updateGridViewForGalleries(value: boolean) {
this.showGridViewForGalleries = value
},
updateGridViewForPodcasts(value: boolean) {
this.showGridViewForPodcasts = value
}
},
persist: true
})
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
html: {
root: '#storyDecorator'
},
viewMode: 'canvas'
layout: 'fullscreen'
},
excludeStories: /.*(Data)$/
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
html: {
root: '#storyDecorator'
},
viewMode: 'canvas'
layout: 'fullscreen'
},
excludeStories: /.*Data$/
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HeroMediaData } from './../../components/HeroMedia/HeroMedia.stories'
import { DetailHeadlineData } from './../../components/DetailHeadline/DetailHeadline.stories'
import { BlockStreamfieldData } from './../../components/BlockStreamfield/BlockStreamfield.stories'
import { BlockStreamfieldTruncatedData } from './../../components/BlockStreamfield/BlockStreamfield.stories'
import {
BlockLinkCardCarouselData,
BlockLinkTileCarouselData
Expand All @@ -21,6 +21,7 @@ export default {
})
],
parameters: {
layout: 'fullscreen',
html: {
root: '#storyDecorator'
}
Expand Down Expand Up @@ -53,7 +54,7 @@ export const BaseStory = {
blockType: 'HeroImageBlock'
}
],
...BlockStreamfieldData,
...BlockStreamfieldTruncatedData,
releaseNumber: '2020-157',
relatedLinks: [BlockRelatedLinksData.data],
mediaContacts: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
v-if="data"
class="ThemeLight"
class="ThemeVariantLight"
:class="computedClass"
itemscope
itemtype="http://schema.org/Article"
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/templates/edu/PageContentEdu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PageContent from './../PageContent/PageContent.vue'
export default {
title: 'Templates/EDU/PageContent',
component: PageContent,
tags: ['!autodocs'],
decorators: [
() => ({
template: `<div id="storyDecorator" class="ThemeEdu"><story/></div>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { HeroMediaData } from './../../components/HeroMedia/HeroMedia.stories'
import { BlockStreamfieldData } from './../../components/BlockStreamfield/BlockStreamfield.stories'
import { HeroMediaData } from './../../../components/HeroMedia/HeroMedia.stories'
import { BlockStreamfieldTruncatedData } from './../../../components/BlockStreamfield/BlockStreamfield.stories'
import PageEduNewsDetail from './PageEduNewsDetail.vue'

export default {
title: 'Templates/EDU/PageEduNewsDetail',
component: PageEduNewsDetail,
tags: ['!autodocs'],
decorators: [
() => ({
template: `<div id="storyDecorator" class="disable-nav-offset"><story/></div>`
})
],
parameters: {
layout: 'fullscreen',
html: {
root: '#storyDecorator'
},
Expand Down Expand Up @@ -45,7 +47,7 @@ export const BaseStory = {
heroPosition: 'full_bleed',
heroImage: HeroMediaData.image,
heroImageInline: HeroMediaData.imageInline,
...BlockStreamfieldData
...BlockStreamfieldTruncatedData
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import isEmpty from 'lodash/isEmpty.js'
import type { StreamfieldBlockData } from '../../components/BlockStreamfield/BlockStreamfield.vue'
import type { StreamfieldBlockData } from '../../../components/BlockStreamfield/BlockStreamfield.vue'
import type {
ImageObject,
PageResponseObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { HeroMediaData } from './../../../components/HeroMedia/HeroMedia.stories'
import { AsteroidWatchWidgetData } from './../../../components/AsteroidWatchWidget/AsteroidWatchWidget.stories'
import PageAsteroidWatchContent from './PageAsteroidWatchContent.vue'

export default {
title: 'Templates/WWW/PageAsteroidWatchContent',
component: PageAsteroidWatchContent,
decorators: [
() => ({
template: `<div id="storyDecorator" class="disable-nav-offset"><story/></div>`
})
],
tags: ['!autodocs'],
parameters: {
layout: 'fullscreen',
html: {
root: '#storyDecorator'
},
viewMode: 'canvas'
},
excludeStories: /.*(Data)$/
}

// data
export const PageAsteroidWatchContentData = {
url: '/asteroid-watch/next-five-approaches',
slug: 'next-five-approaches',
breadcrumb:
'[{"path": "/parent/", "title": "Overview"}, {"path": "/parent/placeholder-1/", "title": "Sibling Item 1"}, {"path": "/parent/placeholder-2/", "title": "Sibling Item 2"}, {"path": "/parent/placeholder-3/", "title": "Sibling Item 3"}]',
title: 'Next Five approaches',
label: 'Asteroid Watch',
heroImage: HeroMediaData.image,
nextCloseApproaches: AsteroidWatchWidgetData.nextCloseApproaches,
body: [
{
blockType: 'RichTextBlock',
value: `<p>The Asteroid Watch dashboard tracks asteroids and comets that will make relatively close approaches to Earth. The dashboard displays the date of closest approach, approximate object diameter, relative size and distance from Earth for each encounter. The object's name is displayed by hovering over its encounter date. Clicking on the encounter date will display a Web page with details about that object.</p>`
}
]
}

// template
const PageAsteroidWatchContentTemplate = (args) => ({
props: Object.keys(args),
components: { PageAsteroidWatchContent },
template: `<PageAsteroidWatchContent :data="contentPage"/>`
})

// stories
export const BaseStory = {
name: 'PageAsteroidWatchContent',
args: {
data: PageAsteroidWatchContentData
}
}
Loading

0 comments on commit a5e6c5c

Please sign in to comment.