From dc646c10960d8afd27ff230b7b374a763f529d44 Mon Sep 17 00:00:00 2001 From: Shefali Bisht Date: Mon, 14 Aug 2023 12:37:54 +0530 Subject: [PATCH 1/2] bug:[CORE-1257]region sort breaks --- .../api/compliance/repository/ComplianceRepositoryImpl.java | 4 ---- .../pacman/api/commons/repo/ElasticSearchRepository.java | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java b/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java index 448e2570c5..1ca9de5901 100644 --- a/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java +++ b/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java @@ -466,10 +466,6 @@ public ResponseWithOrder getIssuesFromES(APIRequest request) throws DataExceptio } mustFilter.put(CommonUtils.convertAttributetoKeyword(TYPE), Constants.ISSUE); - /*if (null == filters.get("issueStatus.keyword")) { - issueStatus.add(OPEN); - }*/ - if (null != filters.get("include_exempt") && ("yes".equalsIgnoreCase((String) filters.get(INCLUDE_EXEMPT)))) { issueStatus.add(EXEMPTED); } diff --git a/commons/pac-api-commons/src/main/java/com/tmobile/pacman/api/commons/repo/ElasticSearchRepository.java b/commons/pac-api-commons/src/main/java/com/tmobile/pacman/api/commons/repo/ElasticSearchRepository.java index 47b2335bb8..2d68a66a8a 100644 --- a/commons/pac-api-commons/src/main/java/com/tmobile/pacman/api/commons/repo/ElasticSearchRepository.java +++ b/commons/pac-api-commons/src/main/java/com/tmobile/pacman/api/commons/repo/ElasticSearchRepository.java @@ -1158,6 +1158,12 @@ else if(fieldName.equalsIgnoreCase("_entitytype.keyword")){ innerScriptMap1.put("order", sortOrder); sortMap.put("_script",innerScriptMap1); list.add(sortMap); + }else if(fieldName.equalsIgnoreCase("region.keyword")){ + Map mappedSort=new HashMap<>(); + mappedSort.put("unmapped_type","string"); + mappedSort.put("order", sortOrder); + sortMap.put(fieldName, mappedSort); + list.add(sortMap); }else{ Map sortOrderMap = new HashMap<>(); sortOrderMap.put(ORDER, sortOrder); From 4048066ca07a3ef25ea4f4147edda43bbbf7ee47 Mon Sep 17 00:00:00 2001 From: Shefali Bisht Date: Mon, 14 Aug 2023 12:54:53 +0530 Subject: [PATCH 2/2] bug:[CORE-1260]autofix scheduled status changes to a consistent format i.e. string --- .../api/compliance/repository/ComplianceRepositoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java b/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java index 1ca9de5901..a6151f3a3e 100644 --- a/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java +++ b/api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/repository/ComplianceRepositoryImpl.java @@ -1588,7 +1588,7 @@ private List> getIssueList(Map iss issue.put(POLICYCATEGORY_DISPALY_NAME, sourceMap.get(POLICY_CATEGORY)); if(sourceMap.get(AUTOFIX_PLANNED)!=null){ - issue.put(AUTOFIX_PLANNED,sourceMap.get(AUTOFIX_PLANNED)); + issue.put(AUTOFIX_PLANNED,sourceMap.get(AUTOFIX_PLANNED).toString()); }else{ issue.put(AUTOFIX_PLANNED,"false"); }