Skip to content

feat: Favorites filter for the task list & search - EXO-88376#630

Merged
Jihed525 merged 4 commits into
developfrom
backport/EXO-88376-favorites-filter
Jul 22, 2026
Merged

feat: Favorites filter for the task list & search - EXO-88376#630
Jihed525 merged 4 commits into
developfrom
backport/EXO-88376-favorites-filter

Conversation

@Jihed525

Copy link
Copy Markdown
Contributor

What

Backport of #619, #624, #628, #629 onto develop.

Adds a "Favorites only" filter for tasks (follow-up to Favorites #615 / EXO-88316), with the fixes that followed after real-world testing:

Backport notes

Cherry-picked the 4 commits onto develop. Two conflicts, both resolved:

Test

  • mvn -pl services -am -Dcheckstyle.skip=true -DskipTests install → BUILD SUCCESS
  • mvn -pl services -Dcheckstyle.skip=true -Dtest=TestTaskRestService test → 20 tests, 0 failures/errors

🤖 Generated with Claude Code

bmestrallet and others added 4 commits July 22, 2026 12:15
Adds a **"Favorites only"** filter for tasks — follow-up to Favorites
(#615 / EXO-88316), requested by @Samuel.Renault on task 88316.

- **UI:** a ⭐ *Favorites only* toggle in the Sort & Filter drawer's
**Filter** tab, grouped at the end just above "Show completed tasks",
and **persisted in localStorage** (like the completed-tasks toggle).
- **Backend:** a `favorite` query param on `GET /tasks/filter` that
resolves the current user's favorite **task** ids via `FavoriteService`
(object type `task`) and restricts the results (post-filter — no
`TaskService`/`TaskQuery` change).

- New unit test `testFilterFavoriteTasks`; `TestTaskRestService` /
`TestProjectRestService` updated — backend suite green.
- **Verified live on a 7.3 platform:** favorited 5 tasks → the ⭐ toggle
filters the board to exactly those 5, the request sends `favorite=true`,
and the toggle **persists across reload**.

Base: `feature/ai-contribution`. Board task: **EXO-88376**.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Benjamin <benjmestrallet@MacBook-Air.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Ali HAMDI <ahamdi@exoplatform.com>
(cherry picked from commit 9aed4ca)
…lter star - EXO-88376 (#624)

Follow-up to #619
([EXO-88376](https://community.exoplatform.com/portal/dw/tasks/taskDetail/88376))
addressing @Samuel.Renault's feedback on the "Favorites only" task
filter.

**1. Un-bookmarking a task did not remove it from the favorites-filtered
list — and it persisted after a full reload / filter reset.**
Root cause was front-end, in two parts:
- The list/board endpoint (`TaskRestService`) did **not** set `favorite`
on list rows (only `getTaskById` did). The 3-dots favorite menu then
resolved the state lazily and, when stale/false, **inverted the toggle
to `addFavorite` (POST)** instead of DELETE — so the favorite was never
removed and correctly persisted across reload.
- The list/board views had **no favorite-change listener**, so an
un-bookmark never removed the row.

Fixes:
- **`TaskRestService.filterTasks`**: compute the user's favorite task-id
set **once** (batched via
`favoriteService.getFavoriteItemsByCreatorAndType`, reused for both
filtering and flagging — no N+1) and set `favorite` on every returned
row. Now the menu never guesses → un-bookmark always DELETEs. New
`getFavoriteTaskIds` helper. `getTaskDetails` untouched.
- **`TasksDashboard.vue` / `TasksViewDashboard.vue`**: listen for
`metadata.favorite.updated` and splice the un-bookmarked task out when
the favorites filter is active (no-op otherwise).

**2. Favorite icon color.** The drawer "Favorites only" star was a
filled `fas fa-star` with no color (read as emphasized). Now `far
fa-star icon-default-color` (neutral grey outline, matching the other
filter rows). Bonus: the per-task menu active star `warning--text` →
platform amber `yellow--text text--darken-2`.

- Backend `TestTaskRestService` extended (rows come back
`favorite=true`/`false` correctly) — green.
- **Verified live** on a 7.3.x-ai-contribution build: favorite a task →
the `/tasks/filter` row carries `favorite:true`; un-bookmark → `DELETE
…/favorites/task/{id}` (204) → a **fresh** `/tasks/filter?favorite=true`
(= a full reload) returns **empty**, and the all-tasks row flips to
`favorite:false`. Front-end listener + grey star confirmed in the
deployed bundles.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Benjamin <benjmestrallet@MacBook-Air.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit e1e16f7)
…ws filtered tasks) - EXO-88376 (#628)

Follow-up to #619/#624 addressing @jihed_chabbeh's report on
[EXO-88376](https://community.exoplatform.com/portal/dw/tasks/taskDetail/88376):
after a page **reload**, the "Favorites only" toggle is restored ON but
the displayed list is not filtered (shows all tasks).

## Root cause
In `TasksDashboard.vue` `created()`,
`this.getTasksByPrimary(this.primaryFilter)` fires the initial
`searchTasks()` **before** the persisted filters are restored from
localStorage. `searchTasks()` reads `this.filterTasks`, whose `favorite`
is still the default `false` at that moment; the persisted value is only
restored a few lines later. So the toggle ends up ON while the initial
`/tasks/filter` request went out with `favorite=` (empty) → unfiltered
list. (The restored `groupBy`/`orderBy`/`showCompletedTasks` were also
applied after the first fetch — same ordering flaw.)

## Fix
Move the localStorage-restore block **above** `getTasksByPrimary(...)`
in `created()`, so the first fetch honors the persisted filters.
Confirmed the only primary filter on load is `ALL`, whose branch does
not clobber `favorite` and re-reads `groupBy`/`orderBy` from the same
key — so no regression to the date-primary filters (which force
ungrouped and are only reached via toolbar events, never on load).

`TasksViewDashboard.vue` (project view) needs no change — it does not
persist the favorite filter (only group/order/completed), so it has no
restore-on-reload mismatch.

## Verification
Built the task WAR and verified live on a 7.3.x-ai-contribution build:
with the favorites filter persisted, after a page reload the **initial**
`GET /tasks/filter` now carries `favorite=true` (was `favorite=` before
the fix) → the list is filtered from the first render. Front-end only,
lint clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

(cherry picked from commit 7f7e53c)
@Jihed525
Jihed525 requested a review from ahamdi July 22, 2026 11:22
@sonarqubecloud

Copy link
Copy Markdown

@Jihed525
Jihed525 merged commit 4e0a71d into develop Jul 22, 2026
11 checks passed
@Jihed525
Jihed525 deleted the backport/EXO-88376-favorites-filter branch July 22, 2026 13:48
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.

3 participants