Skip to content

Commit 0c5f19c

Browse files
OCurdycmangeat
authored andcommitted
add application banner warning message
1 parent 2a41f8e commit 0c5f19c

5 files changed

Lines changed: 75 additions & 12 deletions

File tree

.github/workflows/geonetwork-docker.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- geocat_v4.2.3_report_custom*
7+
- application-banner-warning-message
78

89
jobs:
910
build:
@@ -22,11 +23,13 @@ jobs:
2223
java-version: 1.8
2324

2425
- name: "Cache Maven packages"
25-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2627
with:
27-
path: ~/.m2
28-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
29-
restore-keys: ${{ runner.os }}-m2
28+
path: ~/.m2/repository
29+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
maven-${{ runner.os }}-
32+
maven-
3033
3134
- name: "Update maven dependencies"
3235
run: mvn -Pdocker de.qaware.maven:go-offline-maven-plugin:resolve-dependencies

.github/workflows/linux.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ jobs:
2525
with:
2626
distribution: 'temurin'
2727
java-version: ${{ matrix.jdk }}
28-
cache: 'maven'
28+
- name: Cache Maven packages
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.m2/repository
32+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: |
34+
maven-${{ runner.os }}-
35+
maven-
2936
- name: Set up Maven
3037
uses: stCarolas/setup-maven@v4
3138
with:
@@ -52,7 +59,14 @@ jobs:
5259
with:
5360
distribution: 'temurin'
5461
java-version: 8
55-
cache: 'maven'
62+
- name: Cache Maven packages
63+
uses: actions/cache@v4
64+
with:
65+
path: ~/.m2/repository
66+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
67+
restore-keys: |
68+
maven-${{ runner.os }}-
69+
maven-
5670
- name: Set up Maven
5771
uses: stCarolas/setup-maven@v4
5872
with:

.github/workflows/sonarcloud.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
# Only analyze with Sonar on non-fork repos:
1313
# https://github.community/t/how-to-detect-a-pull-request-from-a-fork/18363/4
14-
if: github.event.pull_request.head.repo.fork != true
14+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork != true
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1919
submodules: 'recursive'
@@ -23,9 +23,16 @@ jobs:
2323
with:
2424
java-version: 8
2525
distribution: 'temurin'
26-
cache: 'maven'
26+
- name: Cache Maven packages
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.m2/repository
30+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: |
32+
maven-${{ runner.os }}-
33+
maven-
2734
- name: Cache SonarCloud packages
28-
uses: actions/cache@v3
35+
uses: actions/cache@v4
2936
with:
3037
path: ~/.sonar/cache
3138
key: ${{ runner.os }}-sonar
@@ -38,10 +45,10 @@ jobs:
3845
with:
3946
distribution: 'temurin'
4047
java-version: '21'
41-
cache: 'maven'
4248
- name: Analyze with Sonar
49+
continue-on-error: true
4350
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4551
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4653
#TODO: Enable tests, if reliable:
4754
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=geonetwork_core-geonetwork -Dsonar.organization=geonetwork -DskipTests=true -Dmaven.javadoc.skip=true

web-ui/src/main/resources/catalog/js/CatController.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
cookieWarningMoreInfoLink: "",
9898
cookieWarningRejectLink: ""
9999
},
100+
applicationBanner: {
101+
enabled: true
102+
},
100103
home: {
101104
enabled: true,
102105
appUrl: "../../{{node}}/{{lang}}/catalog.search#/home",

web-ui/src/main/resources/catalog/templates/top-toolbar-accessible.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11
<div data-ng-class="fluidHeaderLayout ? 'container-fluid' : 'container'">
2+
<div
3+
data-ng-init="isBannerEnabled = gnCfg.mods.applicationBanner.enabled"
4+
data-ng-show="isBannerEnabled"
5+
>
6+
<div class="modal-backdrop fade in" style="opacity: 0.6; z-index: 1040"></div>
7+
<div
8+
class="modal fade in"
9+
style="display: block; z-index: 1050"
10+
tabindex="-1"
11+
role="dialog"
12+
>
13+
<div class="modal-dialog modal-lg" role="document">
14+
<div class="modal-content">
15+
<div class="modal-header alert-danger" style="border-radius: 5px 5px 0 0">
16+
<h4 class="modal-title">
17+
<span class="fa fa-warning" style="margin-right: 8px"></span>
18+
<span data-translate="">application-banner-title</span>
19+
</h4>
20+
</div>
21+
<div class="modal-body" style="font-size: 20px; padding: 24px">
22+
<span data-translate="">application-banner</span>
23+
</div>
24+
<div class="modal-footer">
25+
<button
26+
type="button"
27+
class="btn btn-danger btn-lg"
28+
data-ng-click="isBannerEnabled = false"
29+
>
30+
<span class="fa fa-check" style="margin-right: 6px"></span>
31+
<span data-translate="">close</span>
32+
</button>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
238
<div class="navbar-header">
339
<a
440
class="hidden-sm hidden-md hidden-lg pull-left gn-logo-link"

0 commit comments

Comments
 (0)