You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2024/12/06 21:25:42 UTC

(superset) branch filter-type-icons updated: feat(native filters): adding filter type icons

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch filter-type-icons
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/filter-type-icons by this push:
     new da09464c01 feat(native filters): adding filter type icons
da09464c01 is described below

commit da09464c01c03ec3514eb4de2d6999f09a28fa9e
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Fri Dec 6 14:25:22 2024 -0700

    feat(native filters): adding filter type icons
---
 .../FiltersConfigModal/FilterTitleContainer.tsx     | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
index 495009f0d0..02d813077c 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx
@@ -55,6 +55,18 @@ const StyledTrashIcon = styled(Icons.Trash)`
   color: ${({ theme }) => theme.colors.grayscale.light3};
 `;
 
+const StyledFilterIcon = styled(Icons.Filter)`
+  color: ${({ theme }) => theme.colors.grayscale.light2};
+  margin-right: ${({ theme }) => theme.gridUnit * 2}px;
+  line-height: normal;
+`;
+
+const StyledDividerIcon = styled(Icons.PicCenterOutlined)`
+  color: ${({ theme }) => theme.colors.grayscale.light2};
+  margin-right: ${({ theme }) => theme.gridUnit * 2}px;
+  line-height: normal;
+`;
+
 const StyledWarning = styled(Icons.Warning)`
   color: ${({ theme }) => theme.colors.error.base};
   &.anticon {
@@ -79,6 +91,10 @@ interface Props {
   erroredFilters: string[];
 }
 
+const isFilterDivider = (id: string) => {
+  return id.startsWith('NATIVE_FILTER_DIVIDER') ? true : false;
+};
+
 const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
   (
     {
@@ -120,6 +136,11 @@ const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
                 wordBreak: 'break-all',
               }}
             >
+              {isFilterDivider(id) ? (
+                <StyledDividerIcon iconSize="m" />
+              ) : (
+                <StyledFilterIcon iconSize="m" />
+              )}{' '}
               {isRemoved ? t('(Removed)') : getFilterTitle(id)}
             </div>
             {!removedFilters[id] && isErrored && (