Skip to content

Conversation

@liferay-continuous-integration
Copy link
Collaborator

Forwarded from: liferay-frontend#5127 (Took 1 ci:forward attempt in 45 seconds)
Console

@thektan
@liferay-frontend

Original pull request comment:
Bug Ticket: https://liferay.atlassian.net/browse/LPD-68453


This fixes the clear filter buttons (in the active filters bar/empty state) to clear the pre-loaded filter. This was previously mutating the object so the component wasn't re-rendering so now it returns a new object. This was also how the logic worked before.

Previously the dispatch looked like:

		viewsDispatch({
			type: VIEWS_ACTION_TYPES.UPDATE_FILTERS,
			value: filters.map((filter) => ({
				...filter,
				active: false,
				odataFilterString: undefined,
				selectedData: undefined,
			})),
		});

When a filter is active on initial load due to `preloadedData`, clicking the "Clear Filters" button fails to clear the filter from the UI if the user has not interacted with it first.

The `deactivateFilter` utility function was directly mutating the filter object, which prevented React from detecting a state change and re-rendering the UI. The function is now updated to return a new, immutable object, ensuring React sees the change and updates the UI correctly.
In the filter resume dropdown, if you unchecked all the selections and then clicked "Delete Filter", the filter resume label would still show for example: "Color:".

This is because `setFilter` needs to be able to also set `active: false` but `activateFilter` was always setting `active: true`
When clearing a filter, the history wouldn't be pushed properly and would lead to issues like
- The back history button getting stuck on the same state
- Unable to move back or forward to a state where a filter was removed
@liferay-continuous-integration
Copy link
Collaborator Author

✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutes

Ran com.liferay.source.formatter at released version 1.0.1545.

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 78a6ca4c2979693076ee386c488ca64ed9999dc8

Sender Branch:

Branch Name: LPD-68453_FixFilterClear
Branch GIT ID: 13d91610f462a19ae56d27744f90cc291a047900

1 out of 1 jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator Author

To conserve resources, the PR Tester does not automatically run for forwarded pull requests.

@liferay-continuous-integration
Copy link
Collaborator Author

✔️ ci:test:stable - 11 out of 11 jobs passed

❌ ci:test:relevant - 14 out of 16 jobs passed in 1 hour 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 78a6ca4c2979693076ee386c488ca64ed9999dc8

Upstream Comparison:

Branch GIT ID: 2018e7596b60007f382316cc000ce88d1994c6fa
Jenkins Build URL: EE Development Acceptance (master) - 195 - 2025-10-16[12:39:48]

ci:test:stable - 11 out of 11 jobs PASSED
11 Successful Jobs:
    ci:test:relevant - 14 out of 16 jobs PASSED

    2 Failed Jobs:

    14 Successful Jobs:
      For more details click here.

      Failures unique to this pull:

      For upstream results, click here.

      Test bundle downloads:

      @brianchandotcom
      Copy link
      Owner

      Merged. Thank you.
      View total diff: 3fcdea4...e6ff7e1

      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