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

refactor: Improve code style for ListGrid #19429

Merged
merged 34 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a1261b9
fix: Update code
larshelge Dec 2, 2024
bf145f6
fix: Update code
larshelge Dec 2, 2024
2c933d8
fix: Update code
larshelge Dec 2, 2024
754da7f
fix: Update code
larshelge Dec 2, 2024
5e164c7
fix: Update code
larshelge Dec 2, 2024
4edfd49
fix: Update code
larshelge Dec 2, 2024
c82b6f7
fix: Update code
larshelge Dec 2, 2024
aa7625b
fix: Update code
larshelge Dec 2, 2024
c0d12da
fix: Update code
larshelge Dec 2, 2024
392d07d
Merge branch 'master' into lars-dev
larshelge Dec 2, 2024
057cdf0
fix: Update code
larshelge Dec 2, 2024
60c8ad6
fix: Update code
larshelge Dec 2, 2024
ee780bb
fix: Update code
larshelge Dec 2, 2024
db9651b
fix: Update code
larshelge Dec 2, 2024
8002118
fix: Update code
larshelge Dec 2, 2024
7fc3b92
fix: Update code
larshelge Dec 2, 2024
43a69e3
fix: Update code
larshelge Dec 2, 2024
c2b8afc
Merge branch 'master' into lars-dev
larshelge Dec 2, 2024
3f162fb
fix: Update code
larshelge Dec 2, 2024
6024282
fix: Update code
larshelge Dec 2, 2024
35a8daa
fix: Update code
larshelge Dec 2, 2024
41ca710
fix: Update code
larshelge Dec 2, 2024
7d7360d
fix: Update code
larshelge Dec 2, 2024
4fff29e
fix: Update code
larshelge Dec 2, 2024
2125b91
fix: Update code
larshelge Dec 2, 2024
3858aa7
fix: Update code
larshelge Dec 2, 2024
64c4765
Merge branch 'master' into lars-dev
larshelge Dec 3, 2024
4a7452f
Revert "feat: skipAnalytics and ConfidentialFlag only for QUERY Analy…
larshelge Dec 4, 2024
a0fc292
Merge branch 'master' into lars-dev
larshelge Dec 4, 2024
1efcccc
Merge branch 'master' into lars-dev
larshelge Dec 4, 2024
f6a2245
Merge branch 'master' into lars-dev
larshelge Dec 4, 2024
e8ccde7
Merge branch 'master' into lars-dev
larshelge Dec 5, 2024
90aa73e
Merge branch 'master' into lars-dev
larshelge Dec 10, 2024
16429cc
fix: Update code
larshelge Dec 10, 2024
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 @@ -150,7 +150,7 @@ left join analytics_rs_dateperiodstructure dps on cast(en.enrollmentdate as date
left join analytics_rs_orgunitstructure ous on en.organisationunitid=ous.organisationunitid \
left join analytics_rs_organisationunitgroupsetstructure ougs on en.organisationunitid=ougs.organisationunitid \
${attributeJoinClause}\
where pr.programid=${programId} \
where pr.programid = ${programId} \
and en.organisationunitid is not null \
and (ougs.startdate is null or dps.monthstartdate=ougs.startdate) \
and en.lastupdated <= '${startTime}' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,9 @@ public Grid addColumn(List<Object> columnValues) {

if (grid.size() != columnValues.size()) {
throw new IllegalStateException(
"Number of column values ("
+ columnValues.size()
+ ") is not equal to number of rows ("
+ grid.size()
+ ")");
String.format(
"Number of column values (%d) is not equal to number of rows (%d)",
columnValues.size(), grid.size()));
}

for (int i = 0; i < grid.size(); i++) {
Expand All @@ -526,11 +524,9 @@ public Grid addColumn(int columnIndex, List<Object> columnValues) {

if (grid.size() != columnValues.size()) {
throw new IllegalStateException(
"Number of column values ("
+ columnValues.size()
+ ") is not equal to number of rows ("
+ grid.size()
+ ")");
String.format(
"Number of column values (%d) is not equal to number of rows (%d)",
columnValues.size(), grid.size()));
}

for (int i = 0; i < grid.size(); i++) {
Expand Down Expand Up @@ -657,7 +653,7 @@ public Grid limitGrid(int limit) {
public Grid limitGrid(int startPos, int endPos) {
if (startPos < 0 || endPos < startPos || endPos > getHeight()) {
throw new IllegalStateException(
"Illegal start / end pos: " + startPos + ", " + endPos + ", " + getHeight());
"Illegal start or end pos: " + startPos + ", " + endPos + ", " + getHeight());
}

grid = grid.subList(startPos, endPos);
Expand Down Expand Up @@ -813,8 +809,9 @@ public Grid substituteMetaData(Map<?, ?> metaDataMap) {
header.setName(String.valueOf(headerMetaName));
}

// Column cells

if (header.isMeta()) {
// Column cells

substituteMetaData(colIndex, colIndex, metaDataMap);
}
Expand Down Expand Up @@ -1101,7 +1098,8 @@ public void repositionColumns(List<Integer> columnIndexes) {
row.addAll(orderedValues);
}

// reposition columns in the row context structure
// Reposition columns in the row context structure

Map<Integer, Map<String, Object>> orderedRowContext = new HashMap<>();

for (Map.Entry<Integer, Map<String, Object>> rowContextEntry : rowContext.entrySet()) {
Expand All @@ -1113,7 +1111,8 @@ public void repositionColumns(List<Integer> columnIndexes) {
.forEach(
key -> {
if (numberRegex.matcher(key).matches()) {
// reindexing of columns
// Reindexing of columns

orderedRowContextItems.put(
columnIndexes.get(Integer.parseInt(key)).toString(), ctxItem.get(key));
}
Expand Down Expand Up @@ -1151,12 +1150,9 @@ private void verifyGridState() {
for (List<Object> row : grid) {
if (rowLength != null && rowLength != row.size()) {
throw new IllegalStateException(
"Grid rows do not have the same number of cells, previous: "
+ rowLength
+ ", this: "
+ row.size()
+ ", at row: "
+ rowPos);
String.format(
"Grid rows do not have the same number of cells, previous: %d, this: %d, at row: %d",
rowLength, row.size(), rowPos));
}

rowPos++;
Expand All @@ -1177,7 +1173,7 @@ private void updateColumnIndexMap() {
}

// -------------------------------------------------------------------------
// toString
// ToString
// -------------------------------------------------------------------------

@Override
Expand Down
Loading