-
Notifications
You must be signed in to change notification settings - Fork 4
BEV-75: Add deletion approver #57
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
23d6e02
Add PillarDeleteFileApprover to ReferenceSettings
Bohlski 562a912
Add integrity endpoint exposing pillar details
Bohlski d385dcd
Add frontend stuff to display pillar details table
Bohlski 0dd0537
Add pillar details dto and a small serialization test
Bohlski 019cbcd
Small changes from PR
Bohlski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
63 changes: 63 additions & 0 deletions
63
...egrity-service/src/main/java/org/bitrepository/integrityservice/web/PillarDetailsDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| package org.bitrepository.integrityservice.web; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| public class PillarDetailsDto implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private String pillarID; | ||
| private String pillarName; | ||
| private String pillarType; | ||
| private String pillarDeleteFileApprover; | ||
|
|
||
| public PillarDetailsDto() {} | ||
|
|
||
| public PillarDetailsDto(String pillarID, String pillarName, String pillarType, String pillarDeleteFileApprover) { | ||
| this.pillarID = pillarID; | ||
| this.pillarName = pillarName; | ||
| this.pillarType = pillarType; | ||
| this.pillarDeleteFileApprover = pillarDeleteFileApprover; | ||
| } | ||
|
|
||
| public String getPillarID() { | ||
| return pillarID; | ||
| } | ||
|
|
||
| public void setPillarID(String pillarID) { | ||
| this.pillarID = pillarID; | ||
| } | ||
|
|
||
| public String getPillarName() { | ||
| return pillarName; | ||
| } | ||
|
|
||
| public void setPillarName(String pillarName) { | ||
| this.pillarName = pillarName; | ||
| } | ||
|
|
||
| public String getPillarType() { | ||
| return pillarType; | ||
| } | ||
|
|
||
| public void setPillarType(String pillarType) { | ||
| this.pillarType = pillarType; | ||
| } | ||
|
|
||
| public String getPillarDeleteFileApprover() { | ||
| return pillarDeleteFileApprover; | ||
| } | ||
|
|
||
| public void setPillarDeleteFileApprover(String pillarDeleteFileApprover) { | ||
| this.pillarDeleteFileApprover = pillarDeleteFileApprover; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "PillarDetailsDTO{" + | ||
| "pillarID='" + pillarID + '\'' + | ||
| ", pillarName='" + pillarName + '\'' + | ||
| ", pillarType=" + pillarType + | ||
| ", pillarDeleteFileApprover='" + pillarDeleteFileApprover + '\'' + | ||
| '}'; | ||
| } | ||
| } |
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
24 changes: 24 additions & 0 deletions
24
...ty-service/src/test/java/org/bitrepository/integrityservice/web/PillarDetailsDtoTest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package org.bitrepository.integrityservice.web; | ||
|
|
||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
| import org.testng.annotations.Test; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import static org.testng.Assert.*; | ||
|
|
||
| public class PillarDetailsDtoTest { | ||
| private final ObjectMapper objectMapper = new ObjectMapper(); // Use ObjectMapper for JSON | ||
|
|
||
| @Test | ||
| void testSerialization() throws IOException { | ||
| PillarDetailsDto dto = new PillarDetailsDto("id", "pillar", "TYPE", "admin"); | ||
|
|
||
| String jsonOutput = objectMapper.writeValueAsString(dto); | ||
|
|
||
| assertTrue(jsonOutput.contains("\"pillarID\":\"id\"")); | ||
| assertTrue(jsonOutput.contains("\"pillarName\":\"pillar\"")); | ||
| assertTrue(jsonOutput.contains("\"pillarType\":\"TYPE\"")); | ||
| assertTrue(jsonOutput.contains("\"pillarDeleteFileApprover\":\"admin\"")); | ||
| } | ||
| } |
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
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
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
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
27 changes: 27 additions & 0 deletions
27
bitrepository-webclient/src/main/webapp/static/js/dashboard_components/pillar-details.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /** | ||
| * Appends the information from the pillar details JSON as rows to a table with the given ID. | ||
| * @param pillarDetails JSON containing the pillar details to build the rows from | ||
| * @param tableBodyId ID of the table to append the rows to | ||
| */ | ||
| function fillInPillarDetailsTable(pillarDetails, tableBodyId) { | ||
| pillarDetails.forEach((detail) => { | ||
| $(tableBodyId).append(makePillarDetailsRow(detail)); | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Make a row in the pillar details table given the pillar details JSON. | ||
| * @param details Pillar details from ReferenceSettings-file as JSON | ||
| * @returns {string} HTML table row containing the pillar details | ||
| */ | ||
| function makePillarDetailsRow(details) { | ||
| let html = ""; | ||
| html += "<tr>"; | ||
| html += "<td>" + details.pillarID + "</td>"; | ||
| html += "<td>" + details.pillarName + "</td>"; | ||
| html += "<td>" + details.pillarType + "</td>"; | ||
| html += "<td>" + details.pillarDeleteFileApprover + "</td>"; | ||
| html += "</tr>"; | ||
| return html; | ||
| } | ||
|
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.