-
Notifications
You must be signed in to change notification settings - Fork 919
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
[Discover] Fixes pagination style #5778
Merged
ashwin-pc
merged 6 commits into
opensearch-project:feature/table-revert
from
ashwin-pc:pagination-style
Feb 2, 2024
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fe9bd81
fixes pagination style
ashwin-pc f755266
style-lint fix
ashwin-pc f0ff842
fix react warning for unnecessary prop
ashwin-pc c5ff6ca
Show total hit count and pass services in embeddable
ashwin-pc cbf8ceb
removed unnecessary div
ashwin-pc ed3c178
Merge branch 'feature/table-revert' into pagination-style
ananzh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/plugins/discover/public/application/components/default_discover_table/_pagination.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.osdDocTable_pagination { | ||
width: 100%; | ||
|
||
& ~ table { | ||
margin-bottom: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/plugins/discover/public/application/components/default_discover_table/pagination.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { EuiFlexGroup, EuiFlexItem, EuiPagination } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { FormattedMessage } from '@osd/i18n/react'; | ||
import './_pagination.scss'; | ||
|
||
interface Props { | ||
pageCount: number; | ||
activePage: number; | ||
goToPage: (page: number) => void; | ||
startItem: number; | ||
endItem: number; | ||
totalItems: number; | ||
} | ||
|
||
export const Pagination = ({ | ||
pageCount, | ||
activePage, | ||
goToPage, | ||
startItem, | ||
endItem, | ||
totalItems, | ||
}: Props) => { | ||
return ( | ||
<EuiFlexGroup className="osdDocTable_pagination" alignItems="center" justifyContent="flexEnd"> | ||
<EuiFlexItem grow={false}> | ||
<FormattedMessage | ||
id="discover.docTable.pagerControl.pagesCountLabel" | ||
defaultMessage="{startItem}–{endItem} of {totalItems}" | ||
values={{ | ||
startItem, | ||
endItem, | ||
totalItems, | ||
}} | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiPagination | ||
pageCount={pageCount} | ||
activePage={activePage} | ||
onPageClick={(currentPage) => goToPage(currentPage)} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/plugins/vis_augmenter/public/view_events_flyout/components/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is to fix a style-lint error. unrelated to this PR