Skip to content

Commit

Permalink
Merge pull request #9 from oarepo/active-filters-component-change
Browse files Browse the repository at this point in the history
fixed up layout
  • Loading branch information
mirekys authored Jun 13, 2024
2 parents 840df49 + 3d4b1ac commit 24c97b1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,18 @@ export const UserDashboardSearchAppLayoutHOC = ({
<Container className="rel-mt-4 rel-mb-4">
<Grid>
<GridResponsiveSidebarColumn
width={3}
width={4}
open={sidebarVisible}
onHideClick={() => setSidebarVisible(false)}
>
<SearchAppFacets aggs={config.aggs} appName={appName} />
</GridResponsiveSidebarColumn>
<Grid.Column computer={13} mobile={16} tablet={16}>
<Grid.Column computer={12} mobile={16} tablet={16}>
<Grid columns="equal">
<ShouldActiveFiltersRender>
<Grid.Row only="computer" verticalAlign="middle">
<Grid.Column>
<ActiveFilters />
<Overridable
id={buildUID("ClearFiltersButton.container")}
>
<ClearFiltersButton />
</Overridable>
</Grid.Column>
</Grid.Row>
</ShouldActiveFiltersRender>
Expand Down Expand Up @@ -96,15 +91,13 @@ export const UserDashboardSearchAppLayoutHOC = ({
</Grid.Row>
)}
<ShouldActiveFiltersRender>
<Grid.Row only="mobile tablet">
<Grid.Column>
<Overridable
id={buildUID("ClearFiltersButton.container")}
>
<Overridable id={buildUID("ClearFiltersButton.container")}>
<Grid.Row only="mobile tablet">
<Grid.Column>
<ClearFiltersButton />
</Overridable>
</Grid.Column>
</Grid.Row>
</Grid.Column>
</Grid.Row>
</Overridable>
</ShouldActiveFiltersRender>
<Grid.Row>
<Grid.Column mobile={16} tablet={16} computer={16}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
cursor: default;
}
font-size: @mini;
padding: 0.5rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
parseSearchAppConfigs,
SearchappSearchbarElement,
DynamicResultsListItem,
ClearFiltersButton,
ShouldActiveFiltersRender,
} from "@js/oarepo_ui";
import PropTypes from "prop-types";

Expand All @@ -36,17 +38,24 @@ const CreateNewDraftButton = ({ dashboardRecordsCreateUrl }) => {
);
return (
can_create && (
<Grid.Column textAlign="right">
<Button
as="a"
href={dashboardRecordsCreateUrl}
type="button"
labelPosition="left"
icon="plus"
content={i18next.t("Create new draft")}
primary
/>
</Grid.Column>
<React.Fragment>
<Grid.Column only="mobile tablet">
<ShouldActiveFiltersRender>
<ClearFiltersButton />
</ShouldActiveFiltersRender>
</Grid.Column>
<Grid.Column textAlign="right">
<Button
as="a"
href={dashboardRecordsCreateUrl}
type="button"
labelPosition="left"
icon="plus"
content={i18next.t("Create new draft")}
primary
/>
</Grid.Column>
</React.Fragment>
)
);
};
Expand All @@ -69,6 +78,7 @@ export const componentOverrides = {
[`${overridableIdPrefix}.SearchApp.results`]:
UserDashboardSearchAppResultViewWAppName,
[`${overridableIdPrefix}.SearchApp.layout`]: DashboardUploadsSearchLayout,
[`${overridableIdPrefix}.ClearFiltersButton.container`]: () => null,
};

createSearchAppsInit({ componentOverrides });
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SearchappSearchbarElement,
ActiveFiltersElement,
ClearFiltersButton,
ShouldActiveFiltersRender,
} from "@js/oarepo_ui";
import { withState } from "react-searchkit";
import {
Expand Down Expand Up @@ -64,6 +65,11 @@ export const FacetButtons = () => (
<Grid.Column only="mobile tablet" textAlign="left">
<RequestStatusFilter keepFiltersOnUpdate />
</Grid.Column>
<ShouldActiveFiltersRender>
<Grid.Column only="mobile tablet" textAlign="center">
<ClearFiltersButtonWIgnoredFilters />
</Grid.Column>
</ShouldActiveFiltersRender>
<Grid.Column only="mobile tablet" textAlign="right">
<FacetsButtonGroupNameToggler
basic
Expand Down Expand Up @@ -101,8 +107,7 @@ export const componentOverrides = {
RequestsResultsItemTemplateDashboard,
[`${overridableIdPrefix}.ActiveFilters.element`]:
ActiveFiltersElementWIgnoredFilters,
[`${overridableIdPrefix}.ClearFiltersButton.container`]:
ClearFiltersButtonWIgnoredFilters,
[`${overridableIdPrefix}.ClearFiltersButton.container`]: () => null,
[`${overridableIdPrefix}.SearchApp.results`]:
UserDashboardSearchAppResultViewWAppName,
[`${overridableIdPrefix}.SearchBar.element`]: SearchappSearchbarElement,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-dashboard
version = 1.0.6
version = 1.0.7
description = Support for user dashboard (records, communities, requests)
authors = Mirek Simek <[email protected]>
readme = README.md
Expand Down

0 comments on commit 24c97b1

Please sign in to comment.