bito-code-review[bot] commented on code in PR #36933:
URL: https://github.com/apache/superset/pull/36933#discussion_r2892231067


##########
superset/embedded_chart/exceptions.py:
##########
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from superset.exceptions import SupersetException
+
+
+class EmbeddedChartPermalinkNotFoundError(SupersetException):
+    """Raised when an embedded chart permalink is not found or has expired."""
+
+    message = "The embedded chart permalink could not be found or has expired."

Review Comment:
   <!-- Bito Reply -->
   The fix adds i18n support with lazy_gettext and appropriate HTTP status 
codes. EmbeddedChartAccessDeniedError correctly uses 401 (matching the 
response_401() in the code), while PermalinkNotFound uses 404 and 
FeatureDisabled uses 403.



##########
superset/views/embedded_charts.py:
##########
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from flask_appbuilder import expose, has_access
+
+from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP
+from superset.superset_typing import FlaskResponse
+from superset.views.base import BaseSupersetView
+
+
+class EmbeddedChartsView(BaseSupersetView):
+    """View for managing embedded charts list."""
+
+    route_base = "/embeddedcharts"
+    class_permission_name = "Chart"
+    method_permission_name = MODEL_VIEW_RW_METHOD_PERMISSION_MAP
+
+    @expose("/list/")
+    @has_access
+    def list(self) -> FlaskResponse:
+        return super().render_app_template()

Review Comment:
   <!-- Bito Reply -->
   No, the suggestion isn’t fully correct — EmbeddedChartsView renders the 
admin list page at `/embeddedcharts/list/` within the main Superset SPA, so it 
correctly uses the default entry. The embedded chart iframe page is served by 
EmbeddedChartView in `embedded_chart/view.py`, which uses entry="embeddedChart".



-- 
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]

Reply via email to