aminghadersohi commented on code in PR #46013:
URL: https://github.com/apache/superset/pull/46013#discussion_r4486244535
##########
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:
Nit: No test selects a virtual dataset together with a semantic view:
dropping `&& !semanticViewCount` here keeps every test green and brings back "2
Selected (Virtual)".
##########
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:
Nit: No test opens `?create=semantic_view` with Semantic Layers off or as a
user without dataset write, so deleting the flag check here keeps every test
green. One negative case per guard would pin them.
##########
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:
`?create=semantic_view` is never removed, and the list's own query params
keep it, so after the modal is closed (or a view is saved) a reload or Back
from a dataset reopens Add Semantic View. Dropping the param when it opens
fixes it:
```suggestion
const params = new URLSearchParams(history.location.search);
params.delete('create');
history.replace({ ...history.location, search: params.toString() });
setSemanticSetup('view');
```
--
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]