mikebridge commented on code in PR #46013:
URL: https://github.com/apache/superset/pull/46013#discussion_r4487888678
##########
superset-frontend/src/pages/DatasetList/index.tsx:
##########
@@ -703,6 +704,17 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
const canDuplicate = hasPerm('can_duplicate');
const canExport = hasPerm('can_export');
+ useEffect(() => {
+ if (
+ canCreate &&
+ isFeatureEnabled(SEMANTIC_LAYERS_FLAG) &&
+ new URLSearchParams(history.location.search).get('create') ===
+ 'semantic_view'
+ ) {
+ setSemanticSetup('view');
Review Comment:
Thanks for catching this. I now consume the `create` parameter with
`history.replace` before opening Add Semantic View, so reload or Back no longer
carries the trigger. The URL regression test failed before the fix and passes
in 7eca53c0af.
##########
superset-frontend/src/pages/DatasetList/index.tsx:
##########
@@ -703,6 +704,17 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
const canDuplicate = hasPerm('can_duplicate');
const canExport = hasPerm('can_export');
+ useEffect(() => {
+ if (
+ canCreate &&
+ isFeatureEnabled(SEMANTIC_LAYERS_FLAG) &&
Review Comment:
I added separate negative cases for Semantic Layers disabled and dataset
`_info` permissions without `can_write`, and verified that each test fails when
its corresponding guard is removed. Applied in 7eca53c0af.
##########
superset-frontend/src/pages/DatasetList/index.tsx:
##########
@@ -1906,14 +1918,14 @@ const DatasetList: FunctionComponent<DatasetListProps>
= ({
if (!selected.length) {
return t('0 Selected');
}
- if (virtualCount && !physicalCount) {
+ if (virtualCount && !physicalCount && !semanticViewCount) {
Review Comment:
I extended the selection test to a virtual dataset with a semantic view. It
catches the incorrect `2 Selected (Virtual)` label when `&& !semanticViewCount`
is removed. Applied in 7eca53c0af.
--
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]