Skip to content
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

[Enhancement] #848 increase column width and page size #934

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kohinoor98
Copy link
Contributor

@kohinoor98 kohinoor98 commented Nov 16, 2023

Description

  1. Changed the Width of the Index column
  2. Changed Page Size options for the Indices tab

Issues Resolved

#848

Check List

  • Commits are signed per the DCO using --signoff
  • Tested code for multiple index lengths
  • Run yarn run test:jest -u

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@kohinoor98 kohinoor98 changed the title [ENHANCEMENT] #848 increase column width and page size [Enhancement] #848 increase column width and page size Nov 16, 2023
@@ -14,6 +14,7 @@ const renderNumber = (value) => {
};

export const DEFAULT_PAGE_SIZE_OPTIONS = [5, 10, 20, 50];
export const DEFAULT_PAGE_SIZE_OPTIONS_INDICES = [10, 20, 50, 100, 500];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add unit test for this pagination logic

@@ -45,7 +46,7 @@ const getColumns = (props: IColumnOptions): EuiTableFieldDataColumnType<ManagedC
sortable: true,
truncateText: false,
textOnly: true,
width: "250px",
width: "320px",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to let user drag the width of our table?
Currently although the text is capped, I remember user can hover on it and see the name which is fine.

Adding width here is not the best because people may have very long index name 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bowenlan-amzn Based on this I will go ahead and make the switch to the Data Grid component

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, @kamingleung is our UX expert and thanks him for guiding here!

Comment on lines +252 to +253
case "index":
return <IndexDetail {...this.props} index={rowData.index} />;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading this IndexDetail component is the cause of endless call. @kohinoor98 can you reach out to @SuZhou-Joe the writter for some guidance here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, will do. Thanks @bowenlan-amzn

@kamingleung
Copy link

@kohinoor98 Would you mind posting screenshots or video capture on the pages that have been migrated to DataGrid component? Thanks.

@@ -37,6 +40,7 @@ import { SECURITY_EXCEPTION_PREFIX } from "../../../../../server/utils/constants
import IndicesActions from "../IndicesActions";
import { destroyListener, EVENT_MAP, listenEvent } from "../../../../JobHandler";
import "./index.scss";
import IndexDetail from "../../../IndexDetail/containers/IndexDetail";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import IndexDetail from "../../../IndexDetail/containers/IndexDetail";
import IndexDetail from "../../containers/IndexDetail";

You are using wrong component here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IndexDetail inside IndexDetail page is a super heavy component and should not be rendered inside a cell of data grid.

@@ -6,6 +6,7 @@
import { PluginInitializerContext } from "opensearch-dashboards/public";
import { IndexManagementPlugin } from "./plugin";
import { Action, UIAction } from "../models/interfaces";
import "@opensearch-project/oui/dist/oui_theme_light.css";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The theme and its css should already be imported in OSD core, I do not think we should explicitly import theme.css in a plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup @SuZhou-Joe. I got rid of OUI(faced issues with the library and documentation) entirely and switched to EuiDataGrid.
I am still working on the pagination part for the table. I will push the latest code with screenshots as I get some time to test for edge cases.

Thanks,
KC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants