Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@
- Launch of nuxt-sections module migrated from vue-sections library

- Library updates needed after the backend fixes done on media #93


### v1.0.1 (23/5/2023)

---

- Bug fixes for the media content linking of configurable sections

- Support for cookie-universal-nuxt alias to dynamically read the alias used by the host project

- SEO metadata management #101

- New feature implementation of having default support for dynamic pages
50 changes: 46 additions & 4 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,29 @@ module.exports = async function (moduleOptions) {
"revertPageSuccess": "You have successfully reverted your page to how it is currently showing to your visitors",
"sectionRemoved": "Your section has been removed, save your page to display this change to your visitors",
"deleteSectionTypeError": "Couldn't delete section type: ",
"deleteSectionPageError": "Couldn't delete section page: ",
"authorizeError": "Couldn't authorize sections from ",
"unAuthorizeError": "Couldn't un-authorize sections from ",
"fillRequiredFields": "You must fill your required fields before submitting.",
"fillRequiredFields": "You must fill your required fields before submitting your data.",
"saveConfigSectionError": "We couldn't save your changes, try again later",
"changesPublished": "Your changes will be published when the page is saved.",
"sectionsNotLoadedCorrectly": "Some sections could not be loaded correctly, saving the page will delete these sections from your page, unless you are happy with the page you see now, do not save it",
"fieldNames": "Field names",
"field": "Field",
"exportSectionsLabel": "Export sections",
"importSectionsLabel": "Import sections",
"clickToCopy": "click to copy"
"clickToCopy": "click to copy",
"deletePage": "Delete page",
"delete-section-page": "Are you sure you want to delete this page ?",
"settingsSectionsLabel": "Page settings",
"pageTitle": "Title in english",
"pageTitleFr": "Title in french",
"pageSeoDesc": "SEO description in english",
"pageSeoDescFr": "SEO description in french",
"pageUrl": "Page path*",
"savePageSettings": "To save the metadata and the page url, you need to save your page",
"imageFieldValidation": "image field must be an array for section ",
"pagePathRequired": "Page path is required"
},
fr: {
"Add": "Ajouter une nouvelle section",
Expand Down Expand Up @@ -127,21 +139,41 @@ module.exports = async function (moduleOptions) {
"revertPageSuccess": "Vous avez rétabli avec succès votre page telle qu'elle s'affiche actuellement pour vos visiteurs",
"sectionRemoved": "Votre section a été supprimée, enregistrez votre page pour afficher ce changement à vos visiteurs",
"deleteSectionTypeError": "Impossible de supprimer le type de section: ",
"deleteSectionPageError": "Impossible de supprimer la page section: ",
"authorizeError": "Impossible d'autoriser les sections de ",
"unAuthorizeError": "Impossible d'annuler l'autorisation des sections de ",
"fillRequiredFields": "Vous devez remplir les champs obligatoires avant de soumettre.",
"fillRequiredFields": "Vous devez remplir les champs requis avant de soumettre vos données.",
"saveConfigSectionError": "Nous n'avons pas pu enregistrer vos modifications, réessayez plus tard",
"changesPublished": "Vos modifications seront publiées lorsque la page sera enregistrée.",
"sectionsNotLoadedCorrectly": "Certaines sections n'ont pas pu être chargées correctement, l'enregistrement de la page supprimera ces sections de votre page, à moins que vous ne soyez satisfait de la page que vous voyez maintenant, ne l'enregistrez pas",
"fieldNames": "Noms de champs",
"field": "Champ",
"exportSectionsLabel": "Exporter les sections",
"importSectionsLabel": "Importer les sections",
"clickToCopy": "cliquez pour copier"
"clickToCopy": "cliquez pour copier",
"deletePage": "Supprimer la page",
"delete-section-page": "Êtes vous sur de vouloir supprimer cette page ?",
"settingsSectionsLabel": "Page settings",
"pageTitle": "Titre en anglais",
"pageTitleFr": "Titre en français",
"pageSeoDesc": "Description SEO en anglais",
"pageSeoDescFr": "Description SEO en français",
"pageUrl": "Chemin de la page*",
"savePageSettings": "Pour sauver les metadatas et l'url de la page vous devez sauver la page",
"imageFieldValidation": "Le champ image doit être un tableau pour la section ",
"pagePathRequired": "Le chemin de la page est requis"
}
})
})

this.extendRoutes((routes, resolve) => {
routes.push({
name: 'dynamic-page',
path: `/:pageName`, // Customize the route path as per your requirements
component: resolve(__dirname, 'src/pages/_pageName.vue') // Adjust the component path based on your file structure
});
});

let options = {}

let isTailwindInstalled = false
Expand Down Expand Up @@ -175,6 +207,16 @@ module.exports = async function (moduleOptions) {
}
}

let cookiesAlias = 'cookies'
options['cookiesAlias'] = cookiesAlias

this.options.modules.forEach(module => {
if (Array.isArray(module) && module[0] === 'cookie-universal-nuxt' && module[1] && module[1].alias && module[1].alias !== '') {
cookiesAlias = module[1].alias
options['cookiesAlias'] = cookiesAlias
}
})

if (!options.namespace) options.namespace = 'sections'
const { namespace } = options

Expand Down
3 changes: 3 additions & 0 deletions lib/src/base/icons/alert.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="122.879px" height="97.311px" viewBox="0 0 122.879 97.311" enable-background="new 0 0 122.879 97.311" xml:space="preserve"><g><path fill="red" fill-rule="evenodd" clip-rule="evenodd" d="M65.45,1.972l55.594,87.323c1.673,2.63,3.117,8.016,0,8.016H1.837 c-3.118,0-1.676-5.386,0-8.016L57.431,1.972C59.106-0.658,63.774-0.656,65.45,1.972L65.45,1.972z M56.578,74.146h9.682v8.561 h-9.682V74.146L56.578,74.146z M66.254,68.217H56.58c-0.964-11.756-2.982-19.216-2.982-30.955c0-4.331,3.51-7.842,7.841-7.842 c4.332,0,7.842,3.511,7.842,7.842C69.282,48.996,67.236,56.471,66.254,68.217L66.254,68.217z"/></g></svg>
</template>
3 changes: 3 additions & 0 deletions lib/src/base/icons/settings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"> <path fill="white" d="M47.16,21.221l-5.91-0.966c-0.346-1.186-0.819-2.326-1.411-3.405l3.45-4.917c0.279-0.397,0.231-0.938-0.112-1.282 l-3.889-3.887c-0.347-0.346-0.893-0.391-1.291-0.104l-4.843,3.481c-1.089-0.602-2.239-1.08-3.432-1.427l-1.031-5.886 C28.607,2.35,28.192,2,27.706,2h-5.5c-0.49,0-0.908,0.355-0.987,0.839l-0.956,5.854c-1.2,0.345-2.352,0.818-3.437,1.412l-4.83-3.45 c-0.399-0.285-0.942-0.239-1.289,0.106L6.82,10.648c-0.343,0.343-0.391,0.883-0.112,1.28l3.399,4.863 c-0.605,1.095-1.087,2.254-1.438,3.46l-5.831,0.971c-0.482,0.08-0.836,0.498-0.836,0.986v5.5c0,0.485,0.348,0.9,0.825,0.985 l5.831,1.034c0.349,1.203,0.831,2.362,1.438,3.46l-3.441,4.813c-0.284,0.397-0.239,0.942,0.106,1.289l3.888,3.891 c0.343,0.343,0.884,0.391,1.281,0.112l4.87-3.411c1.093,0.601,2.248,1.078,3.445,1.424l0.976,5.861C21.3,47.647,21.717,48,22.206,48 h5.5c0.485,0,0.9-0.348,0.984-0.825l1.045-5.89c1.199-0.353,2.348-0.833,3.43-1.435l4.905,3.441 c0.398,0.281,0.938,0.232,1.282-0.111l3.888-3.891c0.346-0.347,0.391-0.894,0.104-1.292l-3.498-4.857 c0.593-1.08,1.064-2.222,1.407-3.408l5.918-1.039c0.479-0.084,0.827-0.5,0.827-0.985v-5.5C47.999,21.718,47.644,21.3,47.16,21.221z M25,32c-3.866,0-7-3.134-7-7c0-3.866,3.134-7,7-7s7,3.134,7,7C32,28.866,28.866,32,25,32z"/></svg>
</template>
1 change: 0 additions & 1 deletion lib/src/base/icons/trash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
height="32"
viewBox="0 0 32 32"
>
<title>trash</title>
<path
fill="currentColor"
d="M24.8 3.2h-5.6v-0.8c0-1.323-1.077-2.4-2.4-2.4h-3.2c-1.323 0-2.4 1.077-2.4 2.4v0.8h-5.6c-1.323 0-2.4 1.077-2.4 2.4v1.6c0 1.043 0.669 1.932 1.6 2.262v20.138c0 1.323 1.077 2.4 2.4 2.4h16c1.323 0 2.4-1.077 2.4-2.4v-20.138c0.931-0.33 1.6-1.22 1.6-2.262v-1.6c0-1.323-1.077-2.4-2.4-2.4zM12.8 2.4c0-0.441 0.359-0.8 0.8-0.8h3.2c0.441 0 0.8 0.359 0.8 0.8v0.8h-4.8v-0.8zM23.2 30.4h-16c-0.441 0-0.8-0.359-0.8-0.8v-20h17.6v20c0 0.441-0.359 0.8-0.8 0.8zM25.6 7.2c0 0.441-0.359 0.8-0.8 0.8h-19.2c-0.441 0-0.8-0.359-0.8-0.8v-1.6c0-0.441 0.359-0.8 0.8-0.8h19.2c0.441 0 0.8 0.359 0.8 0.8v1.6z"
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/Sections/Sections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:admin="admin"
:pageName="pageName"
:lang="lang"
:_sections-options="_sectionsOptions"
@load="loaded"
/>
</template>
Expand All @@ -26,6 +27,9 @@ export default {
type: Boolean,
default: false,
},
_sectionsOptions: {
type: Object
}
},
components: {
SectionsMain,
Expand Down
Loading