Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Dataset subfilter expanded by default and reduce margins #788

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function FilterItems({
const active = customFilters.find(value => value === item.id);
return (
<Checkbox
className="gn-sub-filter-items"
type="checkbox"
checked={!!active}
value={item.id}
Expand Down Expand Up @@ -137,7 +138,7 @@ function FilterItems({
});
}}>
<Message msgId={field.labelId}/>
{!!active && filterChild()}
{filterChild()}
</Checkbox>
</FormGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Dropdown from '@js/components/Dropdown';
import Button from '@js/components/Button';
import Badge from '@js/components/Badge';
import Message from '@mapstore/framework/components/I18N/Message';
import { getConfigProp } from '@mapstore/framework/utils/ConfigUtils';
import FaIcon from '@js/components/FaIcon';
import useLocalStorage from '@js/hooks/useLocalStorage';
import Menu from '@js/components/Menu';
Expand All @@ -31,11 +32,13 @@ const FiltersMenu = forwardRef(({
loading
}, ref) => {

const { isMobile } = getConfigProp('geoNodeSettings');
const selectedSort = orderOptions.find(({ value }) => order === value);
const [cardLayoutStyle, setCardLayoutStyle] = useLocalStorage('layoutCardsStyle', 'grid');
function handleToggleCardLayoutStyle() {
setCardLayoutStyle(cardLayoutStyle === 'grid' ? 'list' : 'grid');
}

return (
<div
className="gn-filters-menu gn-menu gn-default"
Expand All @@ -50,7 +53,7 @@ const FiltersMenu = forwardRef(({
size="sm"
onClick={onClick}
>
<FaIcon name="filter" />
{isMobile ? <FaIcon name="filter" /> : 'Filter'}
</Button>
{' '}
<Badge>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,14 @@
}
}
}

.gn-sub-filter-items.checkbox {

&:first-of-type {
margin-top: 5px;
}

&:last-child {
margin-bottom: 0;
}
}