Skip to content

UFAL/Release hotfix 2026 02 26 - merge PR#1225

Merged
milanmajchrak merged 16 commits intocustomer/lindatfrom
ufal/release-hotfix-2026-02-26
Feb 26, 2026
Merged

UFAL/Release hotfix 2026 02 26 - merge PR#1225
milanmajchrak merged 16 commits intocustomer/lindatfrom
ufal/release-hotfix-2026-02-26

Conversation

@milanmajchrak
Copy link
Collaborator

Problem description

Analysis

(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.)

Problems

(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.)

Sync verification

If en.json5 or cs.json5 translation files were updated:

  • Run yarn run sync-i18n -t src/assets/i18n/cs.json5 -i to synchronize messages, and changes are included in this PR.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Paurikova2 and others added 16 commits February 10, 2026 10:49
* used stahnout instead of odstranit

* Update confirmation text for withdrawal action

* removed two empty lines

* added empty lines as in origin

* removed spaces

---------

Co-authored-by: Kasinhou <129340513+Kasinhou@users.noreply.github.com>
…on (#1209)

* renamed dspace-import to dspace-import-clarin

* removed unwanted changes
* Preserve parameters when creating similar process

* Extract duplicate deep copy logic into helper

* Fix redundant parameter logic prevent empty accumulation
* Override pagesize and display all versions

* Changed hardcoded variable

---------

Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk>
(cherry picked from commit 21521d1)
(cherry picked from commit c296d87)
#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>
Use dspace-import-clarin path instead of dspace-import
Removed unnecessary comments and improved logging for volume removal.
#1222)

* Use `dspace:dspace` permissions for the assetstore - not ubuntu:ubuntu

* Change permissions as root
…dpoint (#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>
Copilot AI review requested due to automatic review settings February 26, 2026 09:15
@milanmajchrak milanmajchrak merged commit 077a4a6 into customer/lindat Feb 26, 2026
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles a set of hotfixes across the UI, static-license content, and deployment automation. It adds a new Seznam dataset license static page (EN/CS), improves the “download via command line” UX on item pages, adjusts process form parameter handling, and updates CI/CD scripts and workflows.

Changes:

  • Add Seznam dataset license static HTML pages (EN + CS) and update the license agreement component to reference them.
  • Improve item file download-by-command-line UX (modal + copy-to-clipboard) and update related i18n keys + unit tests.
  • Update process form/parameters behavior, static page OAI link rewriting, and deployment/import scripts & workflows.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/static-files/szn-dataset-licence.html New EN static license page content.
src/static-files/cs/szn-dataset-licence.html New CS static license page content.
src/assets/i18n/en.json5 Adds new UI strings (metadata QA label + command modal strings).
src/assets/i18n/cs.json5 Adds CS translations for new UI strings.
src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts Stabilizes tests by flushing debounce timers via fakeAsync/tick.
src/app/static-page/static-page.component.ts Rewrites OAI links in loaded static HTML based on REST config.
src/app/static-page/static-page.component.spec.ts Adds tests for the OAI link rewrite behavior.
src/app/process-page/form/process-parameters/process-parameters.component.ts Attempts to preserve initial parameters via deep-copy and modified reset logic.
src/app/process-page/form/process-form.component.ts Adds onScriptSelect handler to change script-selection behavior.
src/app/process-page/form/process-form.component.html Switches inline select handler to onScriptSelect.
src/app/item-page/simple/field-components/clarin-item-versions-field/clarin-item-versions-field.component.ts Fetches more versions and caches computed view-model via shareReplay.
src/app/item-page/clarin-files-section/clarin-files-section.component.ts Replaces inline command display with modal + clipboard copy; improves curl command generation.
src/app/item-page/clarin-files-section/clarin-files-section.component.spec.ts Expands curl command generation test coverage.
src/app/item-page/clarin-files-section/clarin-files-section.component.scss Updates command styling for modal layout/scrolling.
src/app/item-page/clarin-files-section/clarin-files-section.component.html Adds ng-bootstrap modal template with copy/close actions.
src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts Updates Seznam dataset license path to the new static filename.
build-scripts/run/start.sh Ensures assetstore ownership inside container after copy.
.github/workflows/deploy.yml Adds import job for instance 5 with basic post-import commands + healthcheck.
.github/workflows/build.yml Removes DOCKER_REGISTRY env and docker registry login step from CI workflow.
.github/actions/import-db/action.yml Switches import repo/path and fixes assetstore ownership after copy.
.github/actions/erase-db/action.yml Adds logging and modifies volume removal step.

Comment on lines +72 to +79
onScriptSelect(script: Script): void {
this.selectedScript = script;
// Clear parameters if we're not creating from an existing process
// (i.e., when no existing parameters or when switching to a different script)
if (!this.parameters) {
this.parameters = [];
}
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters is initialized to an empty array, so onScriptSelect never clears it. Because [initialParams] then becomes [], the child ds-process-parameters treats it as “hasValue” and won’t initialize mandatory script parameters on script change (previous behavior relied on setting parameters = undefined). Consider setting parameters to undefined/null when switching scripts unless you are explicitly loading parameters from an existing process, or change the child component to treat an empty array as “no initial params”.

Copilot uses AI. Check for mistakes.
Comment on lines 42 to 66
@@ -51,7 +52,17 @@ export class ProcessParametersComponent implements OnChanges {
*/
ngOnChanges(changes: SimpleChanges): void {
if (changes.script) {
this.initParameters();
// Only reset parameters if we don't have initial parameters to preserve
if (!hasValue(this.initialParams)) {
this.initParameters();
} else {
// If we have initial parameters, preserve them with deep copy
this.parameterValues = this.deepCopyParameters(this.initialParams);
// Only add an empty parameter if the list is empty or doesn't have a trailing empty parameter
if (this.parameterValues.length === 0 || hasValue(this.parameterValues[this.parameterValues.length - 1].name)) {
this.addParameter();
}
}
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasValue(this.initialParams) is true for an empty array, which makes the component skip initializeParameter() and therefore not populate mandatory parameters when initialParams is [] (common when the parent default is []). If the intent is “preserve only when there are actual params”, use isNotEmpty(this.initialParams) or an explicit this.initialParams?.length > 0 check in ngOnInit/ngOnChanges/initParameters.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +35
const restBase = this.appConfig?.rest?.baseUrl;
const oaiUrl = restBase ? new URL('/server/oai', restBase).href : '/server/oai';
htmlContent = htmlContent.replace(/href="\/server\/oai/gi, 'href="' + oaiUrl);
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rewrite hardcodes /server/oai, ignoring the configured REST namespace (appConfig.rest.nameSpace). In deployments where the REST API is exposed under a different namespace (e.g. /repository/server), this will generate broken OAI links. Build the OAI path from this.appConfig.rest.nameSpace (or derive it from rest.baseUrl) instead of hardcoding /server.

Copilot uses AI. Check for mistakes.
Comment on lines +9206 to +9208
"item.page.download.command.copy": "Kopírovat",
"item.page.download.command.copied": "Zkopírováno!",
"item.page.download.command.close": "Zavřít",
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In cs.json5, most keys are preceded by a commented English source string (// "key": "English"). These newly added keys don’t include that comment, which makes translations harder to maintain. Please add the commented English lines for the 3 new item.page.download.command.* entries for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +32
echo "Removing volumes for $(docker volume ls --filter name="${NAME}_" -q)"
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This echo line has unescaped double quotes inside a double-quoted string (within the $(...)), which will break shell parsing and cause the action step to fail. Use single quotes for the --filter argument or escape the inner quotes, e.g. build the volume list into a variable first and echo that variable.

Suggested change
echo "Removing volumes for $(docker volume ls --filter name="${NAME}_" -q)"
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
VOLUMES=$(docker volume ls --filter "name=${NAME}_" -q)
echo "Removing volumes for ${VOLUMES}"
docker volume rm ${VOLUMES} || true

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants