Skip to content
Snippets Groups Projects
Commit b2738029 authored by Tom Robinson's avatar Tom Robinson
Browse files

Warning tweaks

parent 93dbb119
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,10 @@ export var ICON_PATHS = {
svg: '<g fill="currentcolor" fill-rule="evenodd"><path d="M10.9665007,4.7224988 C11.5372866,3.77118898 12.455761,3.75960159 13.0334993,4.7224988 L22.9665007,21.2775012 C23.5372866,22.228811 23.1029738,23 21.9950534,23 L2.00494659,23 C0.897645164,23 0.455760956,22.2403984 1.03349928,21.2775012 L10.9665007,4.7224988 Z M13.0184348,11.258 L13.0184348,14.69 C13.0184348,15.0580018 12.996435,15.4229982 12.9524348,15.785 C12.9084346,16.1470018 12.8504351,16.5159981 12.7784348,16.892 L11.5184348,16.892 C11.4464344,16.5159981 11.388435,16.1470018 11.3444348,15.785 C11.3004346,15.4229982 11.2784348,15.0580018 11.2784348,14.69 L11.2784348,11.258 L13.0184348,11.258 Z M11.0744348,19.058 C11.0744348,18.9139993 11.1014345,18.7800006 11.1554348,18.656 C11.2094351,18.5319994 11.2834343,18.4240005 11.3774348,18.332 C11.4714353,18.2399995 11.5824341,18.1670003 11.7104348,18.113 C11.8384354,18.0589997 11.978434,18.032 12.1304348,18.032 C12.2784355,18.032 12.4164341,18.0589997 12.5444348,18.113 C12.6724354,18.1670003 12.7844343,18.2399995 12.8804348,18.332 C12.9764353,18.4240005 13.0514345,18.5319994 13.1054348,18.656 C13.1594351,18.7800006 13.1864348,18.9139993 13.1864348,19.058 C13.1864348,19.2020007 13.1594351,19.3369994 13.1054348,19.463 C13.0514345,19.5890006 12.9764353,19.6979995 12.8804348,19.79 C12.7844343,19.8820005 12.6724354,19.9539997 12.5444348,20.006 C12.4164341,20.0580003 12.2784355,20.084 12.1304348,20.084 C11.978434,20.084 11.8384354,20.0580003 11.7104348,20.006 C11.5824341,19.9539997 11.4714353,19.8820005 11.3774348,19.79 C11.2834343,19.6979995 11.2094351,19.5890006 11.1554348,19.463 C11.1014345,19.3369994 11.0744348,19.2020007 11.0744348,19.058 Z"></path></g>',
attrs: { viewBox: '0 0 23 23' }
},
warning2: {
path: 'M12.3069589,4.52260192 C14.3462632,1.2440969 17.653446,1.24541073 19.691933,4.52260192 L31.2249413,23.0637415 C33.2642456,26.3422466 31.7889628,29 27.9115531,29 L4.08733885,29 C0.218100769,29 -1.26453645,26.3409327 0.77395061,23.0637415 L12.3069589,4.52260192 Z M18.0499318,23.0163223 C18.0499772,23.0222378 18.05,23.0281606 18.05,23.0340907 C18.05,23.3266209 17.9947172,23.6030345 17.8840476,23.8612637 C17.7737568,24.1186089 17.6195847,24.3426723 17.4224081,24.5316332 C17.2266259,24.7192578 16.998292,24.8660439 16.7389806,24.9713892 C16.4782454,25.0773129 16.1979962,25.1301134 15.9,25.1301134 C15.5950083,25.1301134 15.3111795,25.0774024 15.0502239,24.9713892 C14.7901813,24.8657469 14.5629613,24.7183609 14.3703047,24.5298034 C14.177545,24.3411449 14.0258626,24.1177208 13.9159524,23.8612637 C13.8052827,23.6030345 13.75,23.3266209 13.75,23.0340907 C13.75,22.7411889 13.8054281,22.4661013 13.9165299,22.2109786 C14.0264627,21.9585404 14.1779817,21.7374046 14.3703047,21.5491736 C14.5621821,21.3613786 14.7883231,21.2126553 15.047143,21.1034656 C15.3089445,20.9930181 15.593871,20.938068 15.9,20.938068 C16.1991423,20.938068 16.4804862,20.9931136 16.7420615,21.1034656 C17.0001525,21.2123478 17.2274115,21.360472 17.4224081,21.5473437 C17.6191428,21.7358811 17.7731504,21.957652 17.88347,22.2109786 C17.9124619,22.2775526 17.9376628,22.3454862 17.9590769,22.414741 C18.0181943,22.5998533 18.05,22.7963729 18.05,23 C18.05,23.0054459 18.0499772,23.0108867 18.0499318,23.0163223 L18.0499318,23.0163223 Z M17.7477272,14.1749999 L17.7477272,8.75 L14.1170454,8.75 L14.1170454,14.1749999 C14.1170454,14.8471841 14.1572355,15.5139742 14.2376219,16.1753351 C14.3174838,16.8323805 14.4227217,17.5019113 14.5533248,18.1839498 L14.5921937,18.3869317 L17.272579,18.3869317 L17.3114479,18.1839498 C17.442051,17.5019113 17.5472889,16.8323805 17.6271507,16.1753351 C17.7075371,15.5139742 17.7477272,14.8471841 17.7477272,14.1749999 Z',
attrs: { fillRule: "evenodd" }
},
"illustration-icon-pie": {
svg: "<path d='M29.8065455,22.2351515 L15.7837576,15.9495758 L15.7837576,31.2174545 C22.0004848,31.2029091 27.3444848,27.5258182 29.8065455,22.2351515' fill='#78B5EC'></path><g id='Fill-1-+-Fill-3'><path d='M29.8065455,22.2351515 C30.7316364,20.2482424 31.2630303,18.0402424 31.2630303,15.7032727 C31.2630303,11.8138182 29.8220606,8.26763636 27.4569697,5.54472727 L15.7837576,15.9495758 L29.8065455,22.2351515' fill='#3875AC'></path><path d='M27.4569697,5.54472727 C24.6118788,2.26909091 20.4266667,0.188121212 15.7478788,0.188121212 C7.17963636,0.188121212 0.232727273,7.1350303 0.232727273,15.7032727 C0.232727273,24.2724848 7.17963636,31.2184242 15.7478788,31.2184242 C15.7604848,31.2184242 15.7721212,31.2174545 15.7837576,31.2174545 L15.7837576,15.9495758 L27.4569697,5.54472727' fill='#4C9DE6'></path></g>"
},
......
......@@ -11,8 +11,7 @@ const Warnings = ({ warnings, className, size = 16 }) => {
<ul className="px2 pt2 pb1" style={{ maxWidth: 350 }}>
{warnings.map((warning) =>
<li className="pb1" key={warning}>
<Icon name="warning" size={16} />
<span className="pl1">{warning}</span>
{warning}
</li>
)}
</ul>
......@@ -20,7 +19,7 @@ const Warnings = ({ warnings, className, size = 16 }) => {
return (
<Tooltip tooltip={tooltip}>
<Icon className={className} name="warning" size={size} />
<Icon className={className} name="warning2" size={size} />
</Tooltip>
)
}
......
......@@ -39,7 +39,7 @@ export default class PieChart extends Component {
static checkRenderable(cols, rows, settings) {
if (!settings["pie.dimension"] || !settings["pie.metric"]) {
throw new ChartSettingsError("Please select columns in the chart settings.", "Data");
throw new ChartSettingsError("Which columns do want to use?", "Data");
}
}
......
......@@ -35,7 +35,7 @@ export default class LineAreaBarChart extends Component {
const dimensions = (settings["graph.dimensions"] || []).filter(name => name);
const metrics = (settings["graph.metrics"] || []).filter(name => name);
if (dimensions.length < 1 || metrics.length < 1) {
throw new ChartSettingsError("Please select columns for the X and Y axis in the visualization settings.", "Data");
throw new ChartSettingsError("Which fields do you want to use for the X and Y axes?", "Data", "Choose fields");
}
}
......
......@@ -176,8 +176,8 @@ export default class Visualization extends Component {
<div>
<div>{error}</div>
<div className="mt2">
<button className="Button Button--primary Button--small" onClick={this.props.onOpenChartSettings}>
Edit Settings
<button className="Button Button--primary Button--medium" onClick={this.props.onOpenChartSettings}>
{e.buttonText}
</button>
</div>
</div>
......@@ -240,7 +240,7 @@ export default class Visualization extends Component {
}
</div>
: error ?
<div className="flex-full px1 pb1 text-centered text-slate-light flex flex-column layout-centered">
<div className="flex-full px1 pb1 text-centered text-slate flex flex-column layout-centered">
<Tooltip tooltip={error} isEnabled={small}>
<Icon className="mb2" name={errorIcon || "warning"} size={50} />
</Tooltip>
......
......@@ -22,8 +22,9 @@ export class LatitudeLongitudeError {
}
export class ChartSettingsError {
constructor(message, section) {
constructor(message, section, buttonText) {
this.message = message || "Please configure this chart in the chart settings";
this.section = section;
this.buttonText = buttonText || "Edit Settings";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment