Skip to content

Commit

Permalink
override uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Nov 21, 2022
1 parent 421fe2c commit 346ab17
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ import _truncate from "lodash/truncate";
import React from "react";
import { Button, Card, Divider, Header, Segment } from "semantic-ui-react";
import { parametrize } from "react-overridable";
import {
RDMCountComponent,
RDMEmptyResults as RDMNoSearchResults,
RDMRecordSearchBarElement,
RDMToggleComponent,
} from "../search/components";
import { RDMEmptyResults as RDMNoSearchResults } from "../search/components";
import { http } from "react-invenio-forms";
import { DashboardResultView, DashboardSearchLayoutHOC } from "./base";
import { DashboardSearchLayoutHOC } from "./base";
import { createSearchAppInit } from "@js/invenio_search_ui";
import { ComputerTabletUploadsItem } from "./uploads_items/ComputerTabletUploadsItem";
import { MobileUploadsItem } from "./uploads_items/MobileUploadsItem";
import PropTypes from "prop-types";
import {
ContribSearchAppFacets,
ContribBucketAggregationElement,
ContribBucketAggregationValuesElement,
} from "@js/invenio_search_ui/components";
import { ContribSearchAppFacets } from "@js/invenio_search_ui/components";
import { defaultComponents } from "./uploadsOverride";

const statuses = {
in_review: { color: "warning", title: i18next.t("In review") },
Expand Down Expand Up @@ -174,22 +166,8 @@ export const DashboardUploadsSearchLayout = DashboardSearchLayoutHOC({
),
});

const ContribSearchAppFacetsWithConfig = parametrize(ContribSearchAppFacets, {
export const ContribSearchAppFacetsWithConfig = parametrize(ContribSearchAppFacets, {
toogle: true,
});

export const defaultComponents = {
"BucketAggregation.element": ContribBucketAggregationElement,
"BucketAggregationValues.element": ContribBucketAggregationValuesElement,
"Count.element": RDMCountComponent,
"EmptyResults.element": RDMEmptyResults,
"ResultsList.item": RDMRecordResultsListItem,
"ResultsGrid.item": RDMRecordResultsGridItem,
"SearchApp.facets": ContribSearchAppFacetsWithConfig,
"SearchApp.layout": DashboardUploadsSearchLayout,
"SearchApp.results": DashboardResultView,
"SearchBar.element": RDMRecordSearchBarElement,
"SearchFilters.Toggle.element": RDMToggleComponent,
};

createSearchAppInit(defaultComponents);
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// This file is part of InvenioRDM
// Copyright (C) 2020-2022 CERN.
// Copyright (C) 2020-2021 Northwestern University.
// Copyright (C) 2021 Graz University of Technology.
// Copyright (C) 2021 New York University.
//
// Invenio App RDM is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.

import {
RDMCountComponent,
RDMRecordSearchBarElement,
RDMToggleComponent,
} from "../search/components";
import { DashboardResultView } from "./base";
import {
ContribBucketAggregationElement,
ContribBucketAggregationValuesElement,
} from "@js/invenio_search_ui/components";
import {
ContribSearchAppFacetsWithConfig,
DashboardUploadsSearchLayout,
RDMEmptyResults,
RDMRecordResultsGridItem,
RDMRecordResultsListItem,
} from "./uploads";

export const defaultComponents = {
"BucketAggregation.element": ContribBucketAggregationElement,
"BucketAggregationValues.element": ContribBucketAggregationValuesElement,
"Count.element": RDMCountComponent,
"EmptyResults.element": RDMEmptyResults,
"ResultsList.item": RDMRecordResultsListItem,
"ResultsGrid.item": RDMRecordResultsGridItem,
"SearchApp.facets": ContribSearchAppFacetsWithConfig,
"SearchApp.layout": DashboardUploadsSearchLayout,
"SearchApp.results": DashboardResultView,
"SearchBar.element": RDMRecordSearchBarElement,
"SearchFilters.Toggle.element": RDMToggleComponent,
};

0 comments on commit 346ab17

Please sign in to comment.