aminghadersohi opened a new pull request, #37184:
URL: https://github.com/apache/superset/pull/37184

   ### SUMMARY
   
   This PR fixes a bug where the "You are editing a query from the virtual 
dataset" banner was incorrectly shown in SQL Lab for any URL with query 
parameters.
   
   **The Problem:**
   When opening SQL Lab via URL with query parameters (e.g., 
`/sqllab?dbid=1&schema=public&sql=SELECT...`), the `LocationContext` was 
hardcoding `isDataset: true` regardless of whether the `isDataset` parameter 
was actually passed.
   
   **The Fix:**
   - Changed `isDataset: true` to `isDataset: queryParams.get('isDataset') === 
'true'` in `LocationContext.tsx`
   - This ensures the virtual dataset banner only appears when explicitly 
intended (i.e., when editing a virtual dataset from the dataset editor which 
passes `isDataset=true`)
   
   Also fixes a typo: "edting" → "editing" in the banner text.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:** Virtual dataset banner appears incorrectly when opening SQL Lab 
via URL with any query parameters
   
   **After:** Banner only appears when `isDataset=true` is explicitly passed in 
the URL
   
   ### TESTING INSTRUCTIONS
   
   1. Open SQL Lab with query parameters but WITHOUT `isDataset=true`:
      - Navigate to `/sqllab?dbid=1&schema=public&sql=SELECT%201`
      - Verify the virtual dataset banner does NOT appear
   
   2. Open SQL Lab with `isDataset=true`:
      - Navigate to `/sqllab?dbid=1&schema=public&sql=SELECT%201&isDataset=true`
      - Verify the virtual dataset banner DOES appear
   
   3. Open SQL Lab from a virtual dataset's "Edit SQL" button:
      - Go to a virtual dataset's settings
      - Click the SQL Lab link
      - Verify the banner appears correctly
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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