Skip to content

Commit

Permalink
Merge pull request #2022 from weaveworks/fix-plugins-tooltip
Browse files Browse the repository at this point in the history
Improve plugin errors tooltip
  • Loading branch information
fbarl authored Nov 25, 2016
2 parents a1adbbb + c110e32 commit 3083871
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
6 changes: 4 additions & 2 deletions client/app/scripts/components/plugins.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import React from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import ReactTooltip from 'react-tooltip';

class Plugins extends React.Component {
renderPlugin({id, label, description, status}) {
const error = status !== 'ok';
const className = classNames({ error });
const title = `Status: ${status} | Plugin description: ${description}`;
const title = `Plugin description: ${description}<br />Status: ${status}`;

// Inner span to hold styling so we don't effect the "before:content"
return (
<span className="plugins-plugin" key={id}>
<span className={className} title={title}>
<span className={className} data-tip={title} data-multiline>
{error && <span className="plugins-plugin-icon fa fa-exclamation-circle" />}
{label || id}
</span>
<ReactTooltip class="tooltip" effect="solid" offset={{right: 7}} />
</span>
);
}
Expand Down
16 changes: 13 additions & 3 deletions client/app/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ h2 {
}

.footer {
padding: 5px;
position: absolute;
bottom: 16px;
right: 48px;
z-index: 20;
bottom: 11px;
right: 43px;
color: @text-tertiary-color;
background-color: fade(@background-average-color, 90%);
font-size: 0.7rem;
display: flex;

Expand Down Expand Up @@ -243,6 +244,11 @@ h2 {
&-icon &-label {
margin-right: 0.5em;
}

.tooltip {
// above everything
z-index: 20000;
}
}

.topologies {
Expand Down Expand Up @@ -1161,6 +1167,10 @@ h2 {
margin-right: 0.25em;
}

&-plugin {
cursor: default;
}

&-plugin + &-plugin:before {
content: ', ';
}
Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react-dom": "~15.4.1",
"react-motion": "~0.4.5",
"react-redux": "~4.4.6",
"react-tooltip": "~3.2.1",
"redux": "~3.6.0",
"redux-immutable": "~3.0.8",
"redux-logger": "~2.7.4",
Expand Down

0 comments on commit 3083871

Please sign in to comment.