Skip to content

Commit

Permalink
Show 'Obsolete' info in the metadata section in the banner
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Mar 3, 2023
1 parent 612f035 commit fddfd2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ItemView/ItemView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { asyncConnect, Helmet } from '@plone/volto/helpers';
import { fetchResult } from '@eeacms/search/lib/hocs/useResult';
import { setDatahubResult } from '@eeacms/volto-datahub/store';

import { isObsolete } from './utils.js';

const appName = 'datahub';

function IsomorphicPortal({ children }) {
Expand Down Expand Up @@ -64,7 +66,8 @@ function ItemView(props) {

const item = result ? result._result : null;
const { title, description, raw_value } = item || {}; // readingTime
const { changeDate, resourceIdentifier } = raw_value?.raw || {};
const { changeDate, resourceIdentifier, cl_status } = raw_value?.raw || {};
const obsolete = isObsolete(cl_status);

const prodID = (resourceIdentifier || []).filter((p) => {
return p.code.includes('DAT');
Expand Down Expand Up @@ -113,6 +116,7 @@ function ItemView(props) {
</Banner.Subtitle>
<Banner.Title>{title?.raw}</Banner.Title>
<Banner.Metadata>
{obsolete && <div class="ui label archived-item">Obsolete</div>}
<Banner.MetadataField label="Prod-ID" value={prodID} />
<Banner.MetadataField
label="Published"
Expand Down

0 comments on commit fddfd2a

Please sign in to comment.