Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notices don't show #143

Open
MarcoSalemi opened this issue Feb 21, 2019 · 0 comments
Open

Notices don't show #143

MarcoSalemi opened this issue Feb 21, 2019 · 0 comments

Comments

@MarcoSalemi
Copy link

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 = [];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant