-
Notifications
You must be signed in to change notification settings - Fork 65
Traces - Custom source switch to data grid #2390
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f059ffa
change from memory table to eui data grid
599145b
progress on eui data grid and query
46bbd01
progress, seperated pagnation refresh, working on traces
21378f7
rever traces to normal, handle both in UI
8e64bf7
load more button for traces
1e55ae1
refresh fixes, prevent requery of services with filter add, invalid d…
d35a515
Merge branch 'main' into tracesCustomDataGrid
TackAdam 0492210
remove test of removed state
5e42e11
inject html to format euidatagrid
5c5090a
Merge branch 'main' into tracesCustomDataGrid
TackAdam e54b7a3
add loader, fix pagination sorting, fix attribute columns
d64b67d
fix lint errors
b3adb25
add test back
d37c2b5
add cypress testing
5e89941
remove only
8ed7260
fix flaky service test
f5ff592
fix bug for pagnation in span list
5974927
address comments, fix full screen bug for pagination
d158813
Merge branch 'main' into tracesCustomDataGrid
TackAdam 826185e
address comments, fix sorting for traces
4c93596
Merge branch 'main' into tracesCustomDataGrid
TackAdam 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
73 changes: 73 additions & 0 deletions
73
...onents/trace_analytics/components/common/shared_components/component_helper_functions.tsx
This file contains hidden or 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,73 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { useEffect } from 'react'; | ||
|
||
// Injects the size warning and Load buttons into the corners of EUI Data Grid | ||
export const useInjectElementsIntoGrid = ( | ||
rowCount: number, | ||
maxDisplayRows: number, | ||
tracesTableMode: string, | ||
loadMoreHandler?: () => void | ||
) => { | ||
useEffect(() => { | ||
setTimeout(() => { | ||
const toolbar = document.querySelector<HTMLElement>('.euiDataGrid__controls'); | ||
if (toolbar && rowCount > maxDisplayRows) { | ||
toolbar.style.display = 'flex'; | ||
toolbar.style.alignItems = 'center'; | ||
toolbar.style.justifyContent = 'space-between'; | ||
|
||
let warningDiv = toolbar.querySelector<HTMLElement>('.trace-table-warning'); | ||
if (!warningDiv) { | ||
warningDiv = document.createElement('div'); | ||
warningDiv.className = 'trace-table-warning'; | ||
|
||
const strongElement = document.createElement('strong'); | ||
strongElement.textContent = `${maxDisplayRows}`; | ||
|
||
const textSpan = document.createElement('span'); | ||
textSpan.appendChild(strongElement); | ||
textSpan.appendChild(document.createTextNode(' results shown out of ')); | ||
textSpan.appendChild(document.createTextNode(` ${rowCount}`)); | ||
|
||
warningDiv.appendChild(textSpan); | ||
|
||
toolbar.appendChild(warningDiv); | ||
} | ||
} | ||
|
||
const pagination = document.querySelector<HTMLElement>('.euiDataGrid__pagination'); | ||
|
||
if (tracesTableMode !== 'traces') { | ||
if (pagination) { | ||
const existingLoadMoreButton = pagination.querySelector('.trace-table-load-more'); | ||
if (existingLoadMoreButton) { | ||
existingLoadMoreButton.remove(); | ||
} | ||
} | ||
return; | ||
} | ||
|
||
if (pagination && loadMoreHandler) { | ||
pagination.style.display = 'flex'; | ||
pagination.style.alignItems = 'center'; | ||
pagination.style.justifyContent = 'space-between'; | ||
|
||
let loadMoreButton = pagination.querySelector<HTMLElement>('.trace-table-load-more'); | ||
if (!loadMoreButton) { | ||
loadMoreButton = document.createElement('button'); | ||
loadMoreButton.className = 'trace-table-load-more euiButtonEmpty euiButtonEmpty--text'; | ||
loadMoreButton.style.marginLeft = '12px'; | ||
loadMoreButton.innerText = 'Load more data'; | ||
|
||
loadMoreButton.onclick = () => loadMoreHandler(); | ||
|
||
pagination.appendChild(loadMoreButton); | ||
} | ||
} | ||
}, 100); | ||
}, [rowCount, tracesTableMode, loadMoreHandler]); | ||
}; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.