Skip to content

Commit 1281220

Browse files
committed
#7460 Boingy Graph: doesn't render colours if the ratings differ from hardcoded values (pickWorst)
- use instead the values returned from the database which can be user defined. Fallback to original default values remains.
1 parent 1c888cf commit 1281220

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

waltz-ng/client/logical-flow/services/logical-flow-utility.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import _ from "lodash";
2020
import {color} from "d3-color";
2121

2222

23-
function pickWorst(ratings = []) {
24-
const sortedByBadness = [ "DISCOURAGED", "SECONDARY", "PRIMARY", "NO_OPINION" ];
23+
function pickWorst(ratings = [], sortedByBadness = [ "DISCOURAGED", "SECONDARY", "PRIMARY", "NO_OPINION" ]) {
2524
const worst = _.find(sortedByBadness, x => _.includes(ratings, x));
2625

2726
return worst || "NO_OPINION";
@@ -37,7 +36,9 @@ export default [
3736
const flowId = d.data.id;
3837
const flowDecorators = decoratorsByFlowId[flowId] || [];
3938
const ratings = _.map(flowDecorators, "rating");
40-
return pickWorst(ratings);
39+
// note: we can use the domain() because when it is retrieved, it is already sorted by position & name
40+
// -> ref: flow-classification-utils.loadFlowClassificationRatings
41+
return pickWorst(ratings, flowClassificationColors.domain());
4142
};
4243

4344
return {

0 commit comments

Comments
 (0)