Skip to content

Commit

Permalink
Merge pull request #34 from eea/develop
Browse files Browse the repository at this point in the history
Update reports view
  • Loading branch information
GhitaB committed Apr 25, 2024
2 parents 68278d5 + 93db84f commit 88555ef
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 33 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ 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.14](https://github.com/eea/volto-insitu-policy/compare/0.1.13...0.1.14) - 25 April 2024

#### :house: Internal changes

- style: Automated code fix [eea-jenkins - [`84e4e22`](https://github.com/eea/volto-insitu-policy/commit/84e4e2269e9423b688bf54200e3e6ddcb240a615)]

#### :hammer_and_wrench: Others

- Refs #267520 - Get rid of custom tags rendering in News Item view. [GhitaB - [`6127856`](https://github.com/eea/volto-insitu-policy/commit/61278560c72eba364c3290b0e16425a288e40bcd)]
- Use TokenWidget for Copernicus Components and Themes. [GhitaB - [`80df4b1`](https://github.com/eea/volto-insitu-policy/commit/80df4b1a44d31a88bd9b4a1a4a3e2893a7096f4c)]
- update report view [Teodor - [`eb3f06e`](https://github.com/eea/volto-insitu-policy/commit/eb3f06ef4e143813eb8ec53b65bea37a14ffbc48)]
### [0.1.13](https://github.com/eea/volto-insitu-policy/compare/0.1.12...0.1.13) - 23 April 2024

#### :hammer_and_wrench: Others
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-insitu-policy",
"version": "0.1.13",
"version": "0.1.14",
"description": "@eeacms/volto-insitu-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
32 changes: 16 additions & 16 deletions src/components/theme/Views/InsituReportView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import './styles.less';

function InsituReportView(props) {
const { content } = props;
const { description, file, ...filteredContent } = content;
const { description, file, report_category, ...filteredContent } = content;

return (
<div className="insitu-report-view">
Expand All @@ -18,22 +18,14 @@ function InsituReportView(props) {
<Grid>
<Grid.Row>
<Grid.Column width={8}>
<h3>Summary</h3>
<p className="documentDescription eea callout">
{content.description}
</p>
</Grid.Column>
<Grid.Column width={4}>
{content.preview_image && (
<Image
src={content?.preview_image.download}
alt="Descriptive Image"
/>
{content?.description && (
<>
<h3>Summary</h3>
<p className="documentDescription eea callout">
{content.description}
</p>
</>
)}
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column width={8}>
{!!content.file?.download && (
<div className="file-download">
<div className="file-title">
Expand All @@ -52,6 +44,14 @@ function InsituReportView(props) {
</div>
)}
</Grid.Column>
<Grid.Column width={4}>
{content.preview_image && (
<Image
src={content?.preview_image.download}
alt="Descriptive Image"
/>
)}
</Grid.Column>
</Grid.Row>
</Grid>
{isOldFormat(content) ? (
Expand Down
16 changes: 0 additions & 16 deletions src/components/theme/Views/NewsItemView.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import React from 'react';
import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
import { Label } from 'semantic-ui-react';
import { BannerTitle } from '@eeacms/volto-insitu-policy/components';
import { HTMLField, isOldFormat } from '@eeacms/volto-insitu-policy/helpers';
import './styles.less';

const SubjectTags = (props) => {
const tags = props.content?.subjects;
return tags?.length > 0 ? (
<div className="subject-tags">
Filed under:{' '}
{tags.map((tag) => (
<Label size="small" key={tag}>
{tag}
</Label>
))}
</div>
) : null;
};

function NewsItemView(props) {
const { content } = props;

Expand All @@ -44,7 +29,6 @@ function NewsItemView(props) {
) : (
<RenderBlocks {...props} />
)}
<SubjectTags {...props} />
</div>
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions src/components/theme/Views/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
background: #f9f7f6;
color: #333332;

.button {
border: 2px solid #783f34 !important;
background-color: #f9f7f6 !important;
color: #783f34 !important;
}

a {
color: #333332;
font-size: 17px;
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import copernicusLogoWhite from '@eeacms/volto-insitu-policy/../theme/themes/ass
import eeaLogoWhiteBy from '@eeacms/volto-insitu-policy/../theme/themes/assets/images/Footer/eea-logo-white-by.svg';
import ReportsCardTemplate from '@eeacms/volto-insitu-policy/components/manage/Blocks/Listing/item-templates/ReportsCardTemplate';
import ListingReportsTemplate from '@eeacms/volto-insitu-policy/components/manage/Blocks/Listing/item-templates/ListingReportsTemplate';
import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';

import {
setCardModelSchema,
Expand Down Expand Up @@ -155,6 +156,9 @@ const applyConfig = (config) => {
],
};

config.widgets.id.copernicus_components = TokenWidget;
config.widgets.id.copernicus_themes = TokenWidget;

return config;
};

Expand Down

0 comments on commit 88555ef

Please sign in to comment.