-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Navigation-next]Register workspace list card into home page #7247
[Navigation-next]Register workspace list card into home page #7247
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7247 +/- ##
==========================================
- Coverage 67.72% 67.70% -0.02%
==========================================
Files 3518 3519 +1
Lines 69638 69679 +41
Branches 11365 11373 +8
==========================================
+ Hits 47165 47179 +14
- Misses 19684 19706 +22
- Partials 2789 2794 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
34f3eb2
to
601317a
Compare
570ccfa
to
1b798a3
Compare
d73444b
to
eaf5fea
Compare
370c9e7
to
2ed4e83
Compare
Looks like unnecessary commits are included, maybe you can do a cherry pick instead |
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
70de058
to
2897183
Compare
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
src/plugins/workspace/public/components/service_card/workspace_list_card.tsx
Outdated
Show resolved
Hide resolved
src/plugins/workspace/public/components/service_card/workspace_list_card.tsx
Outdated
Show resolved
Hide resolved
private loadWorkspaceListItems() { | ||
if (this.state.filter === 'viewed') { | ||
this.setState({ | ||
workspaceList: _.orderBy(this.state.recentWorkspaces, ['timestamp'], ['desc']) |
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 seems workspaceList
can be derived from existing state, I think we can simply compute it in the render()
function.
If you use functional react component, you can use useMemo
to avoid unnecessary recompute. Btw, why not use functional component? I can see it will make the implementation much simpler
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.
Btw, why not use functional component? I can see it will make it implementation much simple
when i try to use functional component, dashboard embeddable not able to render it
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.
Oh, that's odd, then I think you can keep the current implementation, I will investigate a bit on this, thanks ;)
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.
thanks to @ruanyl help on debugging, seems functional component don't any issue, convert to functional component now.
Signed-off-by: Hailong Cui <[email protected]>
src/plugins/workspace/public/components/service_card/workspace_list_card.tsx
Outdated
Show resolved
Hide resolved
src/plugins/workspace/public/components/service_card/workspace_list_card.tsx
Outdated
Show resolved
Hide resolved
src/plugins/workspace/public/components/service_card/workspace_list_card.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Hailong Cui <[email protected]>
) { | ||
if (contentManagement) { | ||
contentManagement.registerContentProvider({ | ||
id: HOME_PAGE_ID, |
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 guess the id is used for the content, not the page.
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.
Yes, this is the content provider id, you can give it any unique string, like workspace_list_card
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.
thanks for catching this, update to workspace_list_card_home
</EuiFlexGroup> | ||
|
||
<EuiSpacer /> | ||
<EuiListGroup flush={true} bordered={false} style={{ minHeight: '300px' }}> |
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'd suggest to have a future improvement task make this service card a flex container, so we don't need to specify a fix number 300px to stretch the list.
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
* workspace list card on home Signed-off-by: Hailong Cui <[email protected]> * fix merge conflicts Signed-off-by: Hailong Cui <[email protected]> * add home as requiredBundles Signed-off-by: Hailong Cui <[email protected]> * Changeset file for PR #7247 created/updated * fix failed UT Signed-off-by: Hailong Cui <[email protected]> * address review comments Signed-off-by: Hailong Cui <[email protected]> * update to funtional component Signed-off-by: Hailong Cui <[email protected]> * udpate content provider id Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit b32eade) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…7350) * workspace list card on home * fix merge conflicts * add home as requiredBundles * Changeset file for PR #7247 created/updated * fix failed UT * address review comments * update to funtional component * udpate content provider id --------- (cherry picked from commit b32eade) Signed-off-by: Hailong Cui <[email protected]> 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
Register workspace list card into home page
Empty state
Issues Resolved
#7294
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration