From e74d5823ace5cc5b58558fd80d765f8b0ff0ea70 Mon Sep 17 00:00:00 2001 From: Carl-OW <142233642+Carl-OW@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:36:10 +0200 Subject: [PATCH 1/3] mimir-1291 feil i engelsk datoformat publikasjonsarkivet (#2186) * handling potential undefined or null values in objects fixes thymeleaf render error * upcomingReleses - quarter suffix (fix) * updated code * updated code * updated code 2 * Updated code 2 * fixes to the front page (releastedstats) --- src/main/resources/lib/ssb/parts/publicationArchive.ts | 2 +- .../site/parts/releasedStatistics/releasedStatistics.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/lib/ssb/parts/publicationArchive.ts b/src/main/resources/lib/ssb/parts/publicationArchive.ts index cf66f64f0..d3d56d6b2 100644 --- a/src/main/resources/lib/ssb/parts/publicationArchive.ts +++ b/src/main/resources/lib/ssb/parts/publicationArchive.ts @@ -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 ?? '', diff --git a/src/main/resources/site/parts/releasedStatistics/releasedStatistics.ts b/src/main/resources/site/parts/releasedStatistics/releasedStatistics.ts index cbf42408f..186e43d1c 100644 --- a/src/main/resources/site/parts/releasedStatistics/releasedStatistics.ts +++ b/src/main/resources/site/parts/releasedStatistics/releasedStatistics.ts @@ -107,7 +107,7 @@ function getGroupedWithMonthNames(config: ReleasedStatisticsPartConfig, currentL function prepReleases( variant: ContentLight, date: Date, - periodRelease: string | undefined + periodRelease: string ): PreparedStatistics { return { id: Number(variant.data.statisticId), @@ -119,7 +119,7 @@ function prepReleases( monthNumber: date.getMonth(), year: date.getFullYear(), frequency: variant.data.frequency, - period: periodRelease ? periodRelease.toLowerCase() : '', + period: periodRelease, }, } } From b24e4bfb97f09dec47cd190c9e6928973f7692b9 Mon Sep 17 00:00:00 2001 From: Anne-Siri <142512638+annesiri@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:15:43 +0200 Subject: [PATCH 2/3] [MIMIR-1190] fix dashboard links (#2188) * fixed links * added guide link * fixed snyk warning, removed return statements --- .../admin/tools/dashboard/dashboard.es6 | 3 +++ .../admin/tools/dashboard/dashboard.html | 2 +- .../containers/DashboardTools/index.jsx | 27 +++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/resources/admin/tools/dashboard/dashboard.es6 b/src/main/resources/admin/tools/dashboard/dashboard.es6 index 61f073adf..4e2135309 100644 --- a/src/main/resources/admin/tools/dashboard/dashboard.es6 +++ b/src/main/resources/admin/tools/dashboard/dashboard.es6 @@ -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) diff --git a/src/main/resources/admin/tools/dashboard/dashboard.html b/src/main/resources/admin/tools/dashboard/dashboard.html index a03a48386..7e24564ee 100644 --- a/src/main/resources/admin/tools/dashboard/dashboard.html +++ b/src/main/resources/admin/tools/dashboard/dashboard.html @@ -19,7 +19,7 @@
diff --git a/src/main/resources/react4xp/dashboard/containers/DashboardTools/index.jsx b/src/main/resources/react4xp/dashboard/containers/DashboardTools/index.jsx index 6ebc6af9e..f65e1ec0b 100644 --- a/src/main/resources/react4xp/dashboard/containers/DashboardTools/index.jsx +++ b/src/main/resources/react4xp/dashboard/containers/DashboardTools/index.jsx @@ -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 @@ -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 ( From 19626ee1cef2650cab9668a1b363b678566c24b9 Mon Sep 17 00:00:00 2001 From: Johnnadel Salita Uy Date: Tue, 24 Oct 2023 08:25:28 +0200 Subject: [PATCH 3/3] [MIMIR-1818] Display year to year duration for keyfigures with api as source (#2187) Display year to year duration for keyfigures with api as source MIMIR-1818 --- src/main/resources/lib/ssb/utils/language.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/lib/ssb/utils/language.ts b/src/main/resources/lib/ssb/utils/language.ts index 86b6546ed..490147ab3 100644 --- a/src/main/resources/lib/ssb/utils/language.ts +++ b/src/main/resources/lib/ssb/utils/language.ts @@ -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 = '' @@ -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 }