Skip to content

Commit

Permalink
feat(status, thumbnails): Added status and thumbnails in superdesk lists
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovicnemanja committed Oct 8, 2024
1 parent aac7ccf commit 9be9302
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions client/components/ContentLists/Manual/ArticleItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ const ArticleItem = ({
thumbnail = helpers.getRenditionUrl(item.feature_media.renditions);
}

if (item.associations && item.associations.featuremedia) {
const renditions = item.associations.featuremedia.renditions;

const renditionsArray = Object.keys(renditions).map(key => ({
...renditions[key],
name: key
}));

thumbnail = helpers.getRenditionUrl(renditionsArray);
}

return (
<div
className={classNames("sd-list-item", {
Expand Down
6 changes: 3 additions & 3 deletions client/components/ContentLists/Manual/Manual.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@ class Manual extends React.Component {
...superedeskApi.helpers.prepareSuperdeskQuery('/archive', query),
}).then((response) => {
const articleItemsMapped = response._items.map((
{ _id, authors, body_html, headline, versioncreated, featured_image }) => ({
{ _id, authors, body_html, headline, versioncreated, state, associations }) => ({
id: _id,
authors,
body: body_html,
title: headline,
published_at: versioncreated,
feature_media: featured_image,
route: { name: 'Superdesk' }
route: { name: state.replace('_', ' ') },
associations
})
);

Expand Down

0 comments on commit 9be9302

Please sign in to comment.