Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4e0b61c
The modal pop-up is now using the newPager for the ALL <tr> of the pi…
m-atlantis Jul 4, 2022
ffb3635
Moved the link to the modal for all pillars to the header of the tabl…
m-atlantis Jul 5, 2022
cc8eb17
New sorting algorithm used to ensure correct sorting of file-names.
m-atlantis Jul 5, 2022
2ac8ccd
Now able to copy a file ID to clipboard by clicking on it.
m-atlantis Jul 5, 2022
061d8d1
Searchbar and table head is now using position:sticky to stay at thei…
m-atlantis Jul 6, 2022
8656a01
Removed modal footer. Added a 'no results found' <p> tag that is show…
m-atlantis Jul 6, 2022
989058c
Added rest-end points for the 'all pillars' modals.
m-atlantis Jul 6, 2022
cc33329
Added new modal to all links. Need to clean up and then test on a dav…
m-atlantis Jul 7, 2022
7ea67a9
Did some cleanup in the integrity-service.html file.
m-atlantis Jul 7, 2022
ea37ed9
Cleaned up code, and made it so that the table header of the integrit…
m-atlantis Jul 8, 2022
4187396
Fixed small issues that were pointed out in the pull request.
m-atlantis Aug 4, 2022
4134b2a
Created a linebreak.
m-atlantis Aug 4, 2022
81b5786
Fixed an issue causing the /getAllFileIDs/ REST endpoint to return wr…
m-atlantis Aug 16, 2022
01dca31
Created a new method that returns a List<String> from an IntegrityIss…
m-atlantis Aug 16, 2022
dfb3202
Now correctly reads local files and populating Modals.
m-atlantis Aug 18, 2022
2395a02
Started implementing paging.
m-atlantis Aug 18, 2022
27ee2b5
Now should correctly show the files for a single pillar.
m-atlantis Aug 19, 2022
a5b7782
Now also correctly shows missing files, etc.
m-atlantis Aug 19, 2022
ca20927
Paging works for single pillar content.
m-atlantis Aug 22, 2022
cee86ea
Small style change to the modal <p> showing page / total pages.
m-atlantis Aug 22, 2022
793e92d
Everything seems to be working now. Including paging.
m-atlantis Aug 22, 2022
15acc10
Review changes from last time
Bohlski Aug 23, 2022
0cf59f9
Merge with master and small fixes
Bohlski Aug 25, 2022
6689c53
Changed the things pointed out in the code review.
m-atlantis Aug 26, 2022
8e624e1
Merge with url changes
Bohlski Aug 29, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum ReportPart {
public String getPartName() {return "deletedFile";}

public String getHumanString() {return "deleted files";}
}, CHECKSUM_ISSUE {
}, CHECKSUM_ERROR {
public String getPartName() {return "checksumIssue";}

public String getHumanString() {return "inconsistent checksums";}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class IntegrityReportWriter {
public IntegrityReportWriter(File reportDir) {
this.reportDir = reportDir;
missingFilesWriter = new IntegrityReportPartWriter(ReportPart.MISSING_FILE, reportDir);
checksumIssuesWriter = new IntegrityReportPartWriter(ReportPart.CHECKSUM_ISSUE, reportDir);
checksumIssuesWriter = new IntegrityReportPartWriter(ReportPart.CHECKSUM_ERROR, reportDir);
missingChecksumsWriter = new IntegrityReportPartWriter(ReportPart.MISSING_CHECKSUM, reportDir);
obsoleteChecksumsWriter = new IntegrityReportPartWriter(ReportPart.OBSOLETE_CHECKSUM, reportDir);
deletedFilesWriter2 = new IntegrityReportPartWriter(ReportPart.DELETED_FILE, reportDir);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

/**
* Class to handle streaming of different kinds of JSON data
*/
public class JSONStreamingTools {
private final static Logger log = LoggerFactory.getLogger(JSONStreamingTools.class);
public class StreamingTools {
private final static Logger log = LoggerFactory.getLogger(StreamingTools.class);

/**
* Helper method to stream integrity issues as JSON for webservices.
*
* @param iterator The IntegrityIssueIterator with integrity issues that is to be streamed out.
*/
public static StreamingOutput StreamIntegrityIssues(IntegrityIssueIterator iterator) {
public static StreamingOutput streamIntegrityIssues(IntegrityIssueIterator iterator) {
final IntegrityIssueIterator it = iterator;
return output -> {
JsonFactory jf = new JsonFactory();
Expand All @@ -69,7 +71,7 @@ public static StreamingOutput StreamIntegrityIssues(IntegrityIssueIterator itera
it.close();
}
} catch (Exception e) {
log.error("Caught execption when closing IntegrityIssueIterator", e);
log.error("Caught exception when closing IntegrityIssueIterator", e);
throw new WebApplicationException(e);
}
}
Expand All @@ -82,9 +84,9 @@ public static StreamingOutput StreamIntegrityIssues(IntegrityIssueIterator itera
*
* @param source The source file
* @param offset The number of lines to skip
* @param maxlines The maximum number of lines to output
* @param maxLines The maximum number of lines to output
*/
public static StreamingOutput StreamFileParts(File source, int offset, int maxlines) {
public static StreamingOutput streamFileParts(File source, int offset, int maxLines) {
final File input = source;
return output -> {
JsonFactory jf = new JsonFactory();
Expand All @@ -99,7 +101,7 @@ public static StreamingOutput StreamFileParts(File source, int offset, int maxli
continue;
}
jg.writeString(line);
if (linesRead - offset >= maxlines) {
if (linesRead - offset >= maxLines) {
break;
}
}
Expand All @@ -111,4 +113,50 @@ public static StreamingOutput StreamFileParts(File source, int offset, int maxli
}
};
}

/**
* Iterates over the elements in an {@link IntegrityIssueIterator} and returns the items as a list.
*
* @param iterator The {@link IntegrityIssueIterator}.
* @return Returns a {@link List <String>}.
*/
public static List<String> iteratorToList(IntegrityIssueIterator iterator) {
List<String> output = new ArrayList<>();
String issue;
while ((issue = iterator.getNextIntegrityIssue()) != null) {
output.add(issue);
}
iterator.close();

return output;
}

/**
* Helper method to create a {@link List<String>} of all or parts of a files' content.
* @param source The source file
* @param offset The number of lines to skip
* @param maxLines The number of lines to read
* @return Returns a {@link List<String>} of the found content.
*/
public static List<String> filePartToList(File source, int offset, int maxLines) {
List<String> output = new ArrayList<>();

try (BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream(source), StandardCharsets.UTF_8))) {
int linesRead = 0;
String line;
while ((line = b.readLine()) != null) {
if (linesRead++ < offset) {
continue;
}
output.add(line);
if (linesRead - offset >= maxLines) {
break;
}
}
} catch (Exception e) {
throw new WebApplicationException(e);
}

return output;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,6 @@ legend + .control-group {
}

table {
table-layout: fixed;
max-width: 100%;
background-color: transparent;
border-collapse: collapse;
Expand Down Expand Up @@ -5183,7 +5182,7 @@ input[type="submit"].btn.btn-mini {
margin-bottom: 0;
text-align: right;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
/*border-top: 1px solid #ddd;*/
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
Expand Down Expand Up @@ -6048,4 +6047,4 @@ a.badge:hover {

.affix {
position: fixed;
}
}
102 changes: 102 additions & 0 deletions bitrepository-webclient/src/main/webapp/css/modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.table th {
font-weight: bold;
}

.modal-table tr th {
border-bottom: 1px solid black;
}

.modal-table td {
border-bottom: 1px solid #9996;
}

.table thead th {
vertical-align: bottom;
padding: 15px;
}

.modal-table-head {
padding: 5px;
position: sticky;
top: 2%;
height: 35px;
background-color: #fff;
}

.modal-body {
position: relative;
margin-top: 20px;
height: inherit;
max-height: 86%;
padding: 15px;
overflow-y: auto;
}

.modal-dialog {
position: fixed;
z-index: 1050;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 6px;
outline: 0;
box-shadow: 0 3px 7px rgb(0 0 0 / 30%);
-webkit-box-shadow: 0 3px 7px rgb(0 0 0 / 30%);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
background-clip: padding-box;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
left: 50%;
top: 10%;
bottom: 2%;
transform: translate(-50%, 0);
min-width: 70%;
/*height: 86%;*/
}

.fixed-div {
position: fixed;
width: 95%;
height: 6%;
background-color: #fff;
top: 6%;
}

.search-bar {
width: 33%;
margin: 10px;
}

.file-id {
color: #000 !important;
cursor: copy !important;
text-decoration: none !important;
}

.inline-block {
white-space: nowrap;
display: inline-flex;
}

.current-page-p {
margin: 0 0 0 10px;
}

.prev-button, .next-button {
display: inline-block;
margin-right: 5px;
margin-left: 5px;
background-color: #4fa7dc;
border: 1px solid #367def;
color: #000;
}

.prev-button:disabled, .next-button:disabled {
display: inline-block;
margin-right: 5px;
margin-left: 5px;
background-color: rgba(128, 128, 128, 0.5);
border: 1px solid rgba(89, 89, 89, 0.5);
color: rgba(0, 0, 0, 0.5);
cursor: not-allowed;
}

Loading