Skip to content

Commit

Permalink
take 1
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas committed Aug 10, 2023
1 parent ec9e9a4 commit e1b6ee5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export const DraggableFilter: React.FC<FilterTabTitleProps> = ({
},
});
drag(drop(ref));

//this is gross... we should pass in the filter/divider type, rather than inferring from the generated ID.

Check failure on line 134 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Expected exception block, space or tab after '//' in comment

Check failure on line 134 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Expected exception block, space or tab after '//' in comment
const filterIcon = filterIds[0].split('-')[0] == "NATIVE_FILTER" ? <Icons.FilterSmall /> : <Icons.BorderVerticleOutlined />;

Check failure on line 135 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Replace `·filterIds[0].split('-')[0]·==·"NATIVE_FILTER"·?·<Icons.FilterSmall·/>·:·<Icons.BorderVerticleOutlined·/>` with `⏎····filterIds[0].split('-')[0]·==·'NATIVE_FILTER'·?·(⏎······<Icons.FilterSmall·/>⏎····)·:·(⏎······<Icons.BorderVerticleOutlined·/>⏎····)`

Check failure on line 135 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Expected '===' and instead saw '=='

Check failure on line 135 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Replace `·filterIds[0].split('-')[0]·==·"NATIVE_FILTER"·?·<Icons.FilterSmall·/>·:·<Icons.BorderVerticleOutlined·/>` with `⏎····filterIds[0].split('-')[0]·==·'NATIVE_FILTER'·?·(⏎······<Icons.FilterSmall·/>⏎····)·:·(⏎······<Icons.BorderVerticleOutlined·/>⏎····)`

Check failure on line 135 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Expected '===' and instead saw '=='

return (
<Container ref={ref} isDragging={isDragging}>
<DragIcon
Expand All @@ -138,6 +142,7 @@ export const DraggableFilter: React.FC<FilterTabTitleProps> = ({
className="dragIcon"
viewBox="4 4 16 16"
/>
{filterIcon}
<div css={{ flex: 1 }}>{children}</div>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
*/
import React, { useRef } from 'react';
import { NativeFilterType, styled, t, useTheme } from '@superset-ui/core';
import { AntdDropdown } from 'src/components';
import { MainNav as Menu } from 'src/components/Menu';
import { DropdownButton } from 'src/components/DropdownButton';
import { DropdownButtonProps } from 'antd/lib/dropdown';
import Icons from 'src/components/Icons';
import { MainNav } from 'src/components/Menu';
import FilterTitleContainer from './FilterTitleContainer';
import { FilterRemoval } from './types';

Expand Down Expand Up @@ -52,11 +54,6 @@ const TabsContainer = styled.div`
flex-direction: column;
`;

const options = [
{ label: t('Filter'), type: NativeFilterType.NATIVE_FILTER },
{ label: t('Divider'), type: NativeFilterType.DIVIDER },
];

const FilterTitlePane: React.FC<Props> = ({
getFilterTitle,
onChange,
Expand Down Expand Up @@ -88,27 +85,30 @@ const FilterTitlePane: React.FC<Props> = ({
}, 0);
};
const menu = (
<Menu mode="horizontal">
{options.map(item => (
<Menu.Item onClick={() => handleOnAdd(item.type)}>
{item.label}
</Menu.Item>
))}
</Menu>
<MainNav mode="horizontal">
<MainNav.Item onClick={() => handleOnAdd(NativeFilterType.DIVIDER)}>

Check failure on line 89 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `··`

Check failure on line 89 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `··`
{t('Add Divider')}

Check failure on line 90 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `····`

Check failure on line 90 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `····`
</MainNav.Item>

Check failure on line 91 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `··`

Check failure on line 91 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Delete `··`
</MainNav>
);

const StyledDropdownButton = styled(
DropdownButton as React.FC<DropdownButtonProps>,
)`
padding: ${theme.gridUnit * 2}px ${theme.gridUnit * 4}px;
`;

return (
<TabsContainer>
<AntdDropdown
<StyledDropdownButton
overlay={menu}
arrow
placement="topLeft"
trigger={['hover']}
icon={<Icons.CaretDown />}
>
<StyledAddBox>
<div data-test="new-dropdown-icon" className="fa fa-plus" />{' '}
<span>{t('Add filters and dividers')}</span>
</StyledAddBox>
</AntdDropdown>
<span onClick={() => handleOnAdd(NativeFilterType.NATIVE_FILTER)}>

Check failure on line 108 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Static HTML elements with event handlers require a role

Check failure on line 108 in superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx

View workflow job for this annotation

GitHub Actions / frontend-build

Static HTML elements with event handlers require a role
{t('Add Filter')}
</span>
</StyledDropdownButton>
<div
css={{
height: '100%',
Expand Down
2 changes: 1 addition & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
TALISMAN_DEV_CONFIG = {
"content_security_policy": {
"default-src": ["'self'"],
"img-src": ["'self'", "data:"],
"img-src": ["'self'", "data:", "upload.wikimedia.org"],
"worker-src": ["'self'", "blob:"],
"connect-src": [
"'self'",
Expand Down

0 comments on commit e1b6ee5

Please sign in to comment.