Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
12e93973
Commit
12e93973
authored
6 years ago
by
uhensler
Browse files
Options
Downloads
Patches
Plain Diff
OO-3829: Do not show entries whithout grouping keys in heat map
parent
efca03c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/modules/quality/analysis/ui/HeatMapController.java
+31
-42
31 additions, 42 deletions
...g/olat/modules/quality/analysis/ui/HeatMapController.java
with
31 additions
and
42 deletions
src/main/java/org/olat/modules/quality/analysis/ui/HeatMapController.java
+
31
−
42
View file @
12e93973
...
...
@@ -365,56 +365,25 @@ public class HeatMapController extends FormBasicController implements Filterable
private
void
loadHeatMap
()
{
GroupBy
lastGroupBy
=
getLastGroupBy
(
multiGroupBy
);
String
groupNameNA
=
translate
(
"heatmap.not.specified"
);
List
<
String
>
identifiers
=
sliders
.
stream
().
map
(
SliderWrapper:
:
getIdentifier
).
collect
(
toList
());
GroupedStatistics
<
GroupedStatistic
>
statistics
=
loadHeatMapStatistics
();
Set
<
MultiKey
>
keys
=
statistics
.
getMultiKeys
();
List
<
HeatMapRow
>
rows
=
new
ArrayList
<>(
keys
.
size
());
for
(
MultiKey
multiKey
:
keys
)
{
List
<
String
>
groupNames
=
new
ArrayList
<>(
6
);
boolean
found
=
true
;
if
(
MultiKey
.
none
().
equals
(
multiKey
))
continue
;
if
(
multiGroupBy
.
getGroupBy1
()
!=
null
)
{
String
groupName1
=
translate
(
"heatmap.not.specified"
);
if
(
multiKey
.
getKey1
()
!=
null
)
{
groupName1
=
groupByNames
.
getName
(
new
GroupByKey
(
multiGroupBy
.
getGroupBy1
(),
multiKey
.
getKey1
()));
if
(
groupName1
==
null
)
{
found
=
false
;
}
}
groupNames
.
add
(
groupName1
);
}
if
(
multiGroupBy
.
getGroupBy2
()
!=
null
)
{
String
groupName2
=
translate
(
"heatmap.not.specified"
);
if
(
multiKey
.
getKey2
()
!=
null
)
{
groupName2
=
groupByNames
.
getName
(
new
GroupByKey
(
multiGroupBy
.
getGroupBy2
(),
multiKey
.
getKey2
()));
if
(
groupName2
==
null
)
{
found
=
false
;
}
}
groupNames
.
add
(
groupName2
);
}
if
(
multiGroupBy
.
getGroupBy3
()
!=
null
)
{
String
groupName3
=
translate
(
"heatmap.not.specified"
);
if
(
multiKey
.
getKey3
()
!=
null
)
{
groupName3
=
groupByNames
.
getName
(
new
GroupByKey
(
multiGroupBy
.
getGroupBy3
(),
multiKey
.
getKey3
()));
if
(
groupName3
==
null
)
{
found
=
false
;
}
}
groupNames
.
add
(
groupName3
);
}
List
<
String
>
groupNames
=
getGroupNames
(
multiKey
,
groupNameNA
);
if
(
found
)
{
// Iterate over the identifiers to sort the statistics according to the headers.
List
<
GroupedStatistic
>
rowStatistics
=
new
ArrayList
<>();
for
(
String
identifier
:
identifiers
)
{
GroupedStatistic
rowStatistic
=
statistics
.
getStatistic
(
identifier
,
multiKey
);
rowStatistics
.
add
(
rowStatistic
);
}
boolean
hideTrend
=
GroupBy
.
DATA_COLLECTION
.
equals
(
lastGroupBy
)
||
MultiKey
.
none
().
equals
(
multiKey
);
HeatMapRow
row
=
new
HeatMapRow
(
multiKey
,
groupNames
,
rowStatistics
,
!
hideTrend
);
rows
.
add
(
row
);
// Iterate over the identifiers to sort the statistics according to the headers.
List
<
GroupedStatistic
>
rowStatistics
=
new
ArrayList
<>();
for
(
String
identifier
:
identifiers
)
{
GroupedStatistic
rowStatistic
=
statistics
.
getStatistic
(
identifier
,
multiKey
);
rowStatistics
.
add
(
rowStatistic
);
}
boolean
hideTrend
=
GroupBy
.
DATA_COLLECTION
.
equals
(
lastGroupBy
);
HeatMapRow
row
=
new
HeatMapRow
(
multiKey
,
groupNames
,
rowStatistics
,
!
hideTrend
);
rows
.
add
(
row
);
}
if
(
insufficientOnly
)
{
...
...
@@ -430,6 +399,26 @@ public class HeatMapController extends FormBasicController implements Filterable
tableEl
.
reset
(
true
,
true
,
true
);
}
private
List
<
String
>
getGroupNames
(
MultiKey
multiKey
,
String
groupNameNA
)
{
List
<
String
>
groupNames
=
new
ArrayList
<>(
3
);
if
(
multiGroupBy
.
getGroupBy1
()
!=
null
)
{
groupNames
.
add
(
getGroupName
(
multiKey
,
1
,
groupNameNA
));
}
if
(
multiGroupBy
.
getGroupBy2
()
!=
null
)
{
groupNames
.
add
(
getGroupName
(
multiKey
,
2
,
groupNameNA
));
}
if
(
multiGroupBy
.
getGroupBy3
()
!=
null
)
{
groupNames
.
add
(
getGroupName
(
multiKey
,
3
,
groupNameNA
));
}
return
groupNames
;
}
private
String
getGroupName
(
MultiKey
mKey
,
int
index
,
String
groupNameNA
)
{
GroupByKey
groupByAndKey
=
getGroupByAndKey
(
multiGroupBy
,
mKey
,
index
);
String
groupName
=
groupByNames
.
getName
(
groupByAndKey
);
return
StringHelper
.
containsNonWhitespace
(
groupName
)?
groupName:
groupNameNA
;
}
public
List
<
ColumnConfig
>
getColumnConfigs
()
{
List
<
ColumnConfig
>
columConfigs
=
new
ArrayList
<>();
if
(
multiGroupBy
.
getGroupBy1
()
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment