Skip to content

Commit

Permalink
Endringer på parten
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb-cgn committed Mar 7, 2025
1 parent ae604a5 commit 459dcca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/assets/styles/_timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
display: grid;
grid-template-columns: repeat(12, 1fr);
margin-top: 4rem;
margin-bottom: 5rem;

.title-ingress-wrapper {
grid-column: 2 / span 10;
Expand All @@ -28,7 +29,6 @@
grid-column: 3 / span 8;
flex-wrap: wrap;
gap: 0.75rem;
margin-top: 5rem;
margin-bottom: 4rem;
width: 740px;

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lib/types/partTypes/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface TimelineProps {
title: string
ingress: string
timelineElements: TimelineElement[]
showFilter: boolean
showMoreButtonText: string
countYear: number
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/site/parts/timeline/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function renderPart(req: XP.Request) {
title: timelineConfig.title,
ingress: timelineConfig.ingress,
timelineElements,
showFilter: timelineConfig.showFilter,
showMoreButtonText: showMoreText ?? 'Vis flere år',
countYear: timelineConfig.numberOfYear ?? 10,
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/site/parts/timeline/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { sanitize } from '/lib/ssb/utils/htmlUtils'
import { usePaginationKeyboardNavigation } from '/lib/ssb/utils/customHooks/paginationHooks'

function Timeline(props: TimelineProps) {
const { timelineElements, countYear, showMoreButtonText, title, ingress } = props
const { timelineElements, countYear, showMoreButtonText, title, ingress, showFilter } = props
const [selectedTag, setSelectedTag] = useState('all')
const [timelineCount, setTimeLineCount] = useState(countYear)
const [keyboardNavigation, setKeyboardNavigation] = useState(false)
Expand Down Expand Up @@ -251,7 +251,7 @@ function Timeline(props: TimelineProps) {
return (
<div className='ssb-timeline'>
{title && addTitle()}
{addFilter()}
{showFilter && addFilter()}
{addTimeLine()}
</div>
)
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/site/parts/timeline/timeline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<label>Ingress</label>
<occurrences minimum="0" maximum="1"/>
</input>
<input name="showFilter" type="CheckBox">
<label>Vis filtering</label>
<config>
<alignment>right</alignment>
</config>
</input>
<input type="TextLine" name="numberOfYear">
<label>Antall år per side</label>
<help-text>Hvor mange år skal vises før man må trykke Vis flere år</help-text>
Expand All @@ -21,7 +27,7 @@
</items>
</field-set>
<item-set name="TimelineItemSet">
<label>Tidslinjeelementer</label>
<label>Vimpel</label>
<occurrences minimum="1" maximum="0"/>
<items>
<input name="year" type="TextLine">
Expand Down

0 comments on commit 459dcca

Please sign in to comment.