LogListControls: make tooltip more obvious (#105138)

* LogListControls: make tooltip more obvious

* Update test
pull/105158/head
Matias Chomicki 2 months ago committed by GitHub
parent a5708105df
commit d5235f52c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      public/app/features/logs/components/panel/LogListControls.test.tsx
  2. 4
      public/app/features/logs/components/panel/LogListControls.tsx
  3. 4
      public/locales/en-US/grafana.json

@ -32,7 +32,7 @@ describe('LogListControls', () => {
</LogListContextProvider>
);
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Oldest logs first')).toBeInTheDocument();
expect(screen.getByLabelText(/oldest logs first/)).toBeInTheDocument();
expect(screen.getByLabelText('Deduplication')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.getByLabelText('Show timestamps')).toBeInTheDocument();
@ -68,7 +68,7 @@ describe('LogListControls', () => {
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Scroll to top')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.queryByLabelText('Oldest logs first')).not.toBeInTheDocument();
expect(screen.queryByLabelText(/oldest logs first/)).not.toBeInTheDocument();
expect(screen.queryByLabelText('Deduplication')).not.toBeInTheDocument();
expect(screen.queryByLabelText('Show timestamps')).not.toBeInTheDocument();
expect(screen.queryByLabelText('Wrap lines')).not.toBeInTheDocument();
@ -83,7 +83,7 @@ describe('LogListControls', () => {
</LogListContextProvider>
);
expect(screen.getByLabelText('Scroll to bottom')).toBeInTheDocument();
expect(screen.getByLabelText('Oldest logs first')).toBeInTheDocument();
expect(screen.getByLabelText(/oldest logs first/)).toBeInTheDocument();
expect(screen.getByLabelText('Deduplication')).toBeInTheDocument();
expect(screen.getByLabelText('Display levels')).toBeInTheDocument();
expect(screen.getByLabelText('Show timestamps')).toBeInTheDocument();
@ -132,7 +132,7 @@ describe('LogListControls', () => {
<LogListControls eventBus={new EventBusSrv()} />
</LogListContextProvider>
);
await userEvent.click(screen.getByLabelText('Oldest logs first'));
await userEvent.click(screen.getByLabelText(/oldest logs first/));
expect(onLogOptionsChange).toHaveBeenCalledTimes(1);
expect(onLogOptionsChange).toHaveBeenCalledWith('sortOrder', LogsSortOrder.Descending);
});

@ -226,8 +226,8 @@ export const LogListControls = ({ eventBus, visualisationType = 'logs' }: Props)
onClick={onSortOrderClick}
tooltip={
sortOrder === LogsSortOrder.Descending
? t('logs.logs-controls.newest-first', 'Newest logs first')
: t('logs.logs-controls.oldest-first', 'Oldest logs first')
? t('logs.logs-controls.newest-first', 'Sorted by newest logs first - Click to show oldest first')
: t('logs.logs-controls.oldest-first', 'Sorted by oldest logs first - Click to show newest first')
}
size="lg"
/>

@ -6231,8 +6231,8 @@
"escape-newlines": "Fix incorrectly escaped newline and tab sequences in log lines",
"hide-timestamps": "Hide timestamps",
"hide-unique-labels": "Hide unique labels",
"newest-first": "Newest logs first",
"oldest-first": "Oldest logs first",
"newest-first": "Sorted by newest logs first - Click to show oldest first",
"oldest-first": "Sorted by oldest logs first - Click to show newest first",
"prettify-json": "Expand JSON logs",
"remove-escaping": "Remove escaping",
"scroll-bottom": "Scroll to bottom",

Loading…
Cancel
Save