Log Context: Add feedback button (#66910)

* add feedback link

* add feedback button to `Modal.ButtonRow`
This commit is contained in:
Sven Grossmann 2023-04-20 14:36:04 +02:00 committed by GitHub
parent 1917857186
commit bec18e390e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ import {
} from '@grafana/data';
import { config } from '@grafana/runtime';
import { DataQuery, TimeZone } from '@grafana/schema';
import { Button, LoadingBar, Modal, useTheme2 } from '@grafana/ui';
import { Icon, Button, LoadingBar, Modal, useTheme2 } from '@grafana/ui';
import { dataFrameToLogsModel } from 'app/core/logsModel';
import store from 'app/core/store';
import { splitOpen } from 'app/features/explore/state/main';
@ -93,6 +93,13 @@ const getStyles = (theme: GrafanaTheme2) => {
paddingBottom: css`
padding-bottom: ${theme.spacing(1)};
`,
link: css`
color: ${theme.colors.text.secondary};
font-size: ${theme.typography.bodySmall.fontSize};
:hover {
color: ${theme.colors.text.link};
}
`,
};
};
@ -327,8 +334,18 @@ export const LogRowContextModal: React.FunctionComponent<LogRowContextModalProps
Showing {context.before.length} lines {logsSortOrder === LogsSortOrder.Descending ? 'after' : 'before'} match.
</div>
</div>
{contextQuery?.datasource?.uid && (
<Modal.ButtonRow>
<Modal.ButtonRow>
<a
href="https://forms.gle/Tsk4pN7vD95aBRbb7"
className={styles.link}
title="We recently reworked the Log Context UI, please let us know how we can further improve it."
target="_blank"
rel="noreferrer noopener"
>
<Icon name="comment-alt-message" /> Give feedback
</a>
{contextQuery?.datasource?.uid && (
<Button
variant="secondary"
onClick={async () => {
@ -344,8 +361,8 @@ export const LogRowContextModal: React.FunctionComponent<LogRowContextModalProps
>
Open in split view
</Button>
</Modal.ButtonRow>
)}
)}
</Modal.ButtonRow>
</Modal>
);
};