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

WIP Add conversion of InfluxQL to QueryConfig for dashboards #1035

Merged

Conversation

goller
Copy link
Contributor

@goller goller commented Mar 21, 2017

  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)
  • Update swagger with new dashboard cell queries.

Connect #950

The problem

We need a way to convert InfluxQL to the frontend QueryConfig JSON structure. QueryConfig is not able to fully represent InfluxQL.

The Solution

Use the Influx 1.1 Parser to parse the InfluxQL into the QueryConfig.

alexpaxton and others added 30 commits March 13, 2017 11:36
Dropdown is at the top, so less likely to push down the page
This is an initial implementation of cell renaming on dashboards. It
maintains its state locally to the component and reuses the
onPositionChange handler provided by the DashboardPage container
component to persist changes to the cells.

Redux wasn't used in this implementation because it was something we
wanted to refactor into, which will happen in subsequent commits.

There is a known bug in this implementation where cell names are
overwritten with an empty string when the dashboard initially loads and
when the cell layout changes.
Cell renaming was previously done without using any of the existing
Redux logic. This goes against the ethos of the rest of the code used
for dashboards. This commit is an initial attempt to bring NameableGraph
into compliance with that.
`l.name` was being copied from the cells provided by React Grid Layout,
which have no concept of name, which is why this was undefined. This
caused cells to be renamed '' whenever the layout changed or the page
was reloaded.
Previously, editing a cell name caused a PUT to the API for every
character typed by the user when renaming a cell. This was obviously not
ideal, but kept the initial implementation simple.

This limits PUTs to update cells to only when blur events happen on the
<input>. This is accomplished by maintaining the state of the input
field within the component and using a separate handler for the onBlur
to actually PUT the dashboard using a handler provided by the caller.
Implicit returns are more concise here, and considered more idiomatic.
Also, async action creators have been collected together and moved
towards the end of the file for ease of navigation.
NameableGraph is now a stateless component, with all its ephemeral state
held within Redux. This improves its testability, and two tests have
been added for the two needed Reducer cases.

Also, since NameableGraph's behavior is entirely controlled by its
props, the component itself can be tested, though this has not yet been
done.
…ns. Added updateDashboardCells reducer, tested.
Cell coordinates were previously strings, which disagreed with how they
were being delivered from components which used NameableGraph. This
caused errors in the console.
This allows the renameability of NameableGraph to be controlled by the
presence of any one of the editing handler functions. Since we don't
pass any of these when rendering a HostPage, those graphs will have
static names, and will prevent the user from editing the names of those
graphs to no avail. Also, because the handlers were marked required, it
caused the HostPage to entirely break, which is fixed by this commit.
@goller goller changed the base branch from master to 950-overlay_technologies-edit March 21, 2017 15:59
@lukevmorris lukevmorris merged commit ea0c6ff into 950-overlay_technologies-edit Mar 21, 2017
@lukevmorris lukevmorris deleted the feature/parse-to-query-config branch March 21, 2017 16:06
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

Successfully merging this pull request may close these issues.

6 participants