-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
[dashboards] New, export api #8941
[dashboards] New, export api #8941
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8941 +/- ##
==========================================
+ Coverage 58.97% 58.98% +0.01%
==========================================
Files 359 359
Lines 11333 11336 +3
Branches 2787 2788 +1
==========================================
+ Hits 6684 6687 +3
Misses 4471 4471
Partials 178 178
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for implementing this :)
@@ -44,8 +44,7 @@ class DashboardModelView( | |||
datamodel = SQLAInterface(models.Dashboard) | |||
|
|||
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database") | |||
@staticmethod | |||
def mulexport(items): | |||
def mulexport(self, items): # pylint: disable=no-self-use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reasoning behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's related with this already merged PR: #8942
the @action
decorator creates a methods attribute on the method, this is defeated by making the method static
""" | ||
self.login(username="admin") | ||
argument = [1, 2] | ||
uri = f"api/v1/dashboard/export/?q={prison.dumps(argument)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the final URL here looks like api/v1/dashboard/export/?q=!(1,2)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yas
CATEGORY
Choose one
SUMMARY
Implements a dashboard export API endpoint. To have the exact same functionality on the API and on MVC
ModelView
. This will be used by the new React view for dashboards.Added enhanced security for the export, applying the filter that's applied for list and get
ADDITIONAL INFORMATION
REVIEWERS
@nytai