-
Notifications
You must be signed in to change notification settings - Fork 0
Add visibility management for spreadsheet columns #55
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
Changes from 1 commit
029b3ee
888a429
524a531
497666b
e30f074
9f2ec23
7982f3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -54,5 +54,5 @@ public record ColumnInfos( | |||||
Double filterTolerance, | ||||||
|
||||||
@Schema(description = "Column visibility", defaultValue = "true") | ||||||
Boolean visible | ||||||
boolean visible | ||||||
|
boolean visible | |
boolean visible = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot assign default values directly in record parameter declarations
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,7 +333,7 @@ public void updateColumn(UUID id, UUID columnId, ColumnInfos dto) { | |
columnEntity.setFilterType(dto.filterType()); | ||
columnEntity.setFilterValue(dto.filterValue()); | ||
columnEntity.setFilterTolerance(dto.filterTolerance()); | ||
columnEntity.setVisible(dto.visible() != null ? dto.visible() : true); | ||
columnEntity.setVisible(dto.visible()); | ||
|
||
spreadsheetConfigRepository.save(entity); | ||
} | ||
|
@@ -381,11 +381,13 @@ public void updateColumnStates(UUID id, List<ColumnStateUpdateInfos> columnState | |
} | ||
|
||
// Reorder columns based on the provided states | ||
List<UUID> orderedColumnIds = columnStates.stream() | ||
.sorted(Comparator.comparingInt(ColumnStateUpdateInfos::order)) | ||
.map(ColumnStateUpdateInfos::columnId) | ||
.toList(); | ||
reorderColumns(orderedColumnIds, columns); | ||
columns.sort(Comparator.comparing(column -> | ||
columnStates.stream() | ||
.filter(state -> state.columnId().equals(column.getUuid())) | ||
.findFirst() | ||
.map(ColumnStateUpdateInfos::order) | ||
.orElse(Integer.MAX_VALUE) | ||
)); | ||
|
||
} | ||
|
||
private SpreadsheetConfigCollectionInfos readDefaultSpreadsheetConfigCollection() throws IOException { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultValue
withoutnullable=true
?