Skip to content

Commit

Permalink
#2314 fix the count of workbook dashboard in workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
minhyun2 authored and alchan-lee committed Jul 5, 2019
1 parent 14dd245 commit eafc04b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@ public Map<String, Object> listViewProjection() {
projection.put("type", "workbook");

Map<String, Object> contents = Maps.newLinkedHashMap();
contents.put("dashboard", dashBoards.size());

// TODO: 기획쪽과 논의해볼 필요가 있음.
int dashboardSize = 0;
final Map<String, DataSource> dataSourceMap = Maps.newHashMap();
final Map<String, DataSource> inactiveDataSourceMap = Maps.newHashMap();
for (DashBoard dashBoard : dashBoards) {
if(dashBoard.getDataSources() == null) {
if(dashBoard.getDataSources() == null || dashBoard.getDataSources().isEmpty()) {
continue;
}
dashboardSize++;
dashBoard.getDataSources().forEach(dataSource -> {
if(!dataSourceMap.containsKey(dataSource.getId())) {
dataSourceMap.put(dataSource.getId(), dataSource);
Expand All @@ -109,6 +110,7 @@ public Map<String, Object> listViewProjection() {
}
});
}
contents.put("dashboard", dashboardSize);
contents.put("dataSource", dataSourceMap.values().size());
contents.put("inactiveDataSource", inactiveDataSourceMap.values().size());
contents.put("connValid", dataSourceMap.values().size() == 0 || dataSourceMap.values().size() != inactiveDataSourceMap.values().size());
Expand Down

0 comments on commit eafc04b

Please sign in to comment.