Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1051: SB-RC: Added Fix for view template in search #343

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
sudo rm -rf /usr/local/.ghcup/ghc/9.6.4
- name: Check space before tests
run: df -h
- name: Install Docker Compose
run: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
# debug step
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ private JsonNode searchEntity(JsonNode inputJson, ISearchService service, String
ViewTemplate viewTemplate = viewTemplateManager.getViewTemplate(inputJson);
if (viewTemplate != null) {
ViewTransformer vTransformer = new ViewTransformer();
resultNode.set(ENTITY_LIST, vTransformer.transform(viewTemplate, resultNode.get(ENTITY_LIST)));
String entityName = resultNode.fields().next().getKey();
ObjectNode transformerInput = JsonNodeFactory.instance.objectNode().set(entityName, resultNode.get(entityName).get(ENTITY_LIST));
((ObjectNode) resultNode.get(entityName)).set(ENTITY_LIST, vTransformer.transform(viewTemplate, transformerInput).get(entityName));
}
// Search is tricky to support LD. Needs a revisit here.
logger.debug("searchEntity ends");
Expand Down Expand Up @@ -754,7 +756,9 @@ public JsonNode getAuditLog(JsonNode inputJson, String userId) throws Exception
ViewTemplate viewTemplate = viewTemplateManager.getViewTemplate(inputJson);
if (viewTemplate != null) {
ViewTransformer vTransformer = new ViewTransformer();
resultNode.set(ENTITY_LIST, vTransformer.transform(viewTemplate, resultNode.get(ENTITY_LIST)));
String entityName = resultNode.fields().next().getKey();
ObjectNode transformerInput = JsonNodeFactory.instance.objectNode().set(entityName, resultNode.get(entityName).get(ENTITY_LIST));
((ObjectNode) resultNode.get(entityName)).set(ENTITY_LIST, vTransformer.transform(viewTemplate, transformerInput).get(entityName));
}
logger.debug("get audit log ends");

Expand Down
Loading