Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from eea/develop
Browse files Browse the repository at this point in the history
Fix missing data in AppHeader (catalogue)
  • Loading branch information
andreiggr committed Dec 8, 2021
2 parents b74f01c + 1d27b00 commit 3d1b586
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [0.1.26](https://github.com/eea/volto-forests-theme/compare/0.1.25...0.1.26)

- remove unused prop [`4fbc04b`](https://github.com/eea/volto-forests-theme/commit/4fbc04b36fb607681c40d2ededd5d489060d792e)
- fix Header missing prop in AppHeader.jsx ( catalogue) [`15d8896`](https://github.com/eea/volto-forests-theme/commit/15d88961cd24995424bce95e895fa7c781609fea)
- revert configs [`791c6b0`](https://github.com/eea/volto-forests-theme/commit/791c6b064d5b827ddb32e8d237c7c2a54b90e592)
- add missing routes [`8339cc2`](https://github.com/eea/volto-forests-theme/commit/8339cc26ded18ccfd6e24a3c1ce0ee8b334b8f50)
- Update theme.config [`7950572`](https://github.com/eea/volto-forests-theme/commit/7950572377c097f3df90a15062d93ed74d1caf92)

#### [0.1.25](https://github.com/eea/volto-forests-theme/compare/0.1.24...0.1.25)

- Update index.js [`2067fe3`](https://github.com/eea/volto-forests-theme/commit/2067fe33518e23513a329ea48f4cc15713008419)
> 7 December 2021
- Update index.js [`#34`](https://github.com/eea/volto-forests-theme/pull/34)

#### [0.1.24](https://github.com/eea/volto-forests-theme/compare/0.1.23...0.1.24)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-forests-theme",
"version": "0.1.25",
"version": "0.1.26",
"description": "@eeacms/volto-forests-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
38 changes: 35 additions & 3 deletions src/components/theme/CatalogueViews/AppHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,48 @@ class App extends Component {
render() {
const path = getBaseUrl(this.props.pathname);
const action = getView(this.props.pathname);
const leadImageCaption =
this.props.content?.lead_image_caption &&
this.props.content.lead_image_caption !== null
? this.props.content.lead_image_caption
: '';

const bigLeading =
this.props.content?.big_leading_image &&
this.props.content.big_leading_image !== null
? this.props.content.big_leading_image
: false;

const inheritLeadingData =
this.props.content?.inherit_leading_data &&
this.props.content.inherit_leading_data !== null
? this.props.content.inherit_leading_data
: false;

const leadNavigation =
this.props.content?.lead_navigation &&
this.props.content.lead_navigation !== null
? this.props.content.lead_navigation
: false;

const headerImage =
this.props.content?.image?.download || this.props.defaultHeaderImage;

const extraHeaderData = {
bigLeading,
inheritLeadingData,
parentData: this.props.content?.parent,
leadNavigation,
leadImageCaption,
};

return (
<Fragment>
<BodyClass className={`view-${action}view`} />
<Header
folderHeader={this.props.folderHeader}
actualPathName={this.props.pathname}
pathname={path}
extraData={extraHeaderData}
defaultHeaderImage={headerImage}
navigationItems={this.props.navigation}
frontpage_slides={this.props.frontpage_slides}
Expand Down Expand Up @@ -189,10 +222,9 @@ export default compose(
]),
connect(
(state, props) => ({
folderHeader: state.folder_header.items,
defaultHeaderImage: state.default_header_image.items?.[0],
// content: state.content.data,
content: state.prefetch?.[props.location.pathname] || state.content.data,
content: state.content.data,
frontpage_slides: state.frontpage_slides.items,
navigation: state.navigation.items,
pathname: state.router.location.pathname, //props.location.pathname,
Expand Down
6 changes: 5 additions & 1 deletion theme/theme.config
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@
@import (multiple) "~semantic-ui-less/theme.less";
@fontPath : "~volto-themes/@{theme}/assets/fonts";

/* End Config */
.loadAddonOverrides() {
@import (optional) "@{siteFolder}/@{addon}/@{addontype}s/@{addonelement}.overrides";
}

/* End Config */

0 comments on commit 3d1b586

Please sign in to comment.