Commit db192371 authored by Torstein's avatar Torstein
Browse files

DEICH-5602 add lead paragraph to audio/video content

- made description and lead paragraph optional
- added lead paragraph to Sibyl index
- change when and how description is presented
parent 39dbde72
......@@ -25,13 +25,12 @@ const generateExpiryString = date => {
)}`;
};
// TODO: remove hard coded example values
const EmbedCard = ({
type = "youtube",
id = "123",
mediaSourceId = "TI7sxkDRJLk",
title = "Tittel på video",
description = "Beskrivelse",
type = "",
id = "",
mediaSourceId = "",
title = "",
description = "",
created,
expiryDate
}) => {
......
......@@ -108,7 +108,7 @@ class DigitalService extends React.Component {
mediaSourceId={item.mediaSourceId}
type={item.mediaSource}
title={item.title}
description={item.description}
description={item.leadParagraph}
created={item.created}
expiryDate={item.expiryDate}
/>
......
......@@ -42,6 +42,7 @@ class MediaPage extends React.Component {
expiryDate,
title = "",
description = "",
leadParagraph = "",
mediaSource,
mediaSourceId
} = currentItem;
......@@ -57,7 +58,7 @@ class MediaPage extends React.Component {
<Block top={8} responsive>
<PageHero
title={title}
intro={description}
intro={leadParagraph}
category="Digitale Kilder"
/>
</Block>
......@@ -65,7 +66,8 @@ class MediaPage extends React.Component {
<Block top={8} responsive>
<Embed title={title} type={mediaSource} id={mediaSourceId} />
</Block>
<Block top={2} bottom={8}>
<Block top={2}>
<Flex wrap>
<Block right={4}>
<small>
......@@ -82,6 +84,10 @@ class MediaPage extends React.Component {
)}
</Flex>
</Block>
<Block top={4} bottom={8}>
<p>{description}</p>
</Block>
</Container>
</Fragment>
);
......
......@@ -16,6 +16,7 @@ public class AudioVideo extends JsonApiRootClass {
private String mediaSourceId;
private String mediaURL;
private String title;
private String leadParagraph;
private String description;
private PropertyValue branch;
private PropertyValue targetAudience;
......@@ -23,7 +24,4 @@ public class AudioVideo extends JsonApiRootClass {
@JsonProperty("services") // restricted to services with property hasAudioVideo set to true
private List<Service> service = new ArrayList<>();
}
......@@ -4,6 +4,7 @@ type AudioVideo struct {
Id string `json:"id,omitempty"`
Uri string `json:"uri,omitempty"`
Title string `json:"title,omitempty"`
LeadParagraph string `json:"leadParagraph,omitempty"`
Description string `json:"description,omitempty"`
Created string `json:"created,omitempty"`
Branch map[string]interface{} `json:"branch,omitempty"`
......
......@@ -36,6 +36,7 @@
mediaSource: "", // Vimeo, YouTube etc
mediaSourceId: "",
title: "",
leadParagraph: "",
description: "",
branch: {},
targetAudience: {},
......@@ -53,7 +54,6 @@
const isFormValid =
audioVideoData.mediaSourceId.length > 0 &&
audioVideoData.title.length > 0 &&
audioVideoData.description.length > 0 &&
audioVideoData.targetAudience.id &&
audioVideoData.branch.id
......@@ -254,10 +254,15 @@
bind:value={audioVideoData.title}
/>
</div>
<div class="block block--top-6">
<EditFieldLarge
strings={strings.audioVideo.leadParagraph}
bind:value={audioVideoData.leadParagraph}
/>
</div>
<div class="block block--top-6">
<EditFieldLarge
strings={strings.audioVideo.description}
required
bind:value={audioVideoData.description}
/>
</div>
......
......@@ -411,6 +411,9 @@ export const strings = {
description: {
label: "Beskrivelse"
},
leadParagraph: {
label: "Ingress"
},
branch: {
label: "Eies av"
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment