-
Notifications
You must be signed in to change notification settings - Fork 920
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]Refactor use case selector in workspace creation page #8413
[Workspace]Refactor use case selector in workspace creation page #8413
Conversation
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8413 +/- ##
==========================================
+ Coverage 60.93% 60.94% +0.01%
==========================================
Files 3757 3758 +1
Lines 89263 89285 +22
Branches 13960 13968 +8
==========================================
+ Hits 54396 54419 +23
+ Misses 31479 31478 -1
Partials 3388 3388
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Left a few minor comment
| ||
<EuiLink onClick={handleLearnMoreClick}> | ||
{i18n.translate('workspace.form.panels.useCase.learnMore', { | ||
defaultMessage: 'Learn more.', |
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.
defaultMessage: 'Learn more.', | |
defaultMessage: 'Learn more', |
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.
{features && features.length > 0 && ( | ||
<> | ||
{i18n.translate('workspace.forms.useCaseFlyout.featuresIncluded', { | ||
defaultMessage: 'Features included:', |
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.
defaultMessage: 'Features included:', | |
defaultMessage: 'Features included', |
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.
i18n.translate( | ||
'workspace.forms.useCaseFlyout.featuresDetails.delimiter', | ||
{ | ||
defaultMessage: ', ', |
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.
Just curious, do we need i18n for this?
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 think this delimiter should have an i18n version, for example the comma in English and Chinese is a different symbol and will have different spacing. I think it would be a better idea using i18n.
src/core/utils/default_nav_groups.ts
Outdated
@@ -38,10 +38,11 @@ const defaultNavGroups = { | |||
all: { | |||
id: ALL_USE_CASE_ID, | |||
title: i18n.translate('core.ui.group.all.title', { | |||
defaultMessage: 'Analytics (All)', | |||
defaultMessage: 'Analytics (all features)', |
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.
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.
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
@Hailong-am I've removed the |
@@ -133,29 +103,68 @@ export const WorkspaceUseCase = ({ | |||
formErrors, | |||
availableUseCases, | |||
}: WorkspaceUseCaseProps) => { | |||
const [isFlyoutVisible, setIsFlyoutVisible] = useState(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.
nit: could named as isUseCaseFlyoutVisible
}: WorkspaceUseCaseFlyoutProps) => { | ||
return ( | ||
<EuiFlyout | ||
style={{ maxWidth: 431 }} |
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.
where does the 431 comes from?
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.
It's from the UX design.
if (featureId.endsWith('overview')) { | ||
continue; | ||
} |
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.
maybe remove get started
as well?
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
* Refactor use case selector in workspace create Signed-off-by: Lin Wang <wonglam@amazon.com> * Add gap for details panel title Signed-off-by: Lin Wang <wonglam@amazon.com> * Update use case name and description Signed-off-by: Lin Wang <wonglam@amazon.com> * Filter out hidden nav links Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #8413 created/updated * Add test case for different feature details Signed-off-by: Lin Wang <wonglam@amazon.com> * Change back to "Analytics" Signed-off-by: Lin Wang <wonglam@amazon.com> * Add all features suffix for all use case Signed-off-by: Lin Wang <wonglam@amazon.com> * Fix failed unit tests Signed-off-by: Lin Wang <wonglam@amazon.com> * Filter out getting started links Signed-off-by: Lin Wang <wonglam@amazon.com> * Renaming isFlyoutVisible to isUseCaseFlyoutVisible Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 7b5a379) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…) (#8444) * Refactor use case selector in workspace create * Add gap for details panel title * Update use case name and description * Filter out hidden nav links * Changeset file for PR #8413 created/updated * Add test case for different feature details * Change back to "Analytics" * Add all features suffix for all use case * Fix failed unit tests * Filter out getting started links * Renaming isFlyoutVisible to isUseCaseFlyoutVisible --------- (cherry picked from commit 7b5a379) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…nsearch-project#8413) (opensearch-project#8444) * Refactor use case selector in workspace create * Add gap for details panel title * Update use case name and description * Filter out hidden nav links * Changeset file for PR opensearch-project#8413 created/updated * Add test case for different feature details * Change back to "Analytics" * Add all features suffix for all use case * Fix failed unit tests * Filter out getting started links * Renaming isFlyoutVisible to isUseCaseFlyoutVisible --------- (cherry picked from commit 7b5a379) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
This PR is for refactoring the use case selector in the workspace creation page. It mainly refactors the features displayed in the use case card. The feature descriptions are moved to a separate use case flyout, which will be displayed after clicking the 'Learn more' button.
Screenshot
Testing the changes
yarn osd bootstrap --single-version loose
config/opensearch_dashboards.yml
yarn start --no-base-path
Changelog
Check List
yarn test:jest
yarn test:jest_integration