diff --git a/components/Dashboard/DashboardLogs.js b/components/Dashboard/DashboardLogs.js index 197569e3..becc5706 100644 --- a/components/Dashboard/DashboardLogs.js +++ b/components/Dashboard/DashboardLogs.js @@ -5,31 +5,48 @@ import ArchivalUnitLog from "./logDisplays/ArchivalUnitLog"; import IsadLog from "./logDisplays/IsadLog"; import FindingAidsLog from "./logDisplays/FindingAidsLog"; -const { TabPane } = Tabs; - const DashboardLogs = () => { + const items = [ + { + key: 'accessions', + label: 'Accessions', + children: + , + }, + { + key: 'archival_units', + label: 'Archival Units', + children: + }, + { + key: 'isad-created', + label: 'ISAD(G) (Created)', + children: , + }, + { + key: 'isad-updated', + label: 'ISAD(G) (Updated)', + children: + }, + { + key: 'folder_items-created', + label: 'Folders / Items (Created)', + children: + }, + { + key: 'folder_items-updated', + label: 'Folders / Items (Updated)', + children: + }, + ]; + return ( - - - - - - - - - - - - - - - - - - - + diff --git a/components/Dashboard/DashboardView.js b/components/Dashboard/DashboardView.js index 9205ecc3..54ddda97 100644 --- a/components/Dashboard/DashboardView.js +++ b/components/Dashboard/DashboardView.js @@ -3,6 +3,7 @@ import {Radio, Card} from "antd"; import DashboardContentStats from "./DashboardContentStats.js"; import DashboardLogs from "./DashboardLogs"; import dynamic from "next/dynamic"; +import SearchPage from "./search/SearchPage"; const Activity = dynamic( () => import('./analyticsDisplays/Activity'), @@ -15,10 +16,12 @@ const Totals = dynamic( ); const DashbboardView = () => { - const [view, setView] = useState('stats'); + const [view, setView] = useState('search'); const getTitle = () => { switch (view) { + case 'search': + return 'Search' case 'stats': return 'Statistics'; case 'logs': @@ -34,6 +37,8 @@ const DashbboardView = () => { const getView = () => { switch (view) { + case 'search': + return (); case 'stats': return (); case 'logs': @@ -52,7 +57,8 @@ const DashbboardView = () => { }; const viewChange = () => ( - + + Search Statistics Logs Analytics (Activity) diff --git a/components/Dashboard/logDisplays/AccessionLog.js b/components/Dashboard/logDisplays/AccessionLog.js index a99a2803..b5d7704f 100644 --- a/components/Dashboard/logDisplays/AccessionLog.js +++ b/components/Dashboard/logDisplays/AccessionLog.js @@ -21,7 +21,11 @@ const AccessionLog = () => { }; return ( - } className={style.LogTimelineItem}> + } + className={style.LogTimelineItem}>
{item['seq']}
{renderArchivalUnit()} {item['user_created']} diff --git a/components/Dashboard/logDisplays/ArchivalUnitLog.js b/components/Dashboard/logDisplays/ArchivalUnitLog.js index 96f9c0bb..2899ff05 100644 --- a/components/Dashboard/logDisplays/ArchivalUnitLog.js +++ b/components/Dashboard/logDisplays/ArchivalUnitLog.js @@ -19,7 +19,11 @@ const ArchivalUnitLog = () => { }; return ( - } className={style.LogTimelineItem}> + } + className={style.LogTimelineItem}>
{item['title_full']}
{item['user_created']}
diff --git a/components/Dashboard/logDisplays/FindingAidsLog.js b/components/Dashboard/logDisplays/FindingAidsLog.js index 2eadeeeb..cc86c5d6 100644 --- a/components/Dashboard/logDisplays/FindingAidsLog.js +++ b/components/Dashboard/logDisplays/FindingAidsLog.js @@ -19,7 +19,11 @@ const FindingAidsLog = ({type}) => { }; return ( - } className={style.LogTimelineItem}> + } + className={style.LogTimelineItem}>
{item['archival_reference_code']}
{item['title']}
{item[`user_${type}d`]} diff --git a/components/Dashboard/logDisplays/IsadLog.js b/components/Dashboard/logDisplays/IsadLog.js index 029e7815..9a3f3b20 100644 --- a/components/Dashboard/logDisplays/IsadLog.js +++ b/components/Dashboard/logDisplays/IsadLog.js @@ -19,7 +19,11 @@ const IsadLog = ({type}) => { }; return ( - } className={style.LogTimelineItem}> + } + className={style.LogTimelineItem}>
{item['reference_code']}
{item['title']}
{item[`user_${type}d`]} diff --git a/components/Dashboard/search/SearchPage.js b/components/Dashboard/search/SearchPage.js new file mode 100644 index 00000000..65d33d7b --- /dev/null +++ b/components/Dashboard/search/SearchPage.js @@ -0,0 +1,258 @@ +import React, {useCallback, useMemo, useState} from "react"; +import {Badge, Button, Col, Empty, Input, Row, Select, Tooltip} from "antd"; +import SimpleTable from "../../Tables/SimpleTable"; +import style from "./SearchPage.module.scss"; +import {EditOutlined, EyeOutlined, GlobalOutlined} from "@ant-design/icons"; +import Link from "next/link"; + +const {Search} = Input; +const FACET_FIELDS = ['description_level', 'series_reference_code']; + +const getCellValue = (record, keys = []) => { + for (const key of keys) { + const value = record?.[key]; + + if (value !== undefined && value !== null && value !== '') { + return value; + } + } + + return '-'; +}; + +const getHighlightedText = (record) => { + const getField = (field) => { + if (record.highlights.hasOwnProperty(field)) { + return record.highlights[field]; + } + } + + if (record.hasOwnProperty('highlights')) { + return ( +
+
+
+ { + record.highlights.hasOwnProperty('title_original') && +
+ } + { + record.highlights.hasOwnProperty('contents_summary_original') && +
+ } +
+ ); + } +} + +const getReferenceCode = (record) => { + return ( +
{record['reference_code']}
+ ) +} + +const renderRecordType = (record, text) => { + return ( +
+ +
+ ) +} + +const getActions = (record) => { + const getURL = (identifier, action) => { + if (identifier.indexOf('finding-aids-') !== -1) { + const id = identifier.replace('finding-aids-', ''); + return `/finding-aids/folders-items/entities/${action}/${id}`; + } + + if (identifier.indexOf('isad-') !== -1) { + const id = identifier.replace('isad-', ''); + return `/isad/${action}/${id}`; + } + } + + return ( + + { + record['published'] === true && + + +