Skip to content

Commit

Permalink
feat: allow pages as privacy policy page (#8695eyy99)
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Aug 22, 2024
1 parent 5baa3fa commit 8509054
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/back-end/builddata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.46.0",
"build": 16915
"build": 16917
}
4 changes: 4 additions & 0 deletions app/back-end/modules/render-html/helpers/gdpr.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ class Gdpr {

let result = renderer.cachedItems.posts[configuration.privacyPolicyPostId];

if (!result) {
result = renderer.cachedItems.pages[configuration.privacyPolicyPostId];
}

if (!result) {
return '#not-found';
}
Expand Down
7 changes: 5 additions & 2 deletions app/src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,9 @@ export default {
return sitemapLink;
},
postPages () {
return this.$store.state.currentSite.posts.filter(post => post.status.indexOf('published') > -1).map(post => post.id);
let posts = this.$store.state.currentSite.posts.filter(post => post.status.indexOf('published') > -1).map(post => post.id);
let pages = this.$store.state.currentSite.pages.filter(page => page.status.indexOf('published') > -1).map(page => page.id)
return posts.concat(pages);
},
dropdownItems () {
return [
Expand Down Expand Up @@ -2884,7 +2886,8 @@ export default {
}
},
customPostLabels (value) {
return this.$store.state.currentSite.posts.filter(post => post.id === value).map(post => post.title)[0];
let postsAndPages = this.$store.state.currentSite.posts.concat(this.$store.state.currentSite.pages);
return postsAndPages.filter(item => item.id === value).map(item => item.title)[0];
},
closeDropdown (refID) {
this.$refs[refID].isOpen = false;
Expand Down

0 comments on commit 8509054

Please sign in to comment.