Skip to content

Commit fe94265

Browse files
authored
Prod Deploy - merge (Master < Develop)
Prod Deploy
2 parents 3f45259 + fbc97e6 commit fe94265

File tree

11 files changed

+166
-96
lines changed

11 files changed

+166
-96
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@
77

88
version: 2
99
updates:
10-
- package-ecosystem: "npm"
11-
directory: "/"
12-
schedule:
13-
interval: "weekly"
14-
open-pull-requests-limit: 10
15-
# Grouping patch updates and minor updates into two pull requests for all packages
16-
groups:
17-
dependencies-patch-updates:
18-
update-types:
19-
- "patch"
20-
dependencies-minor-updates:
21-
update-types:
22-
- "minor"
23-
ignore:
24-
# enonic types should update only when updating enonic version on server
25-
- dependency-name: "@enonic-types/*"
26-
- package-ecosystem: "gradle"
27-
directory: "/"
28-
schedule:
29-
interval: "weekly"
30-
open-pull-requests-limit: 10
31-
- package-ecosystem: "github-actions"
32-
directory: "/"
33-
schedule:
34-
interval: "weekly"
35-
open-pull-requests-limit: 10
10+
- package-ecosystem: "npm"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"
14+
open-pull-requests-limit: 10
15+
# Grouping patch updates and minor updates into two pull requests for all packages
16+
groups:
17+
dependencies-patch-updates:
18+
update-types:
19+
- "patch"
20+
dependencies-minor-updates:
21+
update-types:
22+
- "minor"
23+
ignore:
24+
# enonic types should update only when updating enonic version on server
25+
- dependency-name: "@enonic-types/*"
26+
- package-ecosystem: "gradle"
27+
directory: "/"
28+
schedule:
29+
interval: "weekly"
30+
open-pull-requests-limit: 10
31+
- package-ecosystem: "github-actions"
32+
directory: "/"
33+
schedule:
34+
interval: "weekly"
35+
open-pull-requests-limit: 10

.github/workflows/deploy_to_prod.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,6 @@ jobs:
1919
uses: enonic/release-tools/build-and-publish@master
2020
with:
2121
skipPublishing: true
22-
- id: deploy_app_to_XP
23-
uses: 'enonic/action-app-deploy@main'
24-
with:
25-
url: ${{ secrets.ENONIC_PROD_URL }}
26-
username: ${{ secrets.ENONIC_USER }}
27-
password: ${{ secrets.ENONIC_PROD_PASS }}
28-
client_cert: ${{ secrets.ENONIC_CERT }}
29-
client_key: ${{ secrets.ENONIC_KEY }}
30-
app_jar: "./build/libs/*.jar"
31-
- name: Upload artifacts
32-
id: upload_artifacts
33-
if: success()
34-
uses: actions/upload-artifact@v4
35-
with:
36-
name: mimir-prod-${{ github.run_number }}
37-
path: "./build/libs/*.jar"
3822
- name: Get Version Number
3923
id: get_version_number
4024
run: |
@@ -45,6 +29,22 @@ jobs:
4529
run: gh release create $VERSION --generate-notes
4630
env:
4731
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Upload artifacts
33+
id: upload_artifacts
34+
if: success()
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: mimir-prod-${{ github.run_number }}
38+
path: "./build/libs/*.jar"
39+
- id: deploy_app_to_XP
40+
uses: 'enonic/action-app-deploy@main'
41+
with:
42+
url: ${{ secrets.ENONIC_PROD_URL }}
43+
username: ${{ secrets.ENONIC_USER }}
44+
password: ${{ secrets.ENONIC_PROD_PASS }}
45+
client_cert: ${{ secrets.ENONIC_CERT }}
46+
client_key: ${{ secrets.ENONIC_KEY }}
47+
app_jar: "./build/libs/*.jar"
4848
- name: Send success message to Slack
4949
id: slack_success
5050
if: success()

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
include "com.enonic.xp:lib-admin:${xpVersion}"
2727
include "com.enonic.lib:lib-http-client:3.2.2"
2828
include "com.enonic.xp:lib-i18n:${xpVersion}"
29-
include "com.enonic.lib:lib-cron:1.1.2"
29+
include "com.enonic.lib:lib-cron:1.1.4"
3030
include "com.enonic.xp:lib-context:${xpVersion}"
3131
include 'com.enonic.lib:lib-cache:2.2.1'
3232
include "com.enonic.xp:lib-event:${xpVersion}"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gradle Project settings
22
projectName = mimir
3-
version = 2.22.1
3+
version = 2.23.0
44

55
# XP App values
66
appDisplayName = Mimir application

package-lock.json

Lines changed: 98 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"@item-enonic-types/lib-thymeleaf": "~2.1.0",
7777
"@item-enonic-types/lib-time": "~1.0.4",
7878
"@reduxjs/toolkit": "~2.5.0",
79-
"@statisticsnorway/ssb-component-library": "~2.4.7",
79+
"@statisticsnorway/ssb-component-library": "~2.4.9",
8080
"@types/grecaptcha": "^3.0.9",
8181
"@types/ramda": "~0.30.2",
8282
"@types/react": "~18.3.12",

src/main/resources/assets/styles/_statisticDescription.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.statistic-description {
22
margin-top: 4.5rem;
3+
34
.content-wrapper {
45
background-color: white;
56
padding: 1.5rem 2.5rem 4.5rem;
@@ -23,11 +24,6 @@
2324
gap: 0.75rem;
2425
margin-top: 1.5rem;
2526
margin-bottom: 3rem;
26-
27-
.ssb-tag.active {
28-
background: $ssb-green-4;
29-
color: $ssb-white;
30-
}
3127
}
3228

3329
.selected-category {

src/main/resources/lib/ssb/utils/articleUtils.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import {
66
getAllSubSubjectByContent,
77
getMainSubjects,
88
getSubSubjects,
9+
getSubSubjectsByPath,
910
} from '/lib/ssb/utils/subjectUtils'
1011
import { formatDate } from '/lib/ssb/utils/dateUtils'
1112
import { notNullOrUndefined } from '/lib/ssb/utils/coreUtils'
1213
import { ENONIC_CMS_DEFAULT_REPO, withSuperUserContext } from '/lib/ssb/repo/common'
1314
import { arraysEqual, ensureArray } from '/lib/ssb/utils/arrayUtils'
1415
import { type ArticleResult, type AssociatedLink, type CMS, type PreparedArticles } from '/lib/types/article'
1516
import { type SubjectItem } from '/lib/types/subject'
16-
import { type Article } from '/site/content-types'
17+
import { Page, type Article } from '/site/content-types'
1718

1819
const dummyReq: Partial<XP.Request> = {
1920
branch: 'master',
@@ -225,3 +226,18 @@ export function getAssociatedArticleArchiveLinks(
225226
}
226227
return []
227228
}
229+
230+
export function getSubtopics(
231+
content: Content<Page>,
232+
currentPath: string,
233+
req: XP.Request,
234+
language: string
235+
): string | string[] {
236+
const isMainSubject: boolean = content.page?.config?.subjectType === 'mainSubject'
237+
if (isMainSubject) {
238+
const allSubSubjects: SubjectItem[] = getSubSubjects(req, language)
239+
const subSubjectByPath = getSubSubjectsByPath(allSubSubjects, currentPath)
240+
return subSubjectByPath.map((subSubject) => subSubject.id)
241+
}
242+
return content._id
243+
}

src/main/resources/services/articles/articles.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getContent } from '/lib/xp/portal'
2-
import { getChildArticles, prepareArticles } from '/lib/ssb/utils/articleUtils'
2+
import { getChildArticles, getSubtopics, prepareArticles } from '/lib/ssb/utils/articleUtils'
33
import { type PreparedArticles } from '/lib/types/article'
44

55
let totalCount = 0
@@ -16,9 +16,8 @@ export const get = (req: XP.Request): XP.Response => {
1616
status: 404,
1717
}
1818
}
19-
const subTopicId: string = content._id
20-
21-
const childArticles = getChildArticles(currentPath, subTopicId, start, count, sort)
19+
const subTopicIds: string | string[] = getSubtopics(content, currentPath, req, language)
20+
const childArticles = getChildArticles(currentPath, subTopicIds, start, count, sort)
2221
const preparedArticles: Array<PreparedArticles> = prepareArticles(childArticles, language)
2322
totalCount = childArticles.total
2423

src/main/resources/site/parts/statisticDescription/statisticDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getOmStatistikken(req: XP.Request, page: Content<any>, aboutTheStatisti
4444
const props: AboutTheStatisticsProps = getAboutTheStatisticsProps(req, page, aboutTheStatisticsId)
4545

4646
return render('site/parts/statisticDescription/statisticDescription', props, req, {
47-
body: `<section id="om-statistikken" class="xp-part statistic-description container-fluid"></section>`,
47+
body: `<section id="om-statistikken" class="xp-part statistic-description container"></section>`,
4848
id: 'statistic-description',
4949
})
5050
}

0 commit comments

Comments
 (0)