Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sqllab): Show warning message when deprecated db is selected #29607

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Jul 16, 2024

SUMMARY

When the selected database in the SQL editor is removed from the selection, the current implementation shows an empty state screen, making it appear as if all data has been lost.
This commit changes the behavior to display a deprecated state message when an SQL statement exists, clearly indicating the issue instead of showing an empty state screen.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--deprecated-message.mov

After:

Screenshot 2024-07-16 at 11 43 20 AM

TESTING INSTRUCTIONS

  • create a sql lab with a statement
  • delete the database connection that is used in the above sql editor
  • check the message in the sql editor

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added change:frontend Requires changing the frontend sqllab Namespace | Anything related to the SQL Lab labels Jul 16, 2024
@justinpark justinpark force-pushed the fix--show-error-message-on-deprecated-db-selected branch from 3e38002 to 4c62d8b Compare July 16, 2024 19:04
@justinpark justinpark changed the title Fix show error message on deprecated db selected fix(sqllab): Show warning message when deprecated db is selected Jul 16, 2024
const { findByText } = setup({ ...mockedProps, queryEditor }, store);
expect(
await findByText(
'The selected database is currently deprecated and cannot be used',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'The selected database is currently deprecated and cannot be used',
'The database that was used to generate this query could not be found',

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option perhaps "could not be reached"?

<Alert
type="warning"
message={t(
'The selected database is currently deprecated and cannot be used',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot assume that the database was deprecated. It may be an intermittent error. I suggest a more generic message.

Suggested change
'The selected database is currently deprecated and cannot be used',
'The database that was used to generate this query could not be found',

'The selected database is currently deprecated and cannot be used',
)}
description={t(
'Choose one of the available databases from the panel on the left.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'Choose one of the available databases from the panel on the left.',
'Choose one of the available databases on the left panel.',

@justinpark justinpark merged commit db3fa8d into apache:master Jul 17, 2024
34 checks passed
@justinpark justinpark deleted the fix--show-error-message-on-deprecated-db-selected branch July 17, 2024 17:38
@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Jul 17, 2024
michael-s-molina pushed a commit that referenced this pull request Aug 13, 2024
@github-actions github-actions bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend size/L sqllab Namespace | Anything related to the SQL Lab v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants