-
Notifications
You must be signed in to change notification settings - Fork 884
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
[Discover] Modify the search bar info box content for sql/ppl #8708
base: main
Are you sure you want to change the base?
[Discover] Modify the search bar info box content for sql/ppl #8708
Conversation
Signed-off-by: Ryan Liang <[email protected]>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8708 +/- ##
==========================================
- Coverage 60.75% 60.73% -0.03%
==========================================
Files 3798 3798
Lines 90650 90659 +9
Branches 14254 14259 +5
==========================================
- Hits 55076 55062 -14
- Misses 32079 32102 +23
Partials 3495 3495
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Ryan Liang <[email protected]>
Signed-off-by: Ryan Liang <[email protected]>
Signed-off-by: Jialiang Liang <[email protected]>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Signed-off-by: Jialiang Liang <[email protected]>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Unit testing is WIP. I'd gather some feedback first |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Signed-off-by: Jialiang Liang <[email protected]>
useEffect(() => { | ||
if ( | ||
props.selectedLanguage === 'SQL' && | ||
window.localStorage.getItem('hasSeenSQLInfoBox') === 'false' | ||
) { | ||
setIsLanguageReferenceOpen(true); | ||
window.localStorage.setItem('hasSeenSQLInfoBox', 'true'); | ||
} else if ( | ||
props.selectedLanguage === 'PPL' && | ||
window.localStorage.getItem('hasSeenPPLInfoBox') === 'false' | ||
) { | ||
setIsLanguageReferenceOpen(true); | ||
window.localStorage.setItem('hasSeenPPLInfoBox', 'true'); | ||
} | ||
}, [props.selectedLanguage]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to specify this here? can we make it generic. Something like this?
useEffect(() => { | |
if ( | |
props.selectedLanguage === 'SQL' && | |
window.localStorage.getItem('hasSeenSQLInfoBox') === 'false' | |
) { | |
setIsLanguageReferenceOpen(true); | |
window.localStorage.setItem('hasSeenSQLInfoBox', 'true'); | |
} else if ( | |
props.selectedLanguage === 'PPL' && | |
window.localStorage.getItem('hasSeenPPLInfoBox') === 'false' | |
) { | |
setIsLanguageReferenceOpen(true); | |
window.localStorage.setItem('hasSeenPPLInfoBox', 'true'); | |
} | |
}, [props.selectedLanguage]); | |
useEffect(() => { | |
if (autoShow) { | |
const storageKey = `hasSeenInfoBox_${selectedLanguage}`; | |
const hasSeenInfoBox = window.localStorage.getItem(storageKey); | |
if (hasSeenInfoBox === 'false') { | |
setIsLanguageReferenceOpen(true); | |
window.localStorage.setItem(storageKey, 'true'); | |
} | |
} | |
}, [props.selectedLanguage]); |
// Initialize local storage keys when the plugin loads, if they don't exist | ||
if (!window.localStorage.getItem('hasSeenSQLInfoBox')) { | ||
window.localStorage.setItem('hasSeenSQLInfoBox', 'false'); | ||
} | ||
if (!window.localStorage.getItem('hasSeenPPLInfoBox')) { | ||
window.localStorage.setItem('hasSeenPPLInfoBox', 'false'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we ned this? why not just use undefined as the intiial state. If the key does not exist, its false by default
Description
Issues Resolved
Screenshot
Screen.Recording.2024-10-26.at.2.32.25.AM.mov
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration