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

Edit Dashboard title and Slice title in place #2940

Merged
merged 16 commits into from
Jun 14, 2017

Conversation

graceguo-supercat
Copy link

Add EditableTitle component into Dashboard and Explore view to support edit title inline.

fixes #2796

dashboard view:
zi7a4nbzei

Explore view:
slice

Add EditableTitle component into Dashboard and Explore view to support edit title inline.
Grace Guo added 2 commits June 9, 2017 17:04
Add EditableTitle component into Dashboard and Explore view to support edit title inline.
Add EditableTitle component into Dashboard and Explore view to support edit title inline.
Grace Guo added 2 commits June 12, 2017 16:23
Add EditableTitle component into Dashboard and Explore view to support edit title inline.
Add EditableTitle component into Dashboard and Explore view to support edit title inline.
Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

Really excited to see this feature!

);
}
}
EditableTitle.propTypes = {
Copy link
Member

Choose a reason for hiding this comment

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

No big deal but we've been setting propTypes and defaultProps at the top of the file in most components.

@@ -503,7 +533,8 @@ def test_dashboard_with_created_by_can_be_accessed_by_public_users(self):
)
self.grant_public_access_to_table(table)

dash = db.session.query(models.Dashboard).filter_by(dashboard_title="Births").first()
dash = db.session.query(models.Dashboard).filter_by(
Copy link
Member

Choose a reason for hiding this comment

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

nit: I've been breaking long sqlalchemy queries method-chaining-style, but in python it needs parenthesis as in:

dash = (
    db.session.query(models.Dashboard)
    .filter_by(slug="births")
    .first()
)

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -145,6 +150,19 @@ class ChartContainer extends React.PureComponent {
this.props.actions.runQuery(this.props.formData, true);
}

updateChartTitle(newTitle) {
const params = {};
Copy link
Member

Choose a reason for hiding this comment

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

nit: this is a bit more elegant:

const params = {
    slice_name: newTitle,
    action: 'overwrite',
    form_data = this.props.formData,
};

params.action = 'overwrite';
params.form_data = this.props.formData;
const saveUrl = '/superset/explore/' +
`${this.props.datasourceType}/${this.props.datasourceId}/?${serialize(params)}`;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can reuse the getExploreUrl method here? https://github.com/airbnb/superset/blob/master/superset/assets/javascripts/explore/exploreUtils.js#L4

Or maybe it's time soon to remove move save/overwrite out of /superset/explore/ and into its own POST endpoint.

@@ -86,3 +86,33 @@ export function getShortUrl(longUrl, callback) {
},
});
}

export function serialize(obj) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm hoping we can get away without this function by reusing getExploreUrl

timfeirg and others added 10 commits June 13, 2017 15:03
Most notably Flask AppBuilder to 1.9.0
Moved the histogram to be rooted on the right side as well

fixes apache#2933
* Fix handling of Chunked requests

Add fix for handling chunk encoding requests.
If ENABLE_CHUNK_ENCODING is set to true, for requests with transfer
encoding set to true. It will set wsgi.input_terminated to true which
tells werkzeug to ignore content-length and read the stream till the
end.

 break comment in multiple lines

* remove debug print logging
* [dashboard] notify instead of modal onSave

* Addressing comments
* get compiled js file names

* make manifest available as template var

* use script src directly to avoid flash of unstyled content in the case of csstheme.js

* linting

* attempt to fix tests

* exception

* print the path when no manifest file found

* handle case when manifest.json is not present for some reason, or in the case of tests
* sort explicitly on label

* add simple test for /slicemodelview/add endpoint

* make comments and method names more clear

* fix test name

* be more explicit, test status_code
@graceguo-supercat graceguo-supercat merged commit 8329ea2 into apache:master Jun 14, 2017
@graceguo-supercat graceguo-supercat deleted the gg-EditTitle branch June 14, 2017 19:52
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.18.5 labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.18.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Dashboard title and Slice title in place
4 participants