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

chore: unify the workpad update handler #31218

Merged
merged 2 commits into from
Feb 22, 2019

Conversation

w33ble
Copy link
Contributor

@w33ble w33ble commented Feb 15, 2019

I'm planning to fix the workpad persist order issue we've had for a while, and unifying the update handler is going to make that a lot easier. The 3 functions were pretty much the same already, so using the same updateWorkpad handler for all 3 routes was a pretty easy change.

Related: #29930 (which is about unifying the routes, this PR only unifies the handler for all 3 routes)

@w33ble w33ble added review v7.0.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.0.0 v6.7.0 labels Feb 15, 2019
@w33ble w33ble requested a review from monfera February 15, 2019 00:16
@w33ble w33ble requested a review from a team as a code owner February 15, 2019 00:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@w33ble
Copy link
Contributor Author

w33ble commented Feb 15, 2019

I tested this out by hand, but I'll add some unit tests here as well. This can be reviewed in the meantime though. Tests added, and I verified that they pass before and after the change.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@w33ble w33ble force-pushed the chore/workpad-update-handler branch from cd52ece to 3081d90 Compare February 21, 2019 21:37
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

Looks good, nice change!

import { workpad } from './workpad';

const routePrefix = API_ROUTE_WORKPAD;
const routePrefixAssets = API_ROUTE_WORKPAD_ASSETS;
const routePrefixStructures = API_ROUTE_WORKPAD_STRUCTURES;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the routes kept separate because route unification is tangential to what this PR is needed for, or because you have second thoughts about its desirability? (not suggesting that unification be done in this one, just wishing to know esp. if it's the latter)

Copy link
Contributor Author

@w33ble w33ble Feb 22, 2019

Choose a reason for hiding this comment

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

because route unification is tangential to what this PR is needed for

That ;)

Having a single handler makes the changes I'm planning easier, the route unification is separate, and still seems worth doing. And now that there's tests, we can just update the api path in them and confirm they still work the same way.

@w33ble w33ble merged commit 101d30a into elastic:master Feb 22, 2019
w33ble added a commit to w33ble/kibana that referenced this pull request Feb 22, 2019
* test: assets and structures routes

* chore: unify the workpad update handler

the 3 functions were pretty much the same already
w33ble added a commit to w33ble/kibana that referenced this pull request Feb 22, 2019
* test: assets and structures routes

* chore: unify the workpad update handler

the 3 functions were pretty much the same already
w33ble added a commit to w33ble/kibana that referenced this pull request Feb 22, 2019
w33ble added a commit that referenced this pull request Feb 22, 2019
* test: assets and structures routes

* chore: unify the workpad update handler

the 3 functions were pretty much the same already
w33ble added a commit that referenced this pull request Feb 27, 2019
* test: assets and structures routes

* chore: unify the workpad update handler

the 3 functions were pretty much the same already
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.7.0 v7.0.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants