From dcea6c09ca7d22e73bcce03df285d1635bb95667 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 15 Apr 2025 13:30:45 -0700 Subject: [PATCH] fix imports --- .../ListView/Filters/NumericalRange.tsx | 10 ++--- .../DatasourcePanel/DatasourcePanelItem.tsx | 44 ++++--------------- .../src/features/users/UserListModal.tsx | 14 +++--- .../src/pages/UsersList/index.tsx | 43 +++++++++--------- 4 files changed, 43 insertions(+), 68 deletions(-) diff --git a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx index 04c4f29fec8..0283015fecb 100644 --- a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx +++ b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx @@ -38,16 +38,16 @@ const InputContainer = styled.div` `; const StyledDivider = styled.span` - margin: 0 ${({ theme }) => theme.gridUnit * 2}px; + margin: 0 ${({ theme }) => theme.sizeUnit * 2}px; color: ${({ theme }) => theme.colors.grayscale.base}; - font-weight: ${({ theme }) => theme.typography.weights.bold}; - font-size: ${({ theme }) => theme.typography.sizes.m}px; + font-weight: ${({ theme }) => theme.fontWeightNormal}; + font-size: ${({ theme }) => theme.fontSize}px; `; const ErrorMessage = styled.div` color: ${({ theme }) => theme.colors.error.base}; - font-size: ${({ theme }) => theme.typography.sizes.s}px; - font-weight: ${({ theme }) => theme.typography.weights.bold}; + font-size: ${({ theme }) => theme.fontSizeSM}px; + font-weight: ${({ theme }) => theme.fontWeightNormal}; position: absolute; bottom: -50%; left: 0; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx index b2dfd9b4e2b..76a66c6325f 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx @@ -36,18 +36,6 @@ export const DEFAULT_MAX_COLUMNS_LENGTH = 50; export const DEFAULT_MAX_METRICS_LENGTH = 50; export const ITEM_HEIGHT = 30; -const Button = styled.button` - background: none; - border: none; - text-decoration: underline; - color: ${({ theme }) => theme.colorPrimaryText}; -`; - -const ButtonContainer = styled.div` - text-align: center; - padding-top: 2px; -`; - const LabelWrapper = styled.div` ${({ theme }) => css` color: ${theme.colors.grayscale.dark1}; @@ -55,9 +43,9 @@ const LabelWrapper = styled.div` text-overflow: ellipsis; font-size: ${theme.fontSizeSM}px; background-color: ${theme.colors.grayscale.light4}; - margin: ${theme.gridUnit * 2}px 0; + margin: ${theme.sizeUnit * 2}px 0; border-radius: ${theme.borderRadius}px; - padding: 0 ${theme.gridUnit}px; + padding: 0 ${theme.sizeUnit}px; &:first-of-type { margin-top: 0; @@ -82,7 +70,7 @@ const LabelWrapper = styled.div` .metric-option { & > svg { - min-width: ${theme.gridUnit * 4}px; + min-width: ${theme.sizeUnit * 4}px; } & > .option-label { overflow: hidden; @@ -114,22 +102,6 @@ const SectionHeader = styled.span` `} `; -const Box = styled.div` - ${({ theme }) => ` - border: 1px ${theme.colors.grayscale.light4} solid; - border-radius: ${theme.gridUnit}px; - font-size: ${theme.fontSizeSM}px; - padding: ${theme.gridUnit}px; - color: ${theme.colors.grayscale.light1}; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - `} -`; - const Divider = styled.div` ${({ theme }) => css` height: 16px; @@ -186,7 +158,7 @@ const DatasourcePanelItem = ({ css={ tooltipNode && css` - margin-top: ${theme.gridUnit}px; + margin-top: ${theme.sizeUnit}px; ` } > @@ -205,14 +177,14 @@ const DatasourcePanelItem = ({ const folder = folderMap.get(item.folderId); if (!folder) return null; - const indentation = item.depth * theme.gridUnit * 4; + const indentation = item.depth * theme.sizeUnit * 4; return (
{item.type === 'header' && ( @@ -234,7 +206,7 @@ const DatasourcePanelItem = ({
@@ -391,42 +392,42 @@ function UsersList({ user }: UsersListProps) { ); } - const filters: Filters = useMemo( + const filters: ListViewFilters = useMemo( () => [ { Header: t('First name'), key: 'first_name', id: 'first_name', input: 'search', - operator: FilterOperator.Contains, + operator: ListViewFilterOperator.Contains, }, { Header: t('Last name'), key: 'last_name', id: 'last_name', input: 'search', - operator: FilterOperator.Contains, + operator: ListViewFilterOperator.Contains, }, { Header: t('Username'), key: 'username', id: 'username', input: 'search', - operator: FilterOperator.Contains, + operator: ListViewFilterOperator.Contains, }, { Header: t('Email'), key: 'email', id: 'email', input: 'search', - operator: FilterOperator.Contains, + operator: ListViewFilterOperator.Contains, }, { Header: t('Is active?'), key: 'active', id: 'active', input: 'select', - operator: FilterOperator.Equals, + operator: ListViewFilterOperator.Equals, unfilteredLabel: t('All'), selects: isActiveOptions?.map(option => ({ label: option.label, @@ -439,7 +440,7 @@ function UsersList({ user }: UsersListProps) { key: 'roles', id: 'roles', input: 'select', - operator: FilterOperator.RelationManyMany, + operator: ListViewFilterOperator.RelationManyMany, unfilteredLabel: t('All'), selects: roles?.map(role => ({ label: role.name, @@ -452,7 +453,7 @@ function UsersList({ user }: UsersListProps) { key: 'created_on', id: 'created_on', input: 'datetime_range', - operator: FilterOperator.Between, + operator: ListViewFilterOperator.Between, dateFilterValueType: 'iso', }, { @@ -460,7 +461,7 @@ function UsersList({ user }: UsersListProps) { key: 'changed_on', id: 'changed_on', input: 'datetime_range', - operator: FilterOperator.Between, + operator: ListViewFilterOperator.Between, dateFilterValueType: 'iso', }, { @@ -468,7 +469,7 @@ function UsersList({ user }: UsersListProps) { key: 'last_login', id: 'last_login', input: 'datetime_range', - operator: FilterOperator.Between, + operator: ListViewFilterOperator.Between, dateFilterValueType: 'iso', }, { @@ -476,7 +477,7 @@ function UsersList({ user }: UsersListProps) { key: 'login_count', id: 'login_count', input: 'numerical_range', - operator: FilterOperator.Between, + operator: ListViewFilterOperator.Between, min: loginCountStats.min, max: loginCountStats.max, }, @@ -485,7 +486,7 @@ function UsersList({ user }: UsersListProps) { key: 'fail_login_count', id: 'fail_login_count', input: 'numerical_range', - operator: FilterOperator.Between, + operator: ListViewFilterOperator.Between, }, ], [isLoading, roles, loginCountStats, failLoginCountStats], @@ -504,7 +505,7 @@ function UsersList({ user }: UsersListProps) { iconColor={theme.colors.primary.light5} iconSize="m" css={css` - margin: auto ${theme.gridUnit * 2}px auto 0; + margin: auto ${theme.sizeUnit * 2}px auto 0; vertical-align: text-top; `} />