Skip to content

Commit

Permalink
Merge pull request #409 from sajinieKavindya/master
Browse files Browse the repository at this point in the history
Fix artifact list not updating issue in UI when the group id and node ids are updated
  • Loading branch information
sajinieKavindya authored Sep 11, 2024
2 parents 55f3d83 + 33de490 commit 88bf213
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,12 @@ public LogConfigsResourceResponse fetchPaginatedLogConfigsResponse(String groupI
DelegatesUtil.logDebugLogs(Constants.LOG_CONFIGS, groupId, lowerLimit, upperLimit, order, orderBy, isUpdate);
int fromIndex = Integer.parseInt(lowerLimit);
int toIndex = Integer.parseInt(upperLimit);
boolean isUpdatedContent = Boolean.parseBoolean(isUpdate);
String prevResourceType = DelegatesUtil.getPrevResourceType();
LogConfigsResourceResponse logsResourceResponse = new LogConfigsResourceResponse();
logger.debug("prevSearch key :" + prevSearchKey + ", currentSearch key:" + searchKey);

if (isUpdatedContent || prevSearchKey == null || !(prevSearchKey.equals(searchKey))
|| !(prevResourceType.equals(resourceType))) {
searchedList = getSearchedLogConfigsResultsFromMI(groupId,
nodeList, searchKey, order, orderBy);
count = searchedList.size();
}
searchedList = getSearchedLogConfigsResultsFromMI(groupId,
nodeList, searchKey, order, orderBy);
count = searchedList.size();
LogConfigs paginatedList = getPaginationResults(searchedList, fromIndex, toIndex);
logsResourceResponse.setResourceList(paginatedList);
logsResourceResponse.setCount(count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,11 @@ public LogsResourceResponse getPaginatedLogsListResponse(String groupId, List<St
DelegatesUtil.logDebugLogs(resourceType, groupId, lowerLimit, upperLimit, order, orderBy, isUpdate);
int fromIndex = Integer.parseInt(lowerLimit);
int toIndex = Integer.parseInt(upperLimit);
boolean isUpdatedContent = Boolean.parseBoolean(isUpdate);
String prevResourceType = DelegatesUtil.getPrevResourceType();

logger.debug("prevSearch key :" + prevSearchKey + ", currentSearch key:" + searchKey);

if (isUpdatedContent || prevSearchKey == null || !(prevSearchKey.equals(searchKey))
|| !(prevResourceType.equals(resourceType))) {
searchedList = getSearchedLogsListFromMI(groupId, nodeList, searchKey, order, orderBy);
count = getLogsCount(searchedList);
}
searchedList = getSearchedLogsListFromMI(groupId, nodeList, searchKey, order, orderBy);
count = getLogsCount(searchedList);
LogsResourceResponse logsResourceResponse = new LogsResourceResponse();
LogList paginatedList = getPaginationResults(searchedList, fromIndex, toIndex);
logsResourceResponse.setResourceList(paginatedList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ public RolesResourceResponse fetchPaginatedRolesResponse(String groupId, String
DelegatesUtil.logDebugLogs(resourceType, groupId, lowerLimit, upperLimit, order, orderBy, isUpdate);
int fromIndex = Integer.parseInt(lowerLimit);
int toIndex = Integer.parseInt(upperLimit);
boolean isUpdatedContent = Boolean.parseBoolean(isUpdate);
String prevResourceType = DelegatesUtil.getPrevResourceType();
log.debug("prevSearch key :" + prevSearchKey + ", currentSearch key:" + searchKey);
if (isUpdatedContent || prevSearchKey == null || !(prevSearchKey.equals(searchKey))
|| !(prevResourceType.equals(resourceType))) {
searchedList = getSearchedRoles(groupId, searchKey, order, orderBy);
count = searchedList.size();
}
searchedList = getSearchedRoles(groupId, searchKey, order, orderBy);
count = searchedList.size();
RoleList paginatedList = getPaginatedRolesResultsFromMI(searchedList, fromIndex, toIndex);
RolesResourceResponse rolesResourceResponse = new RolesResourceResponse();
rolesResourceResponse.setResourceList(paginatedList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,12 @@ public UsersResourceResponse fetchPaginatedUsers(String groupId, String searchKe
DelegatesUtil.logDebugLogs(resourceType, groupId, lowerLimit, upperLimit, order, orderBy, isUpdate);
int fromIndex = Integer.parseInt(lowerLimit);
int toIndex = Integer.parseInt(upperLimit);
boolean isUpdatedContent = Boolean.parseBoolean(isUpdate);
String prevResourceType = DelegatesUtil.getPrevResourceType();

log.debug("prevSearch key :" + prevSearchKey + ", currentSearch key:" + searchKey);

if (isUpdatedContent || prevSearchKey == null || !(prevSearchKey.equals(searchKey))
|| !(prevResourceType.equals(resourceType))) {
allUserIds = getSearchedUsers(groupId, searchKey);
Arrays.sort(allUserIds);
count = allUserIds.length;
}
allUserIds = getSearchedUsers(groupId, searchKey);
Arrays.sort(allUserIds);
count = allUserIds.length;
Users paginatedUsers = getPaginatedUsersResultsFromMI(allUserIds, fromIndex, toIndex, groupId, order, orderBy);
UsersResourceResponse usersResourceResponse = new UsersResourceResponse();
usersResourceResponse.setResourceList(paginatedUsers);
Expand Down

0 comments on commit 88bf213

Please sign in to comment.