-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for generating full static site #315
Changes from all commits
afd0846
3fc4a62
dd801ce
1c3464d
fd5556c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,8 +152,6 @@ | |
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
|
||
import i18n from '@/i18n/conference/speeches.i18n' | ||
|
||
import I18nPageWrapper from '@/components/core/i18n/PageWrapper' | ||
|
@@ -184,6 +182,19 @@ export default { | |
MarkdownRenderer, | ||
RelatedCardCollection, | ||
}, | ||
async asyncData({ store, params, payload }) { | ||
if (payload && Object.keys(payload).length !== 0) { | ||
return { | ||
speechData: payload, | ||
} | ||
} | ||
await store.dispatch('$getSpeechData', { | ||
eventType: params.eventType, | ||
eventId: params.id, | ||
Comment on lines
+192
to
+193
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eventType: params?.eventType,
eventId: params?.id, |
||
}) | ||
const speechData = store.state.speechData | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return { speechData } | ||
}, | ||
data() { | ||
return { | ||
eventType: '', | ||
|
@@ -209,14 +220,7 @@ export default { | |
}, | ||
} | ||
}, | ||
computed: { | ||
...mapState(['speechData']), | ||
}, | ||
async created() { | ||
await this.$store.dispatch('$getSpeechData', { | ||
eventType: this.$route.params.eventType, | ||
eventId: this.$route.params.id, | ||
}) | ||
await this.processData() | ||
this.$root.$emit('initTabs') | ||
await this.$store.dispatch('$getRelatedData', this.data.category) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,16 +73,23 @@ export default { | |
SpeechCardCollection, | ||
Banner, | ||
}, | ||
asyncData({ redirect, params }) { | ||
async asyncData({ redirect, params, store }) { | ||
const eventType = params.eventType | ||
if (!['talks', 'tutorials'].includes(eventType)) { | ||
redirect('/') | ||
} | ||
await store.dispatch('$getSpeechesData', eventType) | ||
const speechesData = store.state.speechesData.map((speech) => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const speechesData = store.state?.speechesData.map((speech) => ({ |
||
...speech, | ||
begin_time: speech.begin_time ? new Date(speech.begin_time) : null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
})) | ||
return { | ||
speechesData, | ||
eventType, | ||
} | ||
}, | ||
data() { | ||
return { | ||
eventType: '', | ||
speechesData: [], | ||
checkedCategories: [], | ||
aboutBanner: AboutBanner, | ||
} | ||
|
@@ -133,14 +140,6 @@ export default { | |
return false | ||
}, | ||
}, | ||
async mounted() { | ||
this.eventType = this.$route.params.eventType | ||
await this.$store.dispatch('$getSpeechesData', this.eventType) | ||
this.speechesData = this.$store.state.speechesData.map((speech) => ({ | ||
...speech, | ||
begin_time: speech.begin_time ? new Date(speech.begin_time) : null, | ||
})) | ||
}, | ||
methods: { | ||
metaInfo() { | ||
return { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,17 @@ export default { | |
GithubIcon, | ||
TwitterIcon, | ||
}, | ||
async asyncData({ store, app }) { | ||
await store.dispatch('$getKeynotesData') | ||
|
||
const keynotesData = store.state.keynotesData.map((keynote) => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const keynotesData = store.state?.keynotesData.map((keynote) => ({ |
||
...keynote, | ||
id: app.$makeId(), | ||
})) | ||
return { | ||
keynotesData, | ||
} | ||
}, | ||
data() { | ||
return { | ||
keynotesData: [], | ||
|
@@ -159,13 +170,6 @@ export default { | |
} | ||
}, | ||
}, | ||
async mounted() { | ||
await this.$store.dispatch('$getKeynotesData') | ||
this.keynotesData = this.$store.state.keynotesData.map((keynote) => ({ | ||
...keynote, | ||
id: this.$makeId(), | ||
})) | ||
}, | ||
methods: { | ||
getKeynoteId(keynote) { | ||
return keynote.speaker.name_en_us | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,19 +39,24 @@ export default { | |
JobsCardCollection, | ||
JobsPanel, | ||
}, | ||
async asyncData({ store, app }) { | ||
await store.dispatch('$getJobsData') | ||
const jobsData = store.state.jobsData.map((sponsor) => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const jobsData = store.state?.jobsData.map((sponsor) => ({ |
||
...sponsor, | ||
id: app.$makeId(), | ||
})) | ||
return { | ||
jobsData, | ||
} | ||
}, | ||
data() { | ||
return { | ||
selectedSponsor: {}, | ||
jobsData: [], | ||
pivot: 0, | ||
} | ||
}, | ||
async mounted() { | ||
await this.$store.dispatch('$getJobsData') | ||
this.jobsData = this.$store.state.jobsData.map((sponsor) => ({ | ||
...sponsor, | ||
id: this.$makeId(), | ||
})) | ||
mounted() { | ||
this.setSelectedSponsor(this.jobsData[0]) | ||
this.setPivot() | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,6 @@ | |
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
import i18n from '@/i18n/index.i18n' | ||
import I18nPageWrapper from '@/components/core/i18n/PageWrapper' | ||
import TextButton from '~/components/core/buttons/TextButton' | ||
|
@@ -120,6 +119,13 @@ export default { | |
I18nPageWrapper, | ||
Intro, | ||
}, | ||
async asyncData({ store }) { | ||
await store.dispatch('$getSponsorsData') | ||
const sponsorsData = store.state.sponsorsData | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const sponsorsData = store.state?.sponsorsData |
||
return { | ||
sponsorsData, | ||
} | ||
}, | ||
data() { | ||
return { | ||
isOpened: false, | ||
|
@@ -129,7 +135,6 @@ export default { | |
}, | ||
fetchOnServer: false, | ||
computed: { | ||
...mapState(['sponsorsData']), | ||
isBulleted() { | ||
if (process.client) { | ||
const width = window.innerWidth | ||
|
@@ -140,9 +145,6 @@ export default { | |
return true | ||
}, | ||
}, | ||
created() { | ||
this.$store.dispatch('$getSponsorsData') | ||
}, | ||
methods: { | ||
showModal(sponsor) { | ||
this.isOpened = true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.