diff --git a/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/search/components.js b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/search/components.js new file mode 100644 index 0000000..ee33dcc --- /dev/null +++ b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/search/components.js @@ -0,0 +1,324 @@ +/* + * Copyright (C) 2020 CERN. + * Copyright (C) 2020 Northwestern University. + * Copyright (C) 2020 Graz University of Technology + * + * invenio-theme-tugraz is free software; you can redistribute it + * and/or modify it under the terms of the MIT License; see LICENSE + * file for more details. + * + * origin: invenio_app_rdm/search/components.js + */ + +import React, { useState } from "react"; +import { Card, Item, Input, Label, Button, Grid, Checkbox, List, } from "semantic-ui-react"; +import { BucketAggregation, Toggle } from "react-searchkit"; +import _ from "lodash"; +import _truncate from "lodash/truncate"; +import Overridable from "react-overridable"; +import { SearchBar } from "@js/invenio_search_ui/components"; + +export const RDMRecordResultsListItem = ({ result, index }) => { + const description = _.get(result, "metadata.description", "No description"); + const version = _.get(result, "metadata.version", ""); + const creators = _.get(result, "metadata.creators", []); + const title = _.get(result, "metadata.title", "No title"); + const subjects = _.get(result, "metadata.subjects", null); + const rights = _.get(result, "metadata.rights", null) + + const publicationDate = _.get(result, "ui.publication_date_l10n_long", "No publication date found"); + const createdDate = _.get(result, "ui.created_date_l10n_long", "No creation date found."); + const resourceType = _.get(result, "ui.resource_type", "No resource type"); + const access = _.get(result, "ui.access_right.title", "No access rights"); + const accessRightCategory = _.get(result, "ui.access_right.category", "closed"); + const accessRightIcon = _.get(result, "ui.access_right.icon", "closed"); + const accessRight = {type: access, category: accessRightCategory, icon: accessRightIcon, rights}; + + const href = `/records/${result.id}`; + + return ( + + +
+ + +
+ {title} + + + {_truncate(description.replace(/(<([^>]+)>)/ig, ''), { length: 350 })} + +