-
Notifications
You must be signed in to change notification settings - Fork 917
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
[Workspace]Dismiss get started for search/essential/analytics overview page #8874
base: main
Are you sure you want to change the base?
[Workspace]Dismiss get started for search/essential/analytics overview page #8874
Conversation
❌ 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 #8874 +/- ##
==========================================
+ Coverage 60.87% 60.89% +0.01%
==========================================
Files 3808 3809 +1
Lines 91209 91280 +71
Branches 14410 14420 +10
==========================================
+ Hits 55526 55584 +58
- Misses 32142 32154 +12
- Partials 3541 3542 +1
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: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
d0d13a9
to
8b27d2d
Compare
} = useOpenSearchDashboards<CoreStart>(); | ||
const [isPopoverOpen, setIsPopoverOpen] = useState(false); | ||
const [isGetStartedDismissed, setIsGetStartedDismissed] = useState<boolean>( | ||
!!uiSettings.get(SEARCH_WORKSPACE_DISMISS_GET_STARTED) |
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.
Nit: I remember uiSettings has a get$ method that can return an observable, maybe we can use that and there is no need to have a state here.
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.
the state isGetStartedDismissed
used for multiple place and we need a variable for
const contextMenuItems = [
{
name: isGetStartedDismissed ? show : hide,
icon: <EuiIcon type={isGetStartedDismissed ? 'eye' : 'eyeClosed'} />,
onClick: async () => {
await dismissGetStartCards(!isGetStartedDismissed);
closePopover();
},
},
];
const pageId = props.pageId; | ||
const { pageId } = props; | ||
|
||
const uiSettingsKeyMap: Record<string, string> = { |
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.
I am thinking if we can make the dismiss button(including the popover) as a reuseable component, with the settingKey / text as its props.
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.
that's good idea, need find out a shared place for this component.
@@ -28,3 +29,14 @@ export const uiSettings: Record<string, UiSettingsParams> = { | |||
requiresPageReload: true, | |||
}, | |||
}; | |||
|
|||
export const searchOverviewPageUISetting: Record<string, UiSettingsParams> = { | |||
[SEARCH_WORKSPACE_DISMISS_GET_STARTED]: { |
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.
Instead of ui settings, shall we simply store it in local storage? I feel local storage makes more sense to me for a UI behavior
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.
we want to persist the settings and even if when they switch browser and devices.
Description
Add setting button for search overview page to let user to dismiss get started section
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration