Skip to content

Notices don't show  #143

@MarcoSalemi

Description

@MarcoSalemi

Hello,
I would like first to say thanks for the tool and the effort you put in it, it is very useful and beautiful. I create this issue because I think I have discovered a bug in the connection.js file, in the update() method of the connection class, with this bug the notices don't show on the graph. I have modified 2-3 lines in the file and it seems to work now. I think the origin of the problem is the this.notices value which is always undefined.

This is the main line in the actual code that I changed:
this.notices = data.notices || undefined;

So this is the actual piece of code concerned :

    this.volume = data.metrics ? clone(data.metrics) : {};
    if (isEmpty(this.volume)) {
      // Add info notice to the connection with missing metrics
      this.notices = this.notices || [];
      this.notices.push({ title: 'Connection found, but no metrics.', severity: 0 });
    }
   this.volumeTotal = sum(values(this.volume));
   this.notices = data.notices || undefined;

And this is my code now :

    this.volume = data.metrics ? _.clone(data.metrics) : {};
    this.notices = data.notices; //if not present is undefined value - by ME

    if (_.isEmpty(this.volume)) {
      // Add info notice to the connection with missing metrics - by ME
      this.notices = this.notices || [];
      this.notices.push({ title: 'Connection found, but no metrics', severity: 1 });
    }

    .... //some elements to personalize my notices to some specific cases

    else { // no putting notice, empty list - by ME
      this.notices = [];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions