eschutho commented on code in PR #41176:
URL: https://github.com/apache/superset/pull/41176#discussion_r3554027509
##########
superset/dashboards/api.py:
##########
@@ -2364,3 +2437,109 @@ def copy_dash(self, original_dash: Dashboard) ->
Response:
).timestamp(),
},
)
+
+ @expose("/<uuid_str>/versions/", methods=("GET",))
+ @protect()
+ @safe
+ @statsd_metrics
+ @event_logger.log_this_with_context(
+ action=lambda self, *args, **kwargs:
f"{self.__class__.__name__}.list_versions",
+ log_to_statsd=False,
+ )
+ def list_versions(self, uuid_str: str) -> Response:
+ """List version history for a dashboard.
+ ---
+ get:
+ summary: Return the version history for a dashboard
+ parameters:
+ - in: path
+ schema:
+ type: string
+ format: uuid
+ name: uuid_str
+ description: Dashboard UUID
+ responses:
+ 200:
+ description: Version history ordered by oldest first
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ result:
+ type: array
+ items:
+ $ref: '#/components/schemas/VersionListItemSchema'
+ count:
+ type: integer
+ 400:
+ $ref: '#/components/responses/400'
+ 401:
+ $ref: '#/components/responses/401'
+ 403:
+ $ref: '#/components/responses/403'
+ 404:
+ $ref: '#/components/responses/404'
+ """
+ return list_versions_endpoint(
+ self, Dashboard, uuid_str, access_kwarg="dashboard"
+ )
+
+ @expose(
+ "/<uuid_str>/versions/<version_uuid_str>/",
+ methods=("GET",),
Review Comment:
@mikebridge can you check to make sure that this is using an existing perm
rather than creating a new one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]