sadpandajoe commented on code in PR #45649:
URL: https://github.com/apache/superset/pull/45649#discussion_r4365358204
##########
superset-frontend/src/pages/DatasetList/index.tsx:
##########
@@ -1630,13 +1637,38 @@ const DatasetList: FunctionComponent<DatasetListProps>
= ({
addSuccessToast={addSuccessToast}
semanticView={svCurrentlyEditing}
/>
- <AddSemanticViewModal
- show={showAddSemanticViewModal}
- onHide={() => setShowAddSemanticViewModal(false)}
- onSuccess={refreshData}
- addDangerToast={addDangerToast}
- addSuccessToast={addSuccessToast}
- />
+ {semanticSetup === 'view' && (
+ <AddSemanticViewModal
+ show
+ onHide={() => {
+ setSemanticSetup('closed');
+ newDatasourceButtonRef.current?.focus();
+ }}
+ onCreateLayer={
+ canCreateLayer
+ ? () => {
+ if (
+ isFeatureEnabled(SEMANTIC_LAYERS_FLAG) &&
+ findPermission('can_write', 'SemanticLayer', user?.roles)
+ ) {
+ setSemanticSetup('layer');
+ }
+ }
+ : undefined
+ }
+ onSuccess={refreshData}
+ addDangerToast={addDangerToast}
+ addSuccessToast={addSuccessToast}
+ />
+ )}
+ {semanticSetup === 'layer' && (
+ <SemanticLayerModal
+ show
+ onHide={() => setSemanticSetup('view')}
Review Comment:
Agreed—if the user cancels while the create POST is in flight, the unmounted
modal drops the response, so the freshly mounted view picker can load its list
before the layer exists and stay empty until the dialog is reopened. Should the
create completion be reported back to the parent (or the picker refetched on a
later signal) even after cancel?
##########
superset/views/base.py:
##########
@@ -81,6 +81,7 @@
from .utils import bootstrap_user_data, get_config_value
FRONTEND_CONF_KEYS = (
+ "SEMANTIC_LAYER_DOCUMENTATION_URL",
Review Comment:
Agreed—`SEMANTIC_LAYER_DOCUMENTATION_URL` is added to the common bootstrap
conf unchanged, so a URL with embedded credentials is delivered to every user's
page even though the dialog only hides the link; the docs say such URLs are
hidden. Should the server drop or sanitize credential-bearing URLs before
exposing them?
--
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]