Skip to content

fix: reload list after workflow action - #204

Open
amadulhaxxani wants to merge 1 commit into
clarin-v7from
172-ui-quirks-when-claimingapproving-items
Open

amadulhaxxani wants to merge 1 commit into
clarin-v7from
172-ui-quirks-when-claimingapproving-items

Conversation

@amadulhaxxani

Copy link
Copy Markdown

Problem description

After a workflow action in MyDSpace (claim/approve/reject), the list is not refreshed. After the final approve the count stays wrong (e.g. "1-7 of 7" while the server has 6), and after approving a step only the "Approved" card is shown, the next task appears only after leaving the page and coming back.

Analysis

After an action only that one row is swapped and contentChange is emitted. SearchComponent.onContentChange re-fetched only the filters, never the results, so the count and new tasks stayed stale. The fix re-runs the search with useCachedVersionIfAvailable = false in onContentChange. retrieveSearchResults got an optional parameter that defaults to the old value, so other searches are unaffected. Added 2 unit tests in search.component.spec.ts.

Note: the "Approved"/"Declined" card is now replaced by the reloaded list, the success toast still shows.

Sync verification

N/A — no .json5 files changed.

Copilot review

  • Requested review from Copilot

re-run the search without cache on contentChange so the count adn the next workflow task show up right after claim/approve/reject
Copilot AI balanced review requested due to automatic review settings November 23, 2026 15:21
@amadulhaxxani amadulhaxxani linked an issue Nov 23, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Approving a task can leave users on an empty page without pagination controls, while cached search variants can restore stale results and totals.

2 open issues
What changed in this PR

This PR updates the shared search component to reload MyDSpace task lists and counts after claim, approve, or reject actions.

Changes:

  • Re-runs searches without cached results when content changes, alongside the existing filter refresh.
  • Preserves normal search caching and adds two unit tests covering cache behavior and refresh notifications.
File Description
src/​app/​shared/​search/​search.component.ts Adds result reloading on content changes and an optional cache override.
src/​app/​shared/​search/​search.component.spec.ts Tests normal cache reuse and cache bypass after content changes.

Review effort: Balanced

* @param $event
*/
public onContentChange($event: any) {
this.retrieveSearchResults(this.lastSearchOptions, false);
* @param $event
*/
public onContentChange($event: any) {
this.retrieveSearchResults(this.lastSearchOptions, false);
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.

UI quirks when claiming/approving items

2 participants