Skip to content

Refactor license contract page and improve collection display#115

Merged
kosarko merged 2 commits intocontract_pagefrom
copilot/sub-pr-114
Mar 19, 2026
Merged

Refactor license contract page and improve collection display#115
kosarko merged 2 commits intocontract_pagefrom
copilot/sub-pr-114

Conversation

Copy link

Copilot AI commented Mar 19, 2026

LicenseContractPageComponent supports two modes: single-collection (when collectionId query param is present) and list mode (paginated authorized collections when collectionId is absent). Previously, an invalid collectionId silently rendered nothing.

Problem description

  • Single-collection mode had no error or loading states — a bogus/missing collectionId produced a blank UI with no feedback.
  • List mode lacked pagination and showed no loading/error/empty states.

Analysis

Single-collection error handling: The tap feeding collectionRD$ was placed after the filter that gates on payload presence, so failed/loading RemoteData states never reached the template. Moving tap before filter propagates all states; the filter continues to guard the license switchMap.

List mode: Uses PaginationService.getFindListOptions + CollectionDataService.getAuthorizedCollection to produce a paginated collectionsRD$ observable. Pagination state is cleared on destroy.

Template changes (single-collection mode):

<ng-container *ngVar="(collectionRD$ | async) as collectionRD">
  <ds-error *ngIf="collectionRD?.hasFailed" message="{{'error.collection' | translate}}"></ds-error>
  <ds-themed-loading *ngIf="!collectionRD || collectionRD?.isLoading" ...></ds-themed-loading>
  <div class="card-body" *ngIf="collectionRD?.payload">...</div>
</ng-container>

Test isolation fix: findById spy return value is reset to success in beforeEach to prevent cross-test contamination from Jasmine's randomized test ordering. A new test covers the bogus collectionId path using createFailedRemoteDataObject$.

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

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…n mode

Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 19, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4294 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97731922 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1282315886072659097,8650986329271662828,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-97731922 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications http://localhost:9876/?id=97731922 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4632 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-32135850 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14486129391903141193,1954373989577931333,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor license contract page and improve collection display Refactor license contract page and improve collection display Mar 19, 2026
Copilot AI requested a review from kosarko March 19, 2026 17:15
@kosarko kosarko marked this pull request as ready for review March 19, 2026 21:00
@kosarko kosarko merged commit dc3618d into contract_page Mar 19, 2026
7 checks passed
kosarko added a commit that referenced this pull request Mar 20, 2026
…larin-dspace#114)

* Display contract even if no collectionId given

lists all authorized collections and their licenses

* Proper cleanup

replaced the nested manual subscriptions in
license-contract-page.component.ts with a single RxJS pipeline using
tap(...), switchMap(...), and takeUntil(this.destroy$), then completed
cleanup in ngOnDestroy().

* fix non unique ids

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Guard license stream with EMPTY and stricter check

Guard license stream with EMPTY and stricter check

* Refactor license contract page and improve collection display (#115)

* Initial plan

* Add error/loading handling for bogus collectionId in single-collection mode

Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: amadulhaxxani <hassan@ufal.mff.cuni.cz>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>
port-pr bot pushed a commit that referenced this pull request Mar 20, 2026
…larin-dspace#114)

* Display contract even if no collectionId given

lists all authorized collections and their licenses

* Proper cleanup

replaced the nested manual subscriptions in
license-contract-page.component.ts with a single RxJS pipeline using
tap(...), switchMap(...), and takeUntil(this.destroy$), then completed
cleanup in ngOnDestroy().

* fix non unique ids

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Guard license stream with EMPTY and stricter check

Guard license stream with EMPTY and stricter check

* Refactor license contract page and improve collection display (#115)

* Initial plan

* Add error/loading handling for bogus collectionId in single-collection mode

Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: amadulhaxxani <hassan@ufal.mff.cuni.cz>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kosarko <1842385+kosarko@users.noreply.github.com>
(cherry picked from commit 0ca1429)
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.

2 participants