-
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]Fix/UI of assets table #8519
[workspace]Fix/UI of assets table #8519
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8519 +/- ##
==========================================
+ Coverage 60.85% 60.92% +0.06%
==========================================
Files 3802 3808 +6
Lines 91062 91190 +128
Branches 14376 14399 +23
==========================================
+ Hits 55419 55554 +135
+ Misses 32104 32083 -21
- Partials 3539 3553 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1c905bc
to
746db1c
Compare
@@ -283,13 +298,71 @@ export class Table extends PureComponent<TableProps, TableState> { | |||
'data-test-subj': 'updated-at', | |||
render: (updatedAt: string) => updatedAt && moment(updatedAt).format(dateFormat), | |||
} as EuiTableFieldDataColumnType<SavedObjectWithMetadata<any>>, | |||
...columnRegistry.getAll().map((column) => { |
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 are not supposed to delete the columnRegistry here, it is an extension point for other plugins to register their customized column.
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 the comment, already updated
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
223dd7d
to
ef28e15
Compare
@@ -224,7 +223,7 @@ export class Table extends PureComponent<TableProps, TableState> { | |||
<EuiToolTip position="top" content={getSavedObjectLabel(type)}> | |||
<EuiIcon | |||
aria-label={getSavedObjectLabel(type)} | |||
type={object.meta.icon || 'apps'} | |||
type={object.type === 'config' ? 'gear' : object.meta.icon || 'app'} |
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 don't we just changed the meta.icon
?
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 all the comments, updated.
panelPaddingSize="s" | ||
data-test-subj="workspace-column-popover" | ||
> | ||
{workspaceNames?.slice(1).map((ws) => ( |
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 ws
may be undefined, shall we filter those workspace out?
expect(getByTestId('workspace-column-popover')).toBeInTheDocument(); | ||
expect(getByText('foo')).toBeInTheDocument(); | ||
expect(getByText('bar')).toBeInTheDocument(); |
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: we could use findByText or findByTestId for such kind of assertion, those commands have retry mechanism out of the box.
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
setShowBadgePopover(false); | ||
}; | ||
|
||
if (workspaceNames) { |
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.
if (workspaceNames) { | |
if (workspaceNames?.length) { |
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 comment, updated
Signed-off-by: Qxisylolo <[email protected]>
@@ -109,7 +109,6 @@ import { DataPublicPluginStart } from '../../../../../plugins/data/public'; | |||
import { DuplicateObject } from '../types'; | |||
import { formatWorkspaceIdParams } from '../../utils'; | |||
import { NavigationPublicPluginStart } from '../../../../navigation/public'; | |||
import { WorkspaceObject } from '../../../../workspaces/public'; |
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 this import been removed?
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 spotting the error already reverted.
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.
Seems it should import from core now:
import { WorkspaceObject } from '../../../../../core/public';
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.
This import is correct, sorry I haven't made a double check. already updated
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.
No problem, I guess the export location was changed in another PR, thanks for fixing this.
@@ -637,7 +637,6 @@ describe('SavedObjectsTable', () => { | |||
{ force: true } | |||
); | |||
expect(component.state('selectedSavedObjects').length).toBe(0); | |||
expect(notifications.toasts.addDanger).not.toHaveBeenCalled(); |
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.
any reason to remove this assertion?
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 spotting the error, I think it is an accidental delete. already reverted.
Signed-off-by: Qxisylolo <[email protected]>
937fc4e
to
9c91505
Compare
Signed-off-by: Qxisylolo <[email protected]>
* fix/UI_of_assets_table Signed-off-by: Qxisylolo <[email protected]> * fix/the_UI_of_assets_table, add tests Signed-off-by: Qxisylolo <[email protected]> * use workspaceNameIdLookup Signed-off-by: Qxisylolo <[email protected]> * delete comment Signed-off-by: Qxisylolo <[email protected]> * use workspace column Signed-off-by: Qxisylolo <[email protected]> * Changeset file for PR #8519 created/updated * use gear icon Signed-off-by: Qxisylolo <[email protected]> * use gear icon Signed-off-by: Qxisylolo <[email protected]> * new update Signed-off-by: Qxisylolo <[email protected]> * revert deleted line Signed-off-by: Qxisylolo <[email protected]> * correct import Signed-off-by: Qxisylolo <[email protected]> --------- Signed-off-by: Qxisylolo <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 6e851ff) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This pr addresses the UI of assets table by:
Screenshot
Changelog
Check List
yarn test:jest
yarn test:jest_integration