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

Clear filters button not well aligned and not visible #944

Merged
merged 2 commits into from
Apr 20, 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 @@ -57,7 +57,15 @@ function FilterForm({
<div className="gn-filter-form" style={styleContainerForm} >
<div className="gn-filter-form-header">
<div className="gn-filter-form-title">
<FaIcon name="filter"/> <strong><Message msgId="gnhome.filters"/></strong>
<div><FaIcon name="filter" /> <strong><Message msgId="gnhome.filters" /></strong></div>
<Button
size="sm"
variant="default"
onClick={onClear}
disabled={isEmpty(query)}
>
<Message msgId="gnhome.clearFilters"/>
</Button>
</div>
<Button
variant="default"
Expand Down Expand Up @@ -99,16 +107,6 @@ function FilterForm({
</form>
</div>
</div>
<div className="gn-filter-form-footer">
<Button
size="sm"
variant="default"
onClick={onClear}
disabled={isEmpty(query)}
>
<Message msgId="gnhome.clearFilters"/>
</Button>
</div>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('FiltersForm component', () => {
ReactDOM.render( <FiltersForm show onClear={onClear} query={{ q: 'A' }} submitOnChangeField={false} />, document.getElementById("container"));
const filterFormNode = document.querySelector('.gn-filter-form');
expect(filterFormNode).toBeTruthy();
const footerButtons = filterFormNode.querySelectorAll('.gn-filter-form-footer > button');
const footerButtons = filterFormNode.querySelectorAll('.gn-filter-form-title > button');
expect(footerButtons.length).toBe(1);
const clearButton = footerButtons[0];
Simulate.click(clearButton);
Expand All @@ -65,7 +65,7 @@ describe('FiltersForm component', () => {
ReactDOM.render( <FiltersForm show submitOnChangeField />, document.getElementById("container"));
const filterFormNode = document.querySelector('.gn-filter-form');
expect(filterFormNode).toBeTruthy();
const footerButtons = filterFormNode.querySelectorAll('.gn-filter-form-footer > button');
const footerButtons = filterFormNode.querySelectorAll('.gn-filter-form-title > button');
expect(footerButtons.length).toBe(1);

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,11 @@
}
}
.gn-filter-form-title {
flex: 1;
padding: 0 0.5rem;
}
.gn-filter-form-footer {
display: flex;
flex-direction: row-reverse;
align-items: center;
position: sticky;
bottom: 0;
padding: 0.5rem;
justify-content: space-between;
flex: 1;
padding: 0 0.5rem;
}
.gn-filter-form-divider {
width: calc(100% - 0.5rem);
Expand Down