-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Logs: Show older logs button when infinite scroll is enabled and sort order is descending #91060
Conversation
Hello @matyax!
Please, if the current pull request addresses a bug fix, label it with the |
This PR must be merged before a backport PR will be created. |
@@ -250,5 262,8 @@ const getStyles = (theme: GrafanaTheme2, oldestLogsFirst: boolean) => { | |||
align-items: center; | |||
margin-top: ${theme.spacing(1)}; |
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 can migrate these to the object format, but not here because this will be backported.
9ff42a7
to
0216fa7
Compare
Friendly reminder of this escalation. |
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.
Works great 👍
Co-authored-by: Sven Grossmann <[email protected]>
cc53341
to
2a03f7e
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-91060-to-v11.1.x origin/v11.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 40c6f741c08868f1fb42b5b5760faf1e5ef93b52 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-91060-to-v11.1.x
# Create the PR body template
PR_BODY=$(gh pr view 91060 --json body --template 'Backport 40c6f741c08868f1fb42b5b5760faf1e5ef93b52 from #91060{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title '[v11.1.x] Logs: Show older logs button when infinite scroll is enabled and sort order is descending' --body-file - --label 'type/bug' --label 'area/explore' --label 'area/frontend' --label 'add to changelog' --label 'backport' --base v11.1.x --milestone 11.1.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-91060-to-v11.1.x
# Create a pull request where the `base` branch is `v11.1.x` and the `compare`/`head` branch is `backport-91060-to-v11.1.x`.
# Remove the local backport branch
git switch main
git branch -D backport-91060-to-v11.1.x |
… order is descending (grafana#91060) * LogsNavigation: show older logs button when the order is descending * LogsNavigation: adjust styles for showing only older logs button * Logs Navigation: revert changes * Infinite scroll: add older logs button * Older logs button: show only in explore * chore: add unit test * Formatting * Update public/app/features/logs/components/InfiniteScroll.test.tsx Co-authored-by: Sven Grossmann <[email protected]> * Chore: add missing translation * Chore: move the button a tiny bit --------- Co-authored-by: Sven Grossmann <[email protected]>
When inifinte scrolling was introduced, it had a built-in behavior to detect scrolls in the top section and request more logs. Additionally, when infinite scroll is used, the old Logs Navigation component is not displayed.
After feedback that behavior was removed, but we never added a way to request older logs when the order is "oldest first".
This PR adds the button back when infinite scrolling is enabled, and the sort order is "oldest first", to allow to see older logs.
Demo.mov
Special notes for your reviewer:
We could do the same for "Newer logs", but it will require a more complex implementation that I wouldn't want to backport.