-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- eslint-disable vue/no-parsing-error --> | ||
<template> | ||
<v-container> | ||
<h2 class="headline grey--text text--darken-3 font-weight-bold mt-6 mb-4"> | ||
Plan du site | ||
</h2> | ||
<v-list> | ||
<v-list-item | ||
v-for="page in sitemap" | ||
:key="page.to" | ||
:to="page.to" | ||
class="primary--text" | ||
> | ||
{{ page.title }} | ||
</v-list-item> | ||
</v-list> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import { mapState, mapGetters } from 'vuex' | ||
|
||
export default { | ||
middleware: 'portal-required', | ||
async fetch () { | ||
const promises = [] | ||
if (!this.pages) promises.push(this.$store.dispatch('fetchPages')) | ||
if (!this.datasetsList) promises.push(this.$store.dispatch('fetchDatasetsList')) | ||
if (!this.applicationsList) promises.push(this.$store.dispatch('fetchApplicationsList')) | ||
if (promises.length) await Promise.all(promises) | ||
}, | ||
head () { | ||
const title = 'Plan du site - ' + this.config.title | ||
return { | ||
title, | ||
meta: [ | ||
{ hid: 'og:url', property: 'og:url', content: this.publicUrl + '/sitemap' }, | ||
{ hid: 'og:title', property: 'og:title', content: title }, | ||
{ hid: 'og:type', property: 'og:type', content: 'website' } | ||
] | ||
} | ||
}, | ||
computed: { | ||
...mapState(['publicUrl', 'config', 'pages', 'datasetsList', 'applicationsList']), | ||
...mapGetters(['sitemap']) | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
exports.description = 'Add default values to some new properties' | ||
|
||
exports.exec = async (db, debug) => { | ||
const defaultValues = [ | ||
['footerSitemap', false] | ||
] | ||
for (const defaultValue of defaultValues) { | ||
for (const configKey of ['config', 'configDraft']) { | ||
const res = await db.collection('portals').updateMany( | ||
{ [`${configKey}.${defaultValue[0]}`]: { $exists: false } }, | ||
{ $set: { [`${configKey}.${defaultValue[0]}`]: defaultValue[1] } } | ||
) | ||
debug(`${configKey}.${defaultValue[0]} = ${defaultValue[1]}`, res.result) | ||
} | ||
} | ||
} |