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