Skip to content

Commit 5d28b7e

Browse files
ziomeckaKatarzyna Ziomek-Zdanowicz
authored andcommitted
8822 ci (#66)
* 8822 Remove dashes from dashboard filter labels * 8822 Empty commit --------- Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>
1 parent 81f4585 commit 5d28b7e

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

public/app/features/variables/pickers/PickerRenderer.tsx

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
1-
import { css } from '@emotion/css';
1+
// import { css } from '@emotion/css';
22
import React, { CSSProperties, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';
3-
import { Stack } from '@mui/material';
43
// eslint-disable-next-line no-restricted-imports
54
import { useSelector } from 'react-redux';
65

7-
import { TypedVariableModel, VariableHide } from '@grafana/data';
86
import { selectors } from '@grafana/e2e-selectors';
97
import { Tooltip } from '@grafana/ui';
108
import { FnGlobalState } from 'app/core/reducers/fn-slice';
119
import type { StoreState } from 'app/types';
1210

1311
import { variableAdapters } from '../adapters';
14-
import { VARIABLE_PREFIX } from '../constants';
12+
import { VariableHide, VariableModel } from '../types';
1513

1614
interface Props {
17-
variable: TypedVariableModel;
15+
variable: VariableModel;
1816
readOnly?: boolean;
1917
}
2018

21-
const renderWrapperStyle = css`
22-
& button,
23-
& span,
24-
& label,
25-
& input {
26-
height: 24px;
27-
font-size: 12px;
28-
line-height: 24px;
29-
align-self: center;
30-
}
31-
`;
19+
// not using this style for now.
20+
// const renderWrapperStyle = css`
21+
// & button,
22+
// & span,
23+
// & label,
24+
// & input {
25+
// height: 35px;
26+
// font-size: 14px;
27+
// }
28+
29+
// /* Center align filter picker buttons */
30+
// & button {
31+
// margin-top: 2px;
32+
// }
33+
34+
// /* Adhoc filter: Disable green border and make input height similar to others */
35+
// & div[class*='input-wrapper'] {
36+
// min-height: 0 !important;
37+
// box-shadow: none !important;
38+
// }
39+
// `;
3240

3341
export const PickerRenderer: FunctionComponent<Props> = (props) => {
3442
const PickerToRender = useMemo(() => variableAdapters.get(props.variable.type).picker, [props.variable]);
@@ -38,25 +46,25 @@ export const PickerRenderer: FunctionComponent<Props> = (props) => {
3846
}
3947

4048
return (
41-
<Stack gap={0}>
49+
<div className="gf-form">
4250
<PickerLabel variable={props.variable} />
4351
{props.variable.hide !== VariableHide.hideVariable && PickerToRender && (
44-
<div className={renderWrapperStyle}>
52+
<div>
4553
<PickerToRender variable={props.variable} readOnly={props.readOnly ?? false} />
4654
</div>
4755
)}
48-
</Stack>
56+
</div>
4957
);
5058
};
5159

5260
const COMMON_PICKER_LABEL_STYLE: CSSProperties = {
53-
borderRadius: '2px',
5461
border: 'none',
55-
fontWeight: 400,
56-
fontSize: '12px',
62+
fontWeight: 500,
63+
fontSize: '14px',
5764
padding: '3px 6px',
5865
letterSpacing: '0.15px',
5966
height: '24px',
67+
marginTop: '2px',
6068
};
6169

6270
function PickerLabel({ variable }: PropsWithChildren<Props>): ReactElement | null {
@@ -66,22 +74,17 @@ function PickerLabel({ variable }: PropsWithChildren<Props>): ReactElement | nul
6674
const fnLabelStyle = useMemo(
6775
() => ({
6876
...COMMON_PICKER_LABEL_STYLE,
69-
...(FNDashboard
70-
? {
71-
color: mode === 'light' ? '#2D333E' : '#DBD9D7',
72-
backgroundColor: mode === 'light' ? '#E0E0E0' : '#56524D',
73-
}
74-
: {}),
77+
color: mode === 'light' ? '#2D333E' : '#DBD9D7',
7578
}),
76-
[mode, FNDashboard]
79+
[mode]
7780
);
7881

7982
if (variable.hide !== VariableHide.dontHide) {
8083
return null;
8184
}
8285
const fnLabelOrName = FNDashboard ? labelOrName.replace('druid_adhoc_filters', 'ad-hoc') : labelOrName;
8386

84-
const elementId = VARIABLE_PREFIX + variable.id;
87+
const elementId = `var-${variable.id}`;
8588
if (variable.description) {
8689
return (
8790
<Tooltip content={variable.description} placement={'bottom'}>

0 commit comments

Comments
 (0)