grafana/public/app/features/explore/TraceView/uiElements.tsx
Andrej Ocenas cf1ebd5a3d
Tracing: Dark theme styling for TraceView (#23406)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Add trace ui in Explore

* WIP

* WIP

* WIP

* Make jaeger datasource return trace data instead of link

* Allow js in jest tests

* Return data from Jaeger datasource

* Take yarn.lock from master

* Fix missing component

* Update yarn lock

* Fix some ts and lint errors

* Fix merge

* Fix type errors

* Make tests pass again

* Add tests

* Fix es5 compatibility

* Add header with minimap

* Fix sizing issue due to column resizer handle

* Fix issues with sizing, search functionality, duplicate react, tests

* Refactor TraceView component, fix tests

* Fix type errors

* Add dark theme styling

* Add tests for hooks

* More color changes

* Fix tests to deal with additional theme wrappers.

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-04-14 13:26:33 +02:00

52 lines
1.5 KiB
TypeScript

import React from 'react';
import { ButtonProps, Elements } from '@jaegertracing/jaeger-ui-components';
import { Button, Input, stylesFactory, useTheme } from '@grafana/ui';
import { css } from 'emotion';
import { GrafanaTheme } from '@grafana/data';
import cx from 'classnames';
/**
* Right now Jaeger components need some UI elements to be injected. This is to get rid of AntD UI library that was
* used by default.
*/
// This needs to be static to prevent remounting on every render.
export const UIElements: Elements = {
Popover: (() => null as any) as any,
Tooltip: (() => null as any) as any,
Icon: (() => null as any) as any,
Dropdown: (() => null as any) as any,
Menu: (() => null as any) as any,
MenuItem: (() => null as any) as any,
Button: ({ onClick, children, className }: ButtonProps) => (
<Button variant={'secondary'} onClick={onClick} className={className}>
{children}
</Button>
),
Divider,
Input: props => <Input {...props} />,
InputGroup: ({ children, className, style }) => (
<span className={className} style={style}>
{children}
</span>
),
};
const getStyles = stylesFactory((theme: GrafanaTheme) => {
return {
Divider: css`
display: inline-block;
background: ${theme.isDark ? '#242424' : '#e8e8e8'};
width: 1px;
height: 0.9em;
margin: 0 8px;
vertical-align: middle;
`,
};
});
function Divider({ className }: { className?: string }) {
const styles = getStyles(useTheme());
return <div style={{}} className={cx(styles.Divider, className)} />;
}