added loadActiveFilters function to retain sort order#2153
Open
cstarcher wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes initial submission list sort retention by loading the user’s active filter state before the submission list columns are processed, so the previously selected sort column/direction can be applied during initial render.
Changes:
- Added a
loadActiveFilters()helper that fetches and hydrates$scope.activeFiltersfrom theactive-filtersendpoint. - Included
loadActiveFilters()in the controller’s initial$q.all(...)readiness gate so sort metadata is available beforeprocessUpdate(...)runs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
28
to
+44
| $scope.activeFilters = new NamedSearchFilterGroup(); | ||
|
|
||
| var loadActiveFilters = function () { | ||
| return WsApi.fetch(apiMapping.NamedSearchFilterGroup.instantiate).then(function (response) { | ||
| var apiRes = angular.fromJson(response.body); | ||
|
|
||
| if (apiRes.payload) { | ||
| var keys = Object.keys(apiRes.payload); | ||
| var regex = /^NamedSearchFilterGroup\b/; | ||
|
|
||
| for (var i = 0; i < keys.length; i++) { | ||
| if (keys[i].match(regex)) { | ||
| angular.extend($scope.activeFilters, apiRes.payload[keys[i]]); | ||
| break; | ||
| } | ||
| } | ||
| } |
Comment on lines
+30
to
+43
| var loadActiveFilters = function () { | ||
| return WsApi.fetch(apiMapping.NamedSearchFilterGroup.instantiate).then(function (response) { | ||
| var apiRes = angular.fromJson(response.body); | ||
|
|
||
| if (apiRes.payload) { | ||
| var keys = Object.keys(apiRes.payload); | ||
| var regex = /^NamedSearchFilterGroup\b/; | ||
|
|
||
| for (var i = 0; i < keys.length; i++) { | ||
| if (keys[i].match(regex)) { | ||
| angular.extend($scope.activeFilters, apiRes.payload[keys[i]]); | ||
| break; | ||
| } | ||
| } |
| var rowFilterTitle = "Exclude"; | ||
|
|
||
| var ready = $q.all([SubmissionListColumnRepo.ready(), ManagerSubmissionListColumnRepo.ready(), EmailTemplateRepo.ready(), FieldPredicateRepo.ready(), userSettings.ready()]); | ||
| var ready = $q.all([SubmissionListColumnRepo.ready(), ManagerSubmissionListColumnRepo.ready(), EmailTemplateRepo.ready(), FieldPredicateRepo.ready(), userSettings.ready(), loadActiveFilters()]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #1959
Type of Change
AI Usage Disclosure
AI Tool(s) Used Including Version:
ChatGPT 5.4 mini
Nature of Use:
Additional Description:
Used to identify and solve the problem.