Skip to content

Commit 077a4a6

Browse files
milanmajchrakPaurikova2KasinhouMatus Kasakkosarko
authored
UFAL/Release hotfix 2026 02 26 - merge PR (#1225)
* Fix incorrect translation of "withdraw" (#1191) * used stahnout instead of odstranit * Update confirmation text for withdrawal action * added empty lines as in origin * removed spaces --------- Co-authored-by: Kasinhou <129340513+Kasinhou@users.noreply.github.com> * UFAL/Removed green line from the home page (#1204) * UFAL/Added import-5 to deploy (#1206) * UFAL/Removed unused github docker registry (#1212) * internal/Renamed dspace-import to dspace-import-clarin in import action (#1209) * renamed dspace-import to dspace-import-clarin * removed unwanted changes * UFAL/Editing similar process parameters (#1195) * Preserve parameters when creating similar process * Extract duplicate deep copy logic into helper * Fix redundant parameter logic prevent empty accumulation * UFAL/Display all versions in version history (#1213) * Override pagesize and display all versions * Changed hardcoded variable --------- Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk> * UFAL/Missing translation for new curation task (#1208) (cherry picked from commit 5465283) * UFAL/We expect (in metadata) the path to be "licence" (#1193) (cherry picked from commit 21521d1) (cherry picked from commit c296d87) * UFAL/Rewrite OAI links in static page HTML with rest.baseUrl (ufal#90) (#1189) * Rewrite OAI links in static page HTML with rest.baseUrl Updated StaticPageComponent to rewrite OAI links in loaded HTML content to use the configured rest.baseUrl, ensuring correct API endpoint references. Added comprehensive tests to verify link rewriting, handling of missing baseUrl, avoidance of double slashes, and cases with no OAI links. * Remove unused ComponentFixture import in test Cleaned up the static-page.component.spec.ts file by removing the unused ComponentFixture import to improve code clarity. * Fix OAI URL construction and improve test coverage Corrects the construction of the OAI URL in StaticPageComponent to avoid double slashes by removing the extra slash in the base URL. Also updates the unit test to properly instantiate the component and check its creation. (cherry picked from commit cb86d07) Co-authored-by: Amad Ul Hassan <hassan@ufal.mff.cuni.cz> * Update path for dspace-import in action.yml (#1216) Use dspace-import-clarin path instead of dspace-import * Refactor erase-db action to clean up comments Removed unnecessary comments and improved logging for volume removal. * Use `dspace:dspace` permissions for the assetstore - not ubuntu:ubuntu (#1222) * Use `dspace:dspace` permissions for the assetstore - not ubuntu:ubuntu * Change permissions as root * UFAL/Fix: generate correct curl download URLs using backend handle endpoint (#1215) * fix: generate correct curl download URLs using backend handle endpoint Updates the curl command generation to use the new backend endpoint GET /api/core/bitstreams/handle/{prefix}/{suffix}/{filename} instead of the non-existent /api/bitstream/{handle}/{seq}/{filename}. Key changes: - Uses correct backend endpoint path: /core/bitstreams/handle/{handle}/ - Removes unnecessary sequence index from URLs (uses filename only) - Quotes the URL to prevent shell brace expansion - For single file, uses -o with explicit filename Fixes: #1210 * Fixed formatting of the file names * fix: use -o with real filename to avoid percent-encoded names from curl -O curl -O uses the URL path as the saved filename, so percent-encoded characters (e.g. %20, %2B, %28) stay encoded in the output file. Now generates separate 'curl -o realname url' for each file joined with &&, ensuring files are saved with their actual names. * fix: use curl -OJ with brace expansion for compact download command * removed duplicates logic * fix: use curl -o instead of -OJ to fix non-ASCII filenames on Windows curl -J (Content-Disposition) cannot create files with non-ASCII characters on Windows because it interprets the header bytes using the console code page. Changed to curl -o filename url format where the shell passes the filename directly to the OS, correctly handling Unicode on all platforms. Also added tests for UTF-8 filenames and double-quote escaping. * fix: use inline encodeURIComponent instead of encodeRFC3986URIComponent encodeRFC3986URIComponent calls decodeURIComponent first, which throws URIError on filenames containing a literal percent sign (e.g. '100% done.txt') because '%' followed by non-hex chars is not a valid escape sequence. Replaced with inline encodeURIComponent() + parentheses encoding directly on the raw filename. Added test for literal percent sign in filenames. * fix: restore brace expansion {} in curl URL with -o for filenames curl command now uses brace expansion for compact URL: curl -o file1 -o file2 baseUrl{/encoded1,/encoded2} This combines: - {} brace expansion in the URL (compact, one URL for all files) - -o flags with real filenames (handles UTF-8 correctly via shell) * test: add complex filename test (diacritics, plus, hash, unmatched paren) New FE test for 'Media (+)#9) ano' verifying correct URL encoding in brace expansion and real filename in -o flag. * fix: use separate -o url pairs instead of curl brace expansion curl URL globbing ({}) does NOT support per-file -o flags. When using curl -o f1 -o f2 url{/a,/b} curl maps the -o flags to URL arguments, not to globbed expansions, resulting in 'Got more output options than URLs' and only one file saved. Changed to separate -o + URL pairs per file: curl -o file1 url/file1 -o file2 url/file2 Updated all 12 test expectations to match. * feat: show curl command in modal dialog with copy button Replace inline command display with a centered NgbModal (size: lg) that shows the curl command in a scrollable pre block. Includes a copy-to-clipboard button with visual feedback (checkmark + 'Copied!' for 2s). - Added NgbModal injection and openCommandModal()/copyCommand() methods - Removed old isCommandLineVisible toggle and #command-div hover styles - Added i18n keys for en, cs, de (copy/copied/close) - Updated spec to import NgbModalModule * Revert unnecessary changes * Address Copilot review suggestions: accessibility, security, test fixes - Reset canShowCurlDownload at start of generateCurlCommand() - Add aria-labelledby to modal for screen reader accessibility - Add .catch() to navigator.clipboard.writeText() for error handling - Escape dollar signs and backticks in filenames for shell safety - Fix ConfigurationDataService mock to return RemoteData-shaped object - Add tests for canShowCurlDownload reset and shell injection protection * fix: add fakeAsync/tick to CC license test for debounced getCcLicenseLink --------- Co-authored-by: Paurikova2 <michaela.paurikova@dataquest.sk> * UFAL/CURL downloads issue - fix integration test --------- Co-authored-by: Paurikova2 <107862249+Paurikova2@users.noreply.github.com> Co-authored-by: Kasinhou <129340513+Kasinhou@users.noreply.github.com> Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk> Co-authored-by: Ondřej Košarko <ko_ok@centrum.cz> Co-authored-by: Amad Ul Hassan <hassan@ufal.mff.cuni.cz> Co-authored-by: Jozef Misutka <332350+vidiecan@users.noreply.github.com> Co-authored-by: Paurikova2 <michaela.paurikova@dataquest.sk>
1 parent 24fc2b0 commit 077a4a6

File tree

21 files changed

+425
-124
lines changed

21 files changed

+425
-124
lines changed

.github/actions/erase-db/action.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ runs:
2828
env:
2929
NAME: ${{ inputs.NAME }}
3030
run: |
31-
# # condition below was found by accident and appears to be useless. Investigate later.
32-
# be sure to have INSTANCE set
33-
# if [[ "x${NAME}" != "dspace-" ]]; then
34-
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
35-
# fi;
31+
echo "Removing volumes for $(docker volume ls --filter name="${NAME}_" -q)"
32+
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
3633

.github/actions/import-db/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ runs:
3030
3131
- uses: actions/checkout@v4
3232
with:
33-
repository: dataquest-dev/dspace-import
33+
repository: dataquest-dev/dspace-import-clarin
3434
ref: 'main'
3535
submodules: 'recursive'
36-
path: 'dspace-import'
36+
path: 'dspace-import-clarin'
3737

3838

3939
- name: stop and remove containers
4040
id: import
4141
shell: bash
42-
working-directory: dspace-import/scripts
42+
working-directory: dspace-import-clarin/scripts
4343
env:
4444
DATADIR: ${{ inputs.DATADIR }}
4545
DB5PORT: 15432
@@ -62,6 +62,7 @@ runs:
6262
echo Location of assetstore folder is empty. Not copping assetstore
6363
else
6464
docker cp ${{ inputs.ASSETSTORE }} dspace${{ inputs.INSTANCE }}:/dspace/
65+
docker exec -u root dspace${{ inputs.INSTANCE }} chown -R dspace:dspace /dspace/assetstore
6566
fi
6667
echo "====="
6768
cd ../

.github/workflows/build.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ jobs:
4949
NODE_OPTIONS: '--max-old-space-size=4096'
5050
# Project name to use when running "docker compose" prior to e2e tests
5151
COMPOSE_PROJECT_NAME: 'ci'
52-
# Docker Registry to use for Docker compose scripts below.
53-
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
54-
DOCKER_REGISTRY: ghcr.io
5552
strategy:
5653
# Create a matrix of Node versions to test against (in parallel)
5754
matrix:
@@ -125,14 +122,6 @@ jobs:
125122
path: 'coverage/dspace-angular/lcov.info'
126123
retention-days: 14
127124

128-
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
129-
- name: Login to ${{ env.DOCKER_REGISTRY }}
130-
uses: docker/login-action@v3
131-
with:
132-
registry: ${{ env.DOCKER_REGISTRY }}
133-
username: ${{ github.repository_owner }}
134-
password: ${{ secrets.GITHUB_TOKEN }}
135-
136125
# Using "docker compose" start backend using CI configuration
137126
# and load assetstore from a cached copy
138127
- name: Start DSpace REST Backend via Docker (for e2e tests)

.github/workflows/deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,48 @@ jobs:
109109
/bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://dev-5.pc:8$INSTANCE/repository/server/api)" != "200" ]]; do sleep 5; done'
110110
111111
112+
import-5:
113+
runs-on: dspace-dep-1
114+
if: inputs.IMPORT
115+
needs: deploy-5
116+
env:
117+
INSTANCE: '5'
118+
ENVFILE: /opt/dspace-envs/.env.dspace.dev-5
119+
steps:
120+
- uses: ./.github/actions/import-db
121+
with:
122+
INSTANCE: ${{ env.INSTANCE }}
123+
DATADIR: /opt/dspace-data/clarin-dspace-oxford/
124+
ASSETSTORE: /opt/dspace-data/clarin-dspace-oxford/assetstore/
125+
LOGDIR: /log/
126+
ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }}
127+
128+
- name: dspace basic command
129+
run: |
130+
export DNAME=dspace$INSTANCE
131+
docker logs -n 50 $DNAME
132+
133+
echo "dspace version:"
134+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace version"
135+
136+
echo "dspace cleanup:"
137+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace cleanup -v"
138+
139+
echo "dspace reindex solr:"
140+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace index-discovery -b"
141+
142+
echo "dspace reindex OAI-PMH:"
143+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace oai import -c"
144+
145+
echo "dspace checker:"
146+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace checker -v -l"
147+
148+
- name: dspace healthcheck
149+
run: |
150+
export DNAME=dspace$INSTANCE
151+
echo "dspace healthcheck:"
152+
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace healthcheck -v"
153+
112154
import-8:
113155
runs-on: dspace-dep-1
114156
if: inputs.IMPORT

build-scripts/run/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ popd
4848
echo "====="
4949
echo "Copy assetstore"
5050
docker cp assetstore dspace${INSTANCE}:/dspace/
51+
docker exec -u root dspace${INSTANCE} chown -R dspace:dspace /dspace/assetstore
5152

5253
echo "====="
5354
echo "Finished start.sh"

src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
115115
/**
116116
* The path to the Seznam dataset license content.
117117
*/
118-
LICENSE_PATH_SEZNAM_CZ = 'szn-dataset-license.html';
118+
LICENSE_PATH_SEZNAM_CZ = 'szn-dataset-licence.html';
119119

120120
/**
121121
* The content of the Seznam dataset license. Fetch from the static file.

src/app/item-page/clarin-files-section/clarin-files-section.component.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,33 @@
33
<h6><i class="fa fa-paperclip">&nbsp;</i>{{'item.page.files.head' | translate}}</h6>
44
<div class="pb-3">
55
<span class="pr-1">
6-
<a class="btn btn-download" (click)="setCommandline()" style="text-decoration: none"
6+
<a class="btn btn-download" (click)="openCommandModal(commandModal)" style="text-decoration: none"
77
*ngIf="canShowCurlDownload">
88
<i class="fa fa-download fa-3x" style="display: block">&nbsp;</i>
99
{{'item.page.download.button.command.line' | translate}}
1010
</a>
1111
</span>
12-
<div id="command-div" *ngIf="isCommandLineVisible">
13-
<pre class="command-pre">{{ command }}</pre>
14-
</div>
12+
13+
<ng-template #commandModal let-modal>
14+
<div class="modal-header">
15+
<h5 class="modal-title" id="commandModalTitle">{{'item.page.download.button.command.line' | translate}}</h5>
16+
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss()">
17+
<span aria-hidden="true">&times;</span>
18+
</button>
19+
</div>
20+
<div class="modal-body">
21+
<pre class="command-pre mb-0">{{ command }}</pre>
22+
</div>
23+
<div class="modal-footer">
24+
<button class="btn btn-outline-secondary" (click)="copyCommand()">
25+
<i class="fa" [ngClass]="commandCopied ? 'fa-check' : 'fa-clipboard'"></i>
26+
{{ commandCopied ? ('item.page.download.command.copied' | translate) : ('item.page.download.command.copy' | translate) }}
27+
</button>
28+
<button class="btn btn-secondary" (click)="modal.close()">
29+
{{'item.page.download.command.close' | translate}}
30+
</button>
31+
</div>
32+
</ng-template>
1533
<span>
1634
<a *ngIf="
1735
(totalFileSizes | async) > (downloadZipMinFileSize | async) &&

src/app/item-page/clarin-files-section/clarin-files-section.component.scss

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,17 @@ The styling file for the `clarin-files-section.component`
1717

1818
.command-pre {
1919
display: block;
20-
padding: 9.5px;
21-
margin: 0 0 10px;
20+
padding: 12px 16px;
21+
margin: 0;
2222
font-size: 13px;
23-
line-height: 1.428571429;
23+
line-height: 1.5;
24+
white-space: pre-wrap;
2425
word-break: break-all;
2526
word-wrap: break-word;
2627
background-color: #d9edf7;
2728
color: #3a87ad;
2829
border: 1px solid #ccc;
2930
border-radius: 4px;
30-
}
31-
32-
#command-div .repo-copy-btn {
33-
opacity: 0;
34-
-webkit-transition: opacity 0.3s ease-in-out;
35-
-o-transition: opacity 0.3s ease-in-out;
36-
transition: opacity 0.3s ease-in-out;
37-
}
38-
39-
#command-div:hover .repo-copy-btn, #command-div .repo-copy-btn:focus {
40-
opacity: 1;
41-
}
42-
43-
.repo-copy-btn {
44-
width: 20px;
45-
height: 20px;
46-
position: relative;
47-
display: inline-block;
48-
padding: 0 !important;
49-
}
50-
51-
.repo-copy-btn:before {
52-
content: " ";
53-
background-size: 13px 15px;
54-
background-repeat: no-repeat;
55-
background-color: red;
56-
display: inline-block;
57-
width: 13px;
58-
height: 15px;
59-
padding: 0 !important;
31+
max-height: 60vh;
32+
overflow-y: auto;
6033
}

0 commit comments

Comments
 (0)