Skip to content

Boingy Graph: doesn't render colours if the ratings differ from hardcoded values (pickWorst) #7460

@kamransaleem

Description

@kamransaleem

Description

Noticed that if an adopter uses custom flow classification values, with custom codes, the boingy graph fails to render a colour and defaults to "NO_OPINION" hence always grey. See below, expect to see two green lines.

Image Image

The database has the follow classifications:

Image

I have traced the issue to the logical-flow-utility.pickWorst function. The issue is the hardcode:

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

    console.log("pick worst: ", {ratings, worst})
    return worst || "NO_OPINION";
}

replacing as follows fixed the issue for this specific data
const sortedByBadness = [ "DISCOURAGED", "NOT_PERMITTED", "SECONDARY_SOURCE", "DATA_ENTRY_POINT", "PRIMARY_SOURCE", "NO_OPINION", "NO_OPINION_TARGET" ];

So the pickWorst function needs to accomodate custom codes.

Waltz Version

1.79

Steps to Reproduce

...

Expected Result

No response

Actual Result

No response

Metadata

Metadata

Assignees

Labels

bugDefect affecting the currently released version of Waltzfixed (test & close)An issue has been fixed, merged into master and is ready for further testing

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions