mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
fix(ui/filters): Improve platform instance filter (#13559)
This commit is contained in:
parent
3ee25c465c
commit
28b052c367
@ -7,6 +7,7 @@ import { ColorOptions, ColorValues, PillVariantOptions, PillVariantValues, SizeV
|
||||
|
||||
export const SUPPORTED_CONFIGURATIONS: Record<PillVariantOptions, ColorOptions[]> = {
|
||||
[PillVariantValues.filled]: [
|
||||
ColorValues.primary,
|
||||
ColorValues.violet,
|
||||
ColorValues.blue,
|
||||
ColorValues.green,
|
||||
@ -15,6 +16,7 @@ export const SUPPORTED_CONFIGURATIONS: Record<PillVariantOptions, ColorOptions[]
|
||||
ColorValues.gray,
|
||||
],
|
||||
[PillVariantValues.outline]: [
|
||||
ColorValues.primary,
|
||||
ColorValues.violet,
|
||||
ColorValues.blue,
|
||||
ColorValues.green,
|
||||
|
@ -3,6 +3,8 @@ import { Button, Checkbox } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import colors from '@components/theme/foundations/colors';
|
||||
|
||||
import { ANTD_GRAY } from '@app/entity/shared/constants';
|
||||
import { generateColor } from '@app/entityV2/shared/components/styled/StyledTag';
|
||||
import ParentEntities from '@app/searchV2/filters/ParentEntities';
|
||||
@ -32,6 +34,7 @@ const FilterOptionWrapper = styled.div<{ addPadding?: boolean }>`
|
||||
align-items: center;
|
||||
border-radius: 8px;
|
||||
margin: 0px 4px;
|
||||
|
||||
label {
|
||||
padding: 12px;
|
||||
width: 100%;
|
||||
@ -39,8 +42,8 @@ const FilterOptionWrapper = styled.div<{ addPadding?: boolean }>`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
${(props) => props.addPadding && 'padding-left: 16px;'}
|
||||
|
||||
${(props) => props.addPadding && 'padding-left: 16px;'}
|
||||
&:hover {
|
||||
background-color: ${ANTD_GRAY[3]};
|
||||
}
|
||||
@ -48,9 +51,11 @@ const FilterOptionWrapper = styled.div<{ addPadding?: boolean }>`
|
||||
|
||||
const StyledCheckbox = styled(Checkbox)`
|
||||
font-size: 14px;
|
||||
|
||||
.ant-checkbox-inner {
|
||||
border-color: ${ANTD_GRAY[7]};
|
||||
}
|
||||
|
||||
.ant-checkbox-checked {
|
||||
.ant-checkbox-inner {
|
||||
border-color: ${(props) => props.theme.styles['primary-color']};
|
||||
@ -113,6 +118,7 @@ const ParentWrapper = styled.div`
|
||||
const LabelWrapper = styled.div`
|
||||
line-height: normal;
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
filterOption: FilterOptionType;
|
||||
selectedFilterOptions: FilterOptionType[];
|
||||
@ -184,7 +190,17 @@ export default function FilterOption({
|
||||
</ParentWrapper>
|
||||
)}
|
||||
<LabelCountWrapper>
|
||||
<Label ellipsis={{ tooltip: label }} style={{ maxWidth: 150 }}>
|
||||
<Label
|
||||
ellipsis={{
|
||||
tooltip: {
|
||||
title: label,
|
||||
showArrow: false,
|
||||
color: 'white',
|
||||
overlayInnerStyle: { color: colors.gray[1700] },
|
||||
},
|
||||
}}
|
||||
style={{ maxWidth: 150 }}
|
||||
>
|
||||
{isSubTypeFilter ? capitalizeFirstLetterOnly(label as string) : label}
|
||||
</Label>
|
||||
{includeCount && <CountText>{getCountText()}</CountText>}
|
||||
|
@ -616,6 +616,9 @@ export const FilterEntityIcon: React.FC<FilterEntityIconProps> = ({ field, entit
|
||||
case field === PLATFORM_FILTER_NAME && entity !== null:
|
||||
return <>{icon}</>;
|
||||
|
||||
case field === DATA_PLATFORM_INSTANCE_FILTER_NAME && entity?.type === EntityType.DataPlatformInstance:
|
||||
return <>{icon}</>;
|
||||
|
||||
case field === TAGS_FILTER_NAME && entity?.type === EntityType.Tag:
|
||||
return <TagColor color={(entity as Tag).properties?.colorHex || ''} colorHash={entity?.urn} />;
|
||||
|
||||
|
@ -337,6 +337,9 @@ fragment autoCompleteFields on Entity {
|
||||
}
|
||||
}
|
||||
}
|
||||
... on DataPlatformInstance {
|
||||
...dataPlatformInstanceFields
|
||||
}
|
||||
}
|
||||
|
||||
query getAutoCompleteResults($input: AutoCompleteInput!) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user