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

fix(ui): fixed dark lines in checks #17651

Merged
merged 3 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Bug Fixes

1. [17612](https://github.com/influxdata/influxdb/pull/17612): Fix card size and layout jank in dashboards index view
1. [17651](https://github.com/influxdata/influxdb/pull/17651): Fix check graph font and lines defaulting to black causing graph to be unreadable

### UI Improvements

Expand Down
2 changes: 1 addition & 1 deletion http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8872,7 +8872,7 @@ components:
description: Colors define color encoding of data into a visualization
type: array
items:
type: string
$ref: "#/components/schemas/DashboardColor"
Axes:
description: The viewport for a View's visualizations
type: object
Expand Down
8 changes: 7 additions & 1 deletion ui/src/shared/components/CheckPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {getFormatter, filterNoisyColumns} from 'src/shared/utils/vis'
// Constants
import {VIS_THEME} from 'src/shared/constants'
import {INVALID_DATA_COPY} from 'src/shared/copy/cell'
import {DEFAULT_LINE_COLORS} from 'src/shared/constants/graphColorPalettes'

// Types
import {
Expand Down Expand Up @@ -100,6 +101,11 @@ const CheckPlot: FunctionComponent<Props> = ({

const yTicks = thresholdValues.length ? thresholdValues : null

const colorHexes =
colors && colors.length
? colors.map(c => c.hex)
: DEFAULT_LINE_COLORS.map(c => c.hex)

const config: Config = {
...VIS_THEME,
table,
Expand All @@ -119,7 +125,7 @@ const CheckPlot: FunctionComponent<Props> = ({
y: Y_COLUMN,
fill: groupKey,
interpolation: 'linear',
colors,
colors: colorHexes,
},
{
type: 'custom',
Expand Down
49 changes: 0 additions & 49 deletions ui/src/timeMachine/components/view_options/CheckOptions.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import TableOptions from 'src/timeMachine/components/view_options/TableOptions'
import HistogramOptions from 'src/timeMachine/components/view_options/HistogramOptions'
import HeatmapOptions from 'src/timeMachine/components/view_options/HeatmapOptions'
import ScatterOptions from 'src/timeMachine/components/view_options/ScatterOptions'
import CheckOptions from 'src/timeMachine/components/view_options/CheckOptions'

// Types
import {View, NewView} from 'src/types'
Expand Down Expand Up @@ -44,8 +43,6 @@ class OptionsSwitcher extends PureComponent<Props> {
return <HeatmapOptions {...view.properties} />
case 'scatter':
return <ScatterOptions {...view.properties} />
case 'check':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckOptions is unused

return <CheckOptions properties={view.properties} />
default:
return <div />
}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const NEW_VIEW_CREATORS = {
},
},
],
colors: NINETEEN_EIGHTY_FOUR,
colors: DEFAULT_LINE_COLORS as Color[],
},
}),
deadman: (): NewView<CheckViewProperties> => ({
Expand All @@ -308,7 +308,7 @@ const NEW_VIEW_CREATORS = {
},
},
],
colors: NINETEEN_EIGHTY_FOUR,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching over to a different default allows for a consistent color schema for the CheckViewProperties. This ensures that both the view history and default view are the same type

colors: DEFAULT_LINE_COLORS as Color[],
},
}),
custom: (): NewView<TableViewProperties> => ({
Expand Down