[Fix]: Threshold in dashboard fixes (#3979)

* fix: the extra showcase for text and background

* fix: css issue for select
This commit is contained in:
Rajat Dabade 2023-11-16 12:51:35 +05:30 committed by GitHub
parent 9333fdcd0b
commit dc7a55e871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,7 +237,7 @@ function Threshold({
)} )}
{isEditMode ? ( {isEditMode ? (
<Select <Select
style={{ maxWidth: '200px', backgroundColor: '#141414' }} style={{ minWidth: '200px', backgroundColor: '#141414' }}
bordered={false} bordered={false}
defaultValue={unit} defaultValue={unit}
options={unitOptions} options={unitOptions}
@ -253,22 +253,21 @@ function Threshold({
<Space direction="vertical"> <Space direction="vertical">
<Typography.Text>Show with</Typography.Text> <Typography.Text>Show with</Typography.Text>
<Space> <Space>
{isEditMode ? ( {isEditMode && selectedGraph === PANEL_TYPES.TIME_SERIES ? (
<ColorSelector setColor={setColor} thresholdColor={color} /> <ColorSelector setColor={setColor} thresholdColor={color} />
) : ( ) : (
<ShowCaseValue width="100px" value={<CustomColor color={color} />} /> <ShowCaseValue width="100px" value={<CustomColor color={color} />} />
)} )}
{isEditMode && selectedGraph === PANEL_TYPES.VALUE ? ( {isEditMode && selectedGraph === PANEL_TYPES.VALUE ? (
<>
<Select <Select
style={{ minWidth: '100px' }} style={{ minWidth: '100px' }}
defaultValue={format} defaultValue={format}
options={showAsOptions} options={showAsOptions}
onChange={handlerFormatChange} onChange={handlerFormatChange}
/> />
) : (
<ShowCaseValue width="100px" value={format} /> <ShowCaseValue width="100px" value={format} />
</> )}
) : null}
</Space> </Space>
</Space> </Space>
</div> </div>