Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
omsaggau committed Oct 24, 2023
2 parents dfda186 + 19626ee commit 841ad9f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/admin/tools/dashboard/dashboard.es6
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ function renderPart(req) {
...assets,
pageContributions,
username: user.displayName,
linkToGuide: userHasAdmin
? 'https://wiki.ssb.no/display/VEILEDNING/Brukerdokumentasjon+for+publisering+i+XP'
: 'https://wiki.ssb.no/display/VEILEDNING/Brukerdokumentasjon+i+publisering+i+XP+-+for+statistikkseksjon',
}

let body = render(view, model)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/admin/tools/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<nav class="y-2">
<span data-th-text="${username}"></span> |
<a href="mailto:[email protected]">[email protected]</a> |
<a href="">Veiledning</a>
<a th:href="${linkToGuide}">Veiledning</a>
</nav>
<div class="misc">
<img data-th-src="${logoUrl}" class="logo" alt=""></img>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/lib/ssb/parts/publicationArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function prepareStatisticRelease(

return {
title: language === 'en' ? release.statisticNameEn : release.statisticName,
period: period.charAt(0) + period.slice(1),
period: period,
preface: aboutTheStatisticsContent ? aboutTheStatisticsContent.data.ingress : seoDescription,
url: statisticsPageUrl,
publishDate: publishDate ?? '',
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/lib/ssb/utils/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ exports.localizeTimePeriod = (time: string): string => {
* @return {string}
*/
function parseTimeInterval(time: string): string {
const splitYearLetterNumberIntoArray = new RegExp(/(\d{4})([HKMTU])(\d{1,2})/)
const splitYearLetterNumberIntoArray = new RegExp(/(\d{4})([HKMTU-])(\d{1,2})/)
const interval: RegExpExecArray | null = splitYearLetterNumberIntoArray.exec(time)

let parsedTime = ''
Expand Down Expand Up @@ -151,6 +151,10 @@ function parseTimeInterval(time: string): string {
key: 'interval.' + interval[2],
})} ${interval[3]} ${interval[1]}`
break
case '-':
// e.g. 2022-2023
parsedTime = time
break
}
return parsedTime
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,21 @@ export function DashboardTools() {
id: 'link-statreg',
title: 'Statistikkregisteret',
},
{
id: 'link-designer',
title: 'Tabellbygger',
},
{
id: 'link-statbank',
title: 'Intern statistikkbank',
},
{
id: 'link-guide-publications',
title: 'Veiledninger i publiseringer på ssb.no',
title: 'Veiledninger i publisering',
},
{
id: 'link-status-statreg',
title: 'Statusrapporter StatReg',
},
{
id: 'link-tbml-validation',
title: 'TBML validering',
}
)
return linkOptions
Expand All @@ -180,15 +184,16 @@ export function DashboardTools() {
function renderLinkTools() {
const openLinks = (item) => {
if (item.id === 'link-statreg') {
return openLinkInNewWindow(`${internalBaseUrl}/statistikkregisteret/publisering/list`)
} else if (item.id === 'link-designer') {
return openLinkInNewWindow(`${internalBaseUrl}/designer`)
openLinkInNewWindow(`${internalBaseUrl}/statistikkregisteret/publisering/list`)
} else if (item.id === 'link-statbank') {
return openLinkInNewWindow(internalStatbankUrl)
openLinkInNewWindow(internalStatbankUrl)
} else if (item.id === 'link-guide-publications') {
return openLinkInNewWindow('https://wiki.ssb.no/display/VEILEDNING/Home')
openLinkInNewWindow('https://wiki.ssb.no/display/VEILEDNING/Brukerdokumentasjon+for+publisering+i+XP')
} else if (item.id === 'link-status-statreg') {
openLinkInNewWindow(`${internalBaseUrl}/dashboard/statusrapport`)
} else if (item.id === 'link-tbml-validation') {
openLinkInNewWindow(`${internalBaseUrl}/tbprocessor/document/validateTbml/216725`)
}
return
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function getGroupedWithMonthNames(config: ReleasedStatisticsPartConfig, currentL
function prepReleases(
variant: ContentLight<ReleaseVariant>,
date: Date,
periodRelease: string | undefined
periodRelease: string
): PreparedStatistics {
return {
id: Number(variant.data.statisticId),
Expand All @@ -119,7 +119,7 @@ function prepReleases(
monthNumber: date.getMonth(),
year: date.getFullYear(),
frequency: variant.data.frequency,
period: periodRelease ? periodRelease.toLowerCase() : '',
period: periodRelease,
},
}
}
Expand Down

0 comments on commit 841ad9f

Please sign in to comment.