From 17e4728dc6b9d8a1e4ad9375b6a18c64d2a01213 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Feb 2023 15:26:27 +0100 Subject: [PATCH 001/152] Update [...nextauth].js --- pages/api/auth/[...nextauth].js | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index d134f17..291b1f2 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -32,6 +32,7 @@ async function refreshAccessToken(token) { const providers = [ CredentialsProvider({ name: 'Credentials', + secret: process.env.SECRET, authorize: async (credentials) => { try { const response = await axios.post(`${process.env.NEXT_CLOCKWORK_API}/auth/jwt/create/`, { From 5dab8808b4cb4a160b0d6b781e7b829fe8d28dae Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Feb 2023 20:45:47 +0100 Subject: [PATCH 002/152] Update [...nextauth].js --- pages/api/auth/[...nextauth].js | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 291b1f2..d134f17 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -32,7 +32,6 @@ async function refreshAccessToken(token) { const providers = [ CredentialsProvider({ name: 'Credentials', - secret: process.env.SECRET, authorize: async (credentials) => { try { const response = await axios.post(`${process.env.NEXT_CLOCKWORK_API}/auth/jwt/create/`, { From da3d4ccaf7430b06c39373ad417725bb8a4bacd6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Feb 2023 20:48:50 +0100 Subject: [PATCH 003/152] Update ResearchTableFilter.js --- components/Tables/filters/ResearchTableFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Tables/filters/ResearchTableFilter.js b/components/Tables/filters/ResearchTableFilter.js index 261abb1..7c19a7f 100644 --- a/components/Tables/filters/ResearchTableFilter.js +++ b/components/Tables/filters/ResearchTableFilter.js @@ -31,7 +31,7 @@ const ResearcherTableFilter = () => { From 47e7fdb6dd5d0e767b456f7dc96ed6524ce55c9f Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 9 Feb 2023 12:36:47 +0100 Subject: [PATCH 004/152] Update RequestsTableFilter.js --- components/Tables/filters/RequestsTableFilter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Tables/filters/RequestsTableFilter.js b/components/Tables/filters/RequestsTableFilter.js index feb02fc..8a0ced9 100644 --- a/components/Tables/filters/RequestsTableFilter.js +++ b/components/Tables/filters/RequestsTableFilter.js @@ -12,8 +12,8 @@ const STATUSES = [ { value: '1', label: 'In Queue'}, { value: '2', label: 'Pending'}, { value: '3', label: 'Delivered'}, - { value: '4', label: 'Reshelved'}, - { value: '5', label: 'Returned'}, + { value: '4', label: 'Returned'}, + { value: '5', label: 'Reshelved'}, { value: '9', label: 'Served'} ] From 1c410a65fdb73d1e7bf2d4546b606ac787293e88 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 9 Feb 2023 15:01:13 +0100 Subject: [PATCH 005/152] Update Stuff from the meeting --- components/Forms/fields/ResearcherForm.js | 2 +- components/Tables/ResearchersVisitsTable.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/components/Forms/fields/ResearcherForm.js b/components/Forms/fields/ResearcherForm.js index 5984b08..06e1720 100644 --- a/components/Forms/fields/ResearcherForm.js +++ b/components/Forms/fields/ResearcherForm.js @@ -64,7 +64,7 @@ export const ResearcherForm = ({form, readOnly}) => { - + { key: 'researcher__last_name', width: 200, sorter: true, + }, { + title: 'Email', + dataIndex: 'email', + key: 'researcher__email', + width: 150, + sorter: true, + }, { + title: 'Card No.', + dataIndex: 'card_number', + key: 'researcher__card_number', + width: 100, + sorter: true, }, { title: 'Check In', dataIndex: 'check_in', From a7737c43e35fe0bbae172a85c56b0733e303445d Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 10 Feb 2023 17:23:06 +0100 Subject: [PATCH 006/152] GroupAccess on page level --- pages/_app.js | 111 +++++++++++++++++++++++----------- pages/index401.js | 16 +++++ utils/config/allowedGroups.js | 14 +++++ 3 files changed, 105 insertions(+), 36 deletions(-) create mode 100644 pages/index401.js create mode 100644 utils/config/allowedGroups.js diff --git a/pages/_app.js b/pages/_app.js index 4d1c635..aa2f376 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -2,56 +2,95 @@ import {SessionProvider, signIn, useSession} from "next-auth/react" import 'antd/dist/reset.css' import '../styles/global.css'; import '../styles/variables.css'; -import React from "react"; +import React, {useContext} from "react"; import {ConfigProvider} from "antd"; import Loading from "../components/Layout/Loading"; -import {UserProvider} from "../utils/context/UserContext"; +import {UserContext, UserProvider} from "../utils/context/UserContext"; +import {useRouter} from "next/router"; +import Index401 from "./index401"; +import {allowedGroups} from "../utils/config/allowedGroups"; +import _ from 'lodash'; const themeOptions = { - token: { - borderRadius: 2, - }, + token: { + borderRadius: 2, + }, } -function ClockworkApp({ Component, pageProps }) { +function ClockworkApp({Component, pageProps}) { return ( - - - { - Component.withoutLogin ? ( - - ) : ( - - - - - - ) - } - - + + + { + Component.withoutLogin ? ( + + ) : ( + + + + + + + + ) + } + + ) } -const Auth = ({ children }) => { - const { data, status } = useSession({ - required: true, - onUnauthenticated() { - signIn(); - }, - }) +const CheckAccess = ({children}) => { + const user = useContext(UserContext); + const router = useRouter() - if (status === "loading") { - return - } + const userHasAccess = (groups) => { + let access = false; + const mainPath = `/${router.pathname.split('/')[1]}` + + if (mainPath in allowedGroups) { + if (allowedGroups[mainPath] === '__ALL__') { + access = true; + } - if (data) { - if (data?.error === "RefreshAccessTokenError") { - signIn(); - } else { - return children; + if (groups.includes(allowedGroups[mainPath])) { + access = true; } } + + return access + } + + if (user) { + /* If the user is Admin, show him everyting */ + if (user['is_admin']) { + return children + } + + return userHasAccess(user['groups']) ? children : + } + + return ""; +} + +const Auth = ({children}) => { + const {data, status} = useSession({ + required: true, + onUnauthenticated() { + signIn(); + }, + }) + + if (status === "loading") { + return + } + + if (data) { + if (data?.error === "RefreshAccessTokenError") { + signIn(); + } else { + return children; + } + } } export default ClockworkApp diff --git a/pages/index401.js b/pages/index401.js new file mode 100644 index 0000000..a57fb36 --- /dev/null +++ b/pages/index401.js @@ -0,0 +1,16 @@ +import React from 'react' +import Head from 'next/head' +import AppLayout from "../components/Layout/Layout"; +import Breadcrumbs from "../components/Layout/Breadcrumbs"; + +export default function Index401() { + return ( + + + AMS - Archival Management System - Access Denied + + +

Unfortunately you don't have access to this part of the AMS!

+
+ ) +} diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js new file mode 100644 index 0000000..f4f6195 --- /dev/null +++ b/utils/config/allowedGroups.js @@ -0,0 +1,14 @@ +export const allowedGroups = { + '/': '__ALL__', + '/dashboard': '__ALL__', + '/accessions': 'Accessions', + '/archival-units': "Archival Units", + '/isaar': "ISAAR", + '/isad': 'ISAD(G)', + '/finding-aids': 'Finding Aids', + '/authority-list': 'Authority List', + '/controlled-list': 'Controlled List', + '/mlr': 'MLR', + '/digitzation-log': '__ALL__', + '/researchers-db': 'Research' +} \ No newline at end of file From cd7387543f3004aaa0723f1fd5e89c66f5d2d496 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 16 Feb 2023 16:00:16 +0100 Subject: [PATCH 007/152] Update ResearchersTable.js --- components/Tables/ResearchersTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Tables/ResearchersTable.js b/components/Tables/ResearchersTable.js index 4113840..3e2bd1e 100644 --- a/components/Tables/ResearchersTable.js +++ b/components/Tables/ResearchersTable.js @@ -177,7 +177,7 @@ const ResearchersTable = ({...props}) => { okType: 'danger', cancelText: 'No', onOk() { - remove(`/v1//researchers-db/researchers/${id}/`).then(() => { + remove(`/v1/research/researcher/${id}/`).then(() => { handleDelete(data.length); deleteAlert(); refresh(); From 4a9055dcbc12ee29862a6a9c9d290cf695bbb719 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 17 Feb 2023 23:13:49 +0100 Subject: [PATCH 008/152] Update useStickyState.js --- utils/hooks/useStickyState.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/utils/hooks/useStickyState.js b/utils/hooks/useStickyState.js index b1ed646..01ada20 100644 --- a/utils/hooks/useStickyState.js +++ b/utils/hooks/useStickyState.js @@ -1,15 +1,12 @@ import React from 'react'; function useStickyState(defaultValue, key) { - const [value, setValue] = React.useState(defaultValue); - - React.useEffect(() => { + const [value, setValue] = React.useState(() => { const stickyValue = window.localStorage.getItem(key); - - if (stickyValue !== null) { - setValue(JSON.parse(stickyValue)); - } - }, [key]); + return stickyValue !== null + ? JSON.parse(stickyValue) + : defaultValue; + }); React.useEffect(() => { window.localStorage.setItem(key, JSON.stringify(value)); From 502024e09a53c2441dfe617e168ab87a3c341cc2 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 20 Feb 2023 13:52:42 +0100 Subject: [PATCH 009/152] Implement "sticky" table state. --- components/Tables/ArchivalUnitTable.js | 5 +-- components/Tables/ContainerTable.js | 6 ++- components/Tables/FindingAidsTable.js | 4 +- components/Tables/FindingAidsTemplateTable.js | 5 ++- components/Tables/ISADTable.js | 5 +-- components/Tables/PopupTable.js | 5 +-- components/Tables/RequestsTable.js | 4 +- components/Tables/ResearchersTable.js | 9 ++-- components/Tables/ResearchersVisitsTable.js | 3 +- components/Tables/SimpleTable.js | 11 +++-- components/Tables/TableFilters.js | 3 +- components/Tables/functions/createParams.js | 4 +- utils/hooks/useTable.js | 43 +++++++++++++++---- 13 files changed, 67 insertions(+), 40 deletions(-) diff --git a/components/Tables/ArchivalUnitTable.js b/components/Tables/ArchivalUnitTable.js index e1f4ab1..207b86c 100644 --- a/components/Tables/ArchivalUnitTable.js +++ b/components/Tables/ArchivalUnitTable.js @@ -23,9 +23,8 @@ const ArchivalUnitTable = ({columns}) => { const [module, setModule] = useState('archival-units-fonds'); const [selectedRecord, setSelectedRecord] = useState(undefined); - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module); - - const {data, loading, refresh} = useData(`/v1/archival_unit/`, params); + const { data, loading, refresh, tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module, '/v1/archival_unit/'); useEffect(() => { if (data) { diff --git a/components/Tables/ContainerTable.js b/components/Tables/ContainerTable.js index d1c98a0..7edce44 100644 --- a/components/Tables/ContainerTable.js +++ b/components/Tables/ContainerTable.js @@ -23,7 +23,10 @@ const FindingAidsGrid = dynamic( ); const ContainerTable = ({seriesID, seriesTitle}) => { - const { params, tableState, handleExpandedRowsChange, handleDataChange, handleTableChange, handleDelete } = useTable(`container-table-${seriesID ? seriesID : 0}`); + const api = seriesID ? `/v1/container/list/${seriesID}/` : undefined; + const { data, loading, refresh, tableState, + handleExpandedRowsChange, handleDataChange, handleTableChange, handleDelete } = useTable( + `container-table-${seriesID ? seriesID : 0}`, api); const [drawerShown, setDrawerShown] = useState(false); const [action, setAction] = useState('edit'); @@ -35,7 +38,6 @@ const ContainerTable = ({seriesID, seriesTitle}) => { const [modalVisible, setModalVisible] = useState(false); - const { data, loading, refresh } = useData(seriesID ? `/v1/container/list/${seriesID}/` : undefined, params); const templateData = useData(seriesID ? `/v1/finding_aids/templates/select/${seriesID}/` : undefined); useEffect(() => { diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index 3b50b26..a6ba7cb 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -24,8 +24,8 @@ import {PopupForm} from "../Forms/PopupForm"; const FindingAidsTable = ({containerID, containerListRefresh, templateData, recordTotalPublished}) => { - const { params, tableState, handleDataChange, handleTableChange, handleDelete } = useTable(`finding-aids-table-${containerID}`); - const { data, loading, refresh } = useData(containerID ? `/v1/finding_aids/list/${containerID}/` : undefined, params); + const api = containerID ? `/v1/finding_aids/list/${containerID}/` : undefined; + const { data, loading, refresh, tableState, handleDataChange, handleTableChange, handleDelete } = useTable(`finding-aids-table-${containerID}`, api); const [ publishing, setPublishing ] = useState({}); const [ confidentialSetting, setConfidentialSetting ] = useState({}); diff --git a/components/Tables/FindingAidsTemplateTable.js b/components/Tables/FindingAidsTemplateTable.js index 7546a6b..b55858a 100644 --- a/components/Tables/FindingAidsTemplateTable.js +++ b/components/Tables/FindingAidsTemplateTable.js @@ -12,8 +12,9 @@ import Link from "next/link"; const FindingAidsTemplateTable = ({seriesID}) => { - const { params, tableState, handleDataChange, handleTableChange, handleDelete } = useTable(`finding-aids-template-table-${seriesID}`); - const { data, loading, refresh } = useData(seriesID ? `/v1/finding_aids/templates/list/${seriesID}/` : undefined, params); + const api = seriesID ? `/v1/finding_aids/templates/list/${seriesID}/` : undefined + const { data, loading, refresh, tableState, + handleDataChange, handleTableChange, handleDelete } = useTable(`finding-aids-template-table-${seriesID}`, api); useEffect(() => { if (data) { diff --git a/components/Tables/ISADTable.js b/components/Tables/ISADTable.js index f2e462f..eae1cbb 100644 --- a/components/Tables/ISADTable.js +++ b/components/Tables/ISADTable.js @@ -4,7 +4,6 @@ import {PlusOutlined, DeleteOutlined, EditOutlined, EyeOutlined, LoadingOutlined import TableFilters from "./TableFilters"; import style from './Table.module.scss'; import {put, remove} from "../../utils/api"; -import {useData} from "../../utils/hooks/useData"; import {useTable} from "../../utils/hooks/useTable"; import {deleteAlert} from "./functions/deleteAlert"; import {renderArchivalUnit} from "../../utils/renders/renderArchivalUnit"; @@ -12,8 +11,8 @@ import {renderStatus} from "../../utils/renders/renderStatus"; import Link from "next/link"; const ISADTable = ({...props}) => { - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad'); - const { data, loading, refresh} = useData(`/v1/isad/`, params); + const { data, loading, refresh, tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad', `/v1/isad/`); const [publishing, setPublishing] = useState({}); diff --git a/components/Tables/PopupTable.js b/components/Tables/PopupTable.js index a2628a8..43e4cc5 100644 --- a/components/Tables/PopupTable.js +++ b/components/Tables/PopupTable.js @@ -12,14 +12,13 @@ import {deleteAlert} from "./functions/deleteAlert"; const PopupTable = ({api, columns, module, actions=[], field, label, showFilter=false, footer=true, ...props}) => { - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module); + const { data, loading, refresh , tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module, api); const [drawerShown, setDrawerShown] = useState(false); const [action, setAction] = useState('create'); const [selectedRecord, setSelectedRecord] = useState(undefined); - const { data, loading, refresh } = useData(api, params); - useEffect(() => { if (data) { handleDataChange(data.count); diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index bc01520..6fb627c 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -24,8 +24,8 @@ const ORIGIN = { } const ResearchersTable = ({...props}) => { - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad'); - const { data, loading, refresh} = useData(`/v1/research/requests`, params); + const { data, loading, refresh , tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad', `/v1/research/requests`); const [drawerShown, setDrawerShown] = useState(false); const [selectedRecord, setSelectedRecord] = useState(undefined); diff --git a/components/Tables/ResearchersTable.js b/components/Tables/ResearchersTable.js index 3e2bd1e..3acffd4 100644 --- a/components/Tables/ResearchersTable.js +++ b/components/Tables/ResearchersTable.js @@ -5,21 +5,18 @@ import { EditOutlined, EyeOutlined, LoadingOutlined, - ArrowDownOutlined, - ArrowUpOutlined, - PlusOutlined, PrinterOutlined + PlusOutlined } from "@ant-design/icons"; import TableFilters from "./TableFilters"; import style from './Table.module.scss'; import {put, remove} from "../../utils/api"; -import {useData} from "../../utils/hooks/useData"; import {useTable} from "../../utils/hooks/useTable"; import {deleteAlert} from "./functions/deleteAlert"; import Link from "next/link"; const ResearchersTable = ({...props}) => { - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad'); - const { data, loading, refresh} = useData(`/v1/research/researcher`, params); + const { data, loading, refresh, tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('researchers', `/v1/research/researcher`); const [publishing, setPublishing] = useState({}); diff --git a/components/Tables/ResearchersVisitsTable.js b/components/Tables/ResearchersVisitsTable.js index 953f66c..b2ac60d 100644 --- a/components/Tables/ResearchersVisitsTable.js +++ b/components/Tables/ResearchersVisitsTable.js @@ -13,8 +13,7 @@ import {put, remove} from "../../utils/api"; import {deleteAlert} from "./functions/deleteAlert"; const ResearchersTable = ({...props}) => { - const { params, tableState, handleTableChange} = useTable('researchers-visits'); - const { data, loading, refresh} = useData(`/v1/research/visits`, params); + const { data, loading, refresh, tableState, handleTableChange} = useTable('researchers-visits', `/v1/research/visits`); const [createFormOpen, setCreateFormOpen] = useState(true); diff --git a/components/Tables/SimpleTable.js b/components/Tables/SimpleTable.js index 8a58400..249b835 100644 --- a/components/Tables/SimpleTable.js +++ b/components/Tables/SimpleTable.js @@ -6,14 +6,13 @@ import TableFilters from "./TableFilters"; import style from './Table.module.scss'; import Link from "next/link"; import {remove} from "../../utils/api"; -import {useData} from "../../utils/hooks/useData"; import {useTable} from "../../utils/hooks/useTable"; import {deleteAlert} from "./functions/deleteAlert"; const SimpleTable = ({api, columns, module, button, actions=[], footer=true, ...props}) => { - const { params, tableState, handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module); - const { data, loading, refresh} = useData(api, params); + const { data, loading, refresh, tableState, + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable(module, api); useEffect(() => { if (data) { @@ -55,7 +54,11 @@ const SimpleTable = ({api, columns, module, button, actions=[], footer=true, ... return ( - + { +const TableFilters = ({onFilterChange, module, filters, ...props}) => { const renderFilters = () => { switch (module) { case 'accessions': @@ -43,6 +43,7 @@ const TableFilters = ({onFilterChange, module, ...props}) => { {renderFilters()} diff --git a/components/Tables/functions/createParams.js b/components/Tables/functions/createParams.js index ad2ed00..eafb769 100644 --- a/components/Tables/functions/createParams.js +++ b/components/Tables/functions/createParams.js @@ -1,4 +1,4 @@ -export const createParams = ({ pagination={}, filters={}, sorter={} }) => { +export const createParams = ({ pagination={}, filters={}, ...sorter}) => { let paginationParams, sorterParams = {}; // Sorting @@ -34,5 +34,5 @@ export const createParams = ({ pagination={}, filters={}, sorter={} }) => { paginationParams = loadPagination(pagination); } - return Object.assign({}, paginationParams, sorterParams); + return Object.assign({}, paginationParams, sorterParams, filters); }; diff --git a/utils/hooks/useTable.js b/utils/hooks/useTable.js index 62a1df6..189588b 100644 --- a/utils/hooks/useTable.js +++ b/utils/hooks/useTable.js @@ -1,6 +1,9 @@ -import React, {useState} from 'react'; +import React, {useEffect, useState} from 'react'; import useStickyState from "./useStickyState"; import {createParams} from "../../components/Tables/functions/createParams"; +import {useDeepCompareEffect} from "react-use"; +import {useData} from "./useData"; +import {get} from "../api"; const PAGINATION_INIT = { showQuickJumper: true, @@ -9,13 +12,37 @@ const PAGINATION_INIT = { showTotal: (total, range) => {return `${range[0]}-${range[1]} of ${total} items`} }; -export const useTable = (module) => { - const [ params, setParams ] = useState({}); +export const useTable = (module, api) => { + const [ params, setParams ] = useState(undefined); + const [ loading, setLoading ] = useState(true); + const [ data, setData ] = useState([]); + const [ tableState, setTableState ] = useStickyState({ + filters: {}, pagination: PAGINATION_INIT, expandedRows: [] }, `ams-${module}-table`); + useEffect(() => { + if (params) { + fetchData() + } + }, [params]) + + useDeepCompareEffect(() => { + setParams(Object.assign({}, params, createParams(tableState))); + }, [tableState]) + + const fetchData = () => { + get(api, params).then(response => { + setLoading(false); + setData(response.data) + }).catch(error => { + setData(undefined); + setLoading(false); + }) + } + const handleExpandedRowsChange = (expandedRows) => { setTableState(prevTableState => ({ ...prevTableState, @@ -43,7 +70,6 @@ export const useTable = (module) => { ...filters, ...sorter })); - setParams(Object.assign({}, params, createParams({pagination, filters, sorter}))); }; const handleFilterChange = (changedValues, allValues) => { @@ -55,10 +81,9 @@ export const useTable = (module) => { pagination: { ...prevTableState.pagination, current: 1 - } + }, + filters: allValues })); - - setParams(Object.assign({}, allValues)); } }; @@ -76,7 +101,9 @@ export const useTable = (module) => { }; return { - params: params, + data: data, + loading: loading, + refresh: fetchData, tableState: tableState, handleExpandedRowsChange: handleExpandedRowsChange, handleDataChange: handleDataChange, From f80428b7c8db837dad18ce951f5afd8880104f68 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 20 Feb 2023 15:19:01 +0100 Subject: [PATCH 010/152] Adding filter initial values. --- components/Tables/ArchivalUnitTable.js | 6 +++++- components/Tables/ISADTable.js | 6 +++++- components/Tables/PopupTable.js | 6 +++++- components/Tables/RequestsTable.js | 2 +- components/Tables/ResearchersTable.js | 6 +++++- components/Tables/ResearchersVisitsTable.js | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/components/Tables/ArchivalUnitTable.js b/components/Tables/ArchivalUnitTable.js index 207b86c..c89475d 100644 --- a/components/Tables/ArchivalUnitTable.js +++ b/components/Tables/ArchivalUnitTable.js @@ -136,7 +136,11 @@ const ArchivalUnitTable = ({columns}) => { return ( - +
{ return ( - +
{showFilter && - + }
{ const { data, loading, refresh , tableState, - handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('isad', `/v1/research/requests`); + handleDataChange, handleTableChange, handleFilterChange, handleDelete } = useTable('requests', `/v1/research/requests`); const [drawerShown, setDrawerShown] = useState(false); const [selectedRecord, setSelectedRecord] = useState(undefined); diff --git a/components/Tables/ResearchersTable.js b/components/Tables/ResearchersTable.js index 3acffd4..2105541 100644 --- a/components/Tables/ResearchersTable.js +++ b/components/Tables/ResearchersTable.js @@ -200,7 +200,11 @@ const ResearchersTable = ({...props}) => { return ( - +
{ - const { data, loading, refresh, tableState, handleTableChange} = useTable('researchers-visits', `/v1/research/visits`); + const { data, loading, refresh, tableState, handleTableChange} = useTable('researcherVisits', `/v1/research/visits`); const [createFormOpen, setCreateFormOpen] = useState(true); From 38e2247eeaf86dca9529e7eda9c927716aac3247 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 21 Feb 2023 08:33:16 +0100 Subject: [PATCH 011/152] Yesterday evening --- .../Forms/components/FormRemoteSelect.js | 2 +- .../FormRemoteSelectInfiniteScroll.js | 82 +++++++++++++++++++ .../Forms/fields/requests/RequestItems.js | 19 ++++- components/Tables/RequestsTable.js | 6 +- 4 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 components/Forms/components/FormRemoteSelectInfiniteScroll.js diff --git a/components/Forms/components/FormRemoteSelect.js b/components/Forms/components/FormRemoteSelect.js index a34e5d1..cd29d3e 100644 --- a/components/Forms/components/FormRemoteSelect.js +++ b/components/Forms/components/FormRemoteSelect.js @@ -18,7 +18,7 @@ const FormRemoteSelect = ({ selectAPI, selectAPIParams={}, valueField, labelFiel }, [data]); const handleSearch = (value) => { - if (value.length > 2 || value.length === 0) { + if (value.length > searchMinLength || value.length === 0) { setParams(prevParams => ({ ...prevParams, search: value diff --git a/components/Forms/components/FormRemoteSelectInfiniteScroll.js b/components/Forms/components/FormRemoteSelectInfiniteScroll.js new file mode 100644 index 0000000..37b4308 --- /dev/null +++ b/components/Forms/components/FormRemoteSelectInfiniteScroll.js @@ -0,0 +1,82 @@ +import React, {useState, useEffect} from 'react'; +import {Select, Spin} from "antd"; +import {useData} from "../../../utils/hooks/useData"; + +const {Option} = Select; + +const FormRemoteSelectInfiniteScroll = ({ selectAPI, selectAPIParams={}, valueField, labelField, + onChange, placeholder, mode='default', + disabled=false, renderFunction, searchMinLength=2, ...props }) => { + + const [params, setParams] = useState(selectAPIParams); + const [selectData, setSelectData] = useState([]); + const [selectLoading, setSelectLoading] = useState(false); + + const {data, loading} = useData(selectAPI, params); + + useEffect(() => { + data && setSelectData(data['results']) + }, [data]); + + const handleSearch = (value) => { + if (value.length > searchMinLength || value.length === 0) { + setParams(prevParams => ({ + ...prevParams, + search: value + })) + } + }; + + const handleSelect = (value) => { + if (params.hasOwnProperty('search') && params['search'] !== "") { + setParams(prevParams => ({ + ...prevParams, + search: '' + })); + } + onChange(value) + }; + + const handleClear = () => { + onChange(undefined); + }; + + const onScroll = async (event) => { + const target = event.target; + if (!loading && target.scrollTop + target.offsetHeight === target.scrollHeight) { + setSelectLoading(true); + console.log("Load..."); + target.scrollTo(0, target.scrollHeight); + } + } + + const selectOptions = selectData.map(d => ( + + ) + ) + + return ( + + ) +}; + +export default FormRemoteSelectInfiniteScroll; diff --git a/components/Forms/fields/requests/RequestItems.js b/components/Forms/fields/requests/RequestItems.js index 9aaa1c0..0ed2673 100644 --- a/components/Forms/fields/requests/RequestItems.js +++ b/components/Forms/fields/requests/RequestItems.js @@ -1,9 +1,10 @@ import React, {useState} from "react"; import {Button, Col, Form, Input, Row, Select} from "antd"; -import { PlusOutlined, CloseOutlined } from '@ant-design/icons'; +import {PlusOutlined, CloseOutlined, CopyOutlined} from '@ant-design/icons'; import FormRemoteSelect from "../../components/FormRemoteSelect"; import FormSelect from "../../components/FormSelect"; import {checkRequiredIfArchival, checkRequiredIfLibrary} from "../../validations/requestItemFormValidation"; +import FormRemoteSelectInfiniteScroll from "../../components/FormRemoteSelectInfiniteScroll"; const ITEM_ORIGINS = [ { value: 'FA', label: 'Archival'}, @@ -43,6 +44,11 @@ export const RequestItems = ({form}) => { } } + const clone = (add, field) => { + console.log(field) + add(field) + } + return (
Requested Items
@@ -70,7 +76,7 @@ export const RequestItems = ({form}) => { name={[field.name, 'archival_unit']} rules={[(form) => checkRequiredIfArchival(form, [field.name, 'item_type'], true)]} > - { valueField={'id'} labelField={'container_label'} placeholder={'- Select Container -'} - selectAPI={`/v1/research/requests/container/select/${getSeriesID(idx)}`} + selectAPI={getSeriesID(idx) ? `/v1/research/requests/container/select/${getSeriesID(idx)}` : undefined} + searchMinLength={0} disabled={isDisabled('container', idx)} /> @@ -119,10 +126,16 @@ export const RequestItems = ({form}) => {
+
Date: Tue, 21 Feb 2023 13:33:25 +0100 Subject: [PATCH 012/152] Implement dependent menus --- components/Layout/Menu.js | 34 +++++++++-- components/Layout/config/config-menu.js | 80 ++++++++++++------------- components/Tables/TableFilters.js | 1 + utils/config/allowedGroups.js | 4 +- utils/hooks/useData.js | 2 +- utils/hooks/useTable.js | 4 +- 6 files changed, 74 insertions(+), 51 deletions(-) diff --git a/components/Layout/Menu.js b/components/Layout/Menu.js index f9dea35..b683f10 100644 --- a/components/Layout/Menu.js +++ b/components/Layout/Menu.js @@ -1,11 +1,13 @@ import {Menu} from "antd"; -import React from "react"; +import React, {useContext} from "react"; import config from './config/config-menu'; import style from "./Menu.module.css"; import {useRouter} from "next/router"; +import {UserContext} from "../../utils/context/UserContext"; const AppMenu = ({collapsed}) => { const router = useRouter(); + const user = useContext(UserContext); const collectOpenKeys = () => { const openKeys = []; @@ -37,9 +39,29 @@ const AppMenu = ({collapsed}) => { return selectedKeys; }; - const getItem = (label, key, icon, children) => { - return { - key, icon, label, children + const getItem = (label, key, icon, group, children) => { + let returnItem = false; + + /* Check if user is admin */ + if (user['is_admin']) { + returnItem = true + } + + /* Check if user in the allowed group */ + const contains = user['groups'].some(element => { + return group.includes(element); + }); + + if (contains) { + returnItem = true + } + + if (returnItem) { + return { + key, icon, label, children + } + } else { + return '' } } @@ -49,13 +71,15 @@ const AppMenu = ({collapsed}) => { config.hasOwnProperty('link') ? {config.name} : config.name, config.name, config.icon, + config.group, config.submenu.map(conf => renderItem(conf)) ) } else { return getItem( config.hasOwnProperty('link') ? {config.name} : config.name, config.name, - config.icon + config.icon, + config.group ) } } diff --git a/components/Layout/config/config-menu.js b/components/Layout/config/config-menu.js index 6938a6e..682eaf6 100644 --- a/components/Layout/config/config-menu.js +++ b/components/Layout/config/config-menu.js @@ -12,51 +12,51 @@ import { ImCopy } from "react-icons/im" import React from "react"; const configMenu = [ - {name: 'Dashboard', icon: , link: '/dashboard'}, - {name: 'Accession', icon: , module: 'acccession', submenu: [ - {name: 'Accession Records', link: '/accessions'}, - {name: 'Donors', link: '/donors'}, + {name: 'Dashboard', icon: , link: '/dashboard', group: ['__ALL__']}, + {name: 'Accession', icon: , module: 'acccession', group: ['Accessions'], submenu: [ + {name: 'Accession Records', group: ['Accessions'], link: '/accessions'}, + {name: 'Donors', group: ['Accessions'], link: '/donors'}, ]}, - {name: 'Archival Unit', icon: , module: 'archival-unit', link: '/archival-units'}, - {name: 'ISAAR-CPF', icon: , module: 'isaar', link: '/isaar'}, - {name: 'ISAD(G)', icon: , module: 'isad', link: '/isad'}, - {name: 'Finding Aids', icon: , module: 'finding-aids', submenu: [ - {name: 'Folders / Items', link: '/finding-aids'}, + {name: 'Archival Unit', icon: , module: 'archival-unit', group: ['Archival Units'], link: '/archival-units'}, + {name: 'ISAAR-CPF', icon: , module: 'isaar', group: ['ISAAR'], link: '/isaar'}, + {name: 'ISAD(G)', icon: , module: 'isad', group: ['ISAD(G)'], link: '/isad'}, + {name: 'Finding Aids', icon: , module: 'finding-aids', group: ['Finding Aids'], submenu: [ + {name: 'Folders / Items', group: ['Finding Aids'], link: '/finding-aids'}, ]}, - {name: 'Lists', icon: , module: 'list', submenu: [ - {name: 'Authority List', icon: , module: '/list/authority-list', submenu: [ - {name: 'Corporations', icon: , link: '/authority-list/corporations'}, - {name: 'Countries', icon: , link: '/authority-list/countries'}, - {name: 'Genres', icon: , link: '/authority-list/genres'}, - {name: 'Languages', icon: , link: '/authority-list/languages'}, - {name: 'People', icon: , link: '/authority-list/people'}, - {name: 'Places', icon: , link: '/authority-list/places'}, - {name: 'Subjects', icon: , link: '/authority-list/subjects'}, + {name: 'Lists', icon: , module: 'list', group: ['Authority Lists', 'Controlled Lists'], submenu: [ + {name: 'Authority List', icon: , module: '/list/authority-list', group: ['Authority Lists'], submenu: [ + {name: 'Corporations', icon: , group: ['Authority Lists'], link: '/authority-list/corporations'}, + {name: 'Countries', icon: , group: ['Authority Lists'], link: '/authority-list/countries'}, + {name: 'Genres', icon: , group: ['Authority Lists'], link: '/authority-list/genres'}, + {name: 'Languages', icon: , group: ['Authority Lists'], link: '/authority-list/languages'}, + {name: 'People', icon: , group: ['Authority Lists'], link: '/authority-list/people'}, + {name: 'Places', icon: , group: ['Authority Lists'], link: '/authority-list/places'}, + {name: 'Subjects', icon: , group: ['Authority Lists'], link: '/authority-list/subjects'}, ]}, - {name: 'Controlled List', icon: , module: '/list/controlled-list', submenu: [ - {name: 'Access Rights', icon: , link: '/controlled-list/access-rights'}, - {name: 'Archival Unit Themes', icon: , link: '/controlled-list/archival-unit-themes'}, - {name: 'Building', icon: , link: '/controlled-list/buildings'}, - {name: 'Carrier Types', icon: , link: '/controlled-list/carrier-types'}, - {name: 'Corporation Roles', icon: , link: '/controlled-list/corporation-roles'}, - {name: 'Date Types', icon: , link: '/controlled-list/date-types'}, - {name: 'Extent Units', icon: , link: '/controlled-list/extent-units'}, - {name: 'Geo Roles', icon: , link: '/controlled-list/geo-roles'}, - {name: 'Keyword', icon: , link: '/controlled-list/keywords'}, - {name: 'Language Usages', icon: , link: '/controlled-list/language-usages'}, - {name: 'Person Roles', icon: , link: '/controlled-list/person-roles'}, - {name: 'Primary Types', icon: , link: '/controlled-list/primary-types'}, - {name: 'Reproduction Rights', icon: , link: '/controlled-list/reproduction-rights'}, - {name: 'Restriction Reasons', icon: , link: '/controlled-list/restriction-reasons'}, + {name: 'Controlled List', icon: , module: '/list/controlled-list', group: ['Controlled Lists'], submenu: [ + {name: 'Access Rights', icon: , group: ['Controlled Lists'], link: '/controlled-list/access-rights'}, + {name: 'Archival Unit Themes', icon: , group: ['Controlled Lists'], link: '/controlled-list/archival-unit-themes'}, + {name: 'Building', icon: , group: ['Controlled Lists'], link: '/controlled-list/buildings'}, + {name: 'Carrier Types', icon: , group: ['Controlled Lists'], link: '/controlled-list/carrier-types'}, + {name: 'Corporation Roles', icon: , group: ['Controlled Lists'], link: '/controlled-list/corporation-roles'}, + {name: 'Date Types', icon: , group: ['Controlled Lists'], link: '/controlled-list/date-types'}, + {name: 'Extent Units', icon: , group: ['Controlled Lists'], link: '/controlled-list/extent-units'}, + {name: 'Geo Roles', icon: , group: ['Controlled Lists'], link: '/controlled-list/geo-roles'}, + {name: 'Keyword', icon: , group: ['Controlled Lists'], link: '/controlled-list/keywords'}, + {name: 'Language Usages', icon: , group: ['Controlled Lists'], link: '/controlled-list/language-usages'}, + {name: 'Person Roles', icon: , group: ['Controlled Lists'], link: '/controlled-list/person-roles'}, + {name: 'Primary Types', icon: , group: ['Controlled Lists'], link: '/controlled-list/primary-types'}, + {name: 'Reproduction Rights', icon: , group: ['Controlled Lists'], link: '/controlled-list/reproduction-rights'}, + {name: 'Restriction Reasons', icon: , group: ['Controlled Lists'], link: '/controlled-list/restriction-reasons'}, ]}, ]}, - {name: 'MLR', icon: , module: 'mlr', link: '/mlr'}, - {name: 'Digitization Log', icon: , module: 'digitization', link: '/digitization'}, - {name: 'Researchers Database', icon: , module: 'researcher', submenu: [ - {name: 'Researchers', icon: , link: '/researchers-db/researchers'}, - {name: 'Researcher Visits', icon: , link: '/researchers-db/visits'}, - {name: 'Researcher Statistics', icon: , link: '/researchers-db/stats'}, - {name: 'Requests', icon: , link: '/researchers-db/requests'}, + {name: 'MLR', icon: , module: 'mlr', group: ['MLR'], link: '/mlr'}, + {name: 'Digitization Log', icon: , module: 'digitization', group: ['Digitization'], link: '/digitization'}, + {name: 'Researchers Database', icon: , module: 'researcher', group: ['Research'], submenu: [ + {name: 'Researchers', icon: , group: ['Research'], link: '/researchers-db/researchers'}, + {name: 'Researcher Visits', icon: , group: ['Research'], link: '/researchers-db/visits'}, + {name: 'Researcher Statistics', icon: , group: ['Research'], link: '/researchers-db/stats'}, + {name: 'Requests', icon: , group: ['Research'], link: '/researchers-db/requests'}, ]} ]; diff --git a/components/Tables/TableFilters.js b/components/Tables/TableFilters.js index bb4f257..11f1ded 100644 --- a/components/Tables/TableFilters.js +++ b/components/Tables/TableFilters.js @@ -42,6 +42,7 @@ const TableFilters = ({onFilterChange, module, filters, ...props}) => {
diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js index f4f6195..3c05b7f 100644 --- a/utils/config/allowedGroups.js +++ b/utils/config/allowedGroups.js @@ -6,8 +6,8 @@ export const allowedGroups = { '/isaar': "ISAAR", '/isad': 'ISAD(G)', '/finding-aids': 'Finding Aids', - '/authority-list': 'Authority List', - '/controlled-list': 'Controlled List', + '/authority-list': 'Authority Lists', + '/controlled-list': 'Controlled Lists', '/mlr': 'MLR', '/digitzation-log': '__ALL__', '/researchers-db': 'Research' diff --git a/utils/hooks/useData.js b/utils/hooks/useData.js index c0afa39..368b13e 100644 --- a/utils/hooks/useData.js +++ b/utils/hooks/useData.js @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useState} from 'react'; import {get} from "../api"; import {useDeepCompareEffect, useUpdateEffect} from "react-use"; diff --git a/utils/hooks/useTable.js b/utils/hooks/useTable.js index 189588b..e53fd75 100644 --- a/utils/hooks/useTable.js +++ b/utils/hooks/useTable.js @@ -2,7 +2,6 @@ import React, {useEffect, useState} from 'react'; import useStickyState from "./useStickyState"; import {createParams} from "../../components/Tables/functions/createParams"; import {useDeepCompareEffect} from "react-use"; -import {useData} from "./useData"; import {get} from "../api"; const PAGINATION_INIT = { @@ -67,7 +66,6 @@ export const useTable = (module, api) => { ...prevTableState.pagination.showTotal, ...pagination }, - ...filters, ...sorter })); }; @@ -75,7 +73,7 @@ export const useTable = (module, api) => { const handleFilterChange = (changedValues, allValues) => { if (Object.entries(allValues).length > 0) { - // set pagination + // set pagination & filters setTableState(prevTableState => ({ ...prevTableState, pagination: { From 6a2bcbff0251ee82e062c80e377465d3ebbb2c3a Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 22 Feb 2023 21:50:02 +0100 Subject: [PATCH 013/152] InfiniteScrollSelect implementation --- components/Forms/ArchivalUnitSelectForm.js | 3 + .../FormRemoteSelectInfiniteScroll.js | 66 +++++++++++++++---- .../Forms/fields/requests/RequestItems.js | 47 ++++++++----- utils/functions/normalizeSelectFields.js | 31 +++++++++ utils/hooks/useForm.js | 2 + 5 files changed, 121 insertions(+), 28 deletions(-) create mode 100644 utils/functions/normalizeSelectFields.js diff --git a/components/Forms/ArchivalUnitSelectForm.js b/components/Forms/ArchivalUnitSelectForm.js index 9adc901..61a59af 100644 --- a/components/Forms/ArchivalUnitSelectForm.js +++ b/components/Forms/ArchivalUnitSelectForm.js @@ -53,6 +53,7 @@ export const ArchivalUnitSelectForm = () => { selectAPI={'/v1/archival_unit/select/'} selectAPIParams={{level: 'F'}} placeholder={'- Select Fonds -'} + searchMinLength={0} /> @@ -64,6 +65,7 @@ export const ArchivalUnitSelectForm = () => { renderFunction={renderArchivalUnitDropdown} selectAPI={fonds ? `/v1/archival_unit/select/${fonds}/` : undefined} placeholder={'- Select Subfonds -'} + searchMinLength={0} /> @@ -75,6 +77,7 @@ export const ArchivalUnitSelectForm = () => { renderFunction={renderArchivalUnitDropdown} selectAPI={subfonds ? `/v1/archival_unit/select/${subfonds}/` : undefined} placeholder={'- Select Series -'} + searchMinLength={0} /> diff --git a/components/Forms/components/FormRemoteSelectInfiniteScroll.js b/components/Forms/components/FormRemoteSelectInfiniteScroll.js index 37b4308..1cd52bf 100644 --- a/components/Forms/components/FormRemoteSelectInfiniteScroll.js +++ b/components/Forms/components/FormRemoteSelectInfiniteScroll.js @@ -1,6 +1,8 @@ import React, {useState, useEffect} from 'react'; import {Select, Spin} from "antd"; import {useData} from "../../../utils/hooks/useData"; +import {useList} from "react-use"; +import {get} from "../../../utils/api"; const {Option} = Select; @@ -9,44 +11,80 @@ const FormRemoteSelectInfiniteScroll = ({ selectAPI, selectAPIParams={}, valueFi disabled=false, renderFunction, searchMinLength=2, ...props }) => { const [params, setParams] = useState(selectAPIParams); - const [selectData, setSelectData] = useState([]); + const [selectLoading, setSelectLoading] = useState(false); + const [selectAPIurl, setSelectAPIurl] = useState(selectAPI); + const [selectData, { set, push }] = useList(undefined); + const [isDataLast, setIsDataLast] = useState(false) const {data, loading} = useData(selectAPI, params); useEffect(() => { - data && setSelectData(data['results']) + set([]) + }, [selectAPI]) + + + useEffect(() => { + data && push(...data['results']); + if (data) { + if (data['next']) { + setSelectAPIurl(data['next']) + setIsDataLast(false) + } else { + setIsDataLast(true) + } + } }, [data]); + + const createParams = () => { + const url = new URL(selectAPIurl); + const URLParams = new URLSearchParams(url.search); + + setParams(prevParams => ({ + ...prevParams, + page: URLParams.get('page') + })) + } + + const handleSearch = (value) => { if (value.length > searchMinLength || value.length === 0) { setParams(prevParams => ({ ...prevParams, + page: 1, search: value })) + set([]) } }; + const resetSelectOptions = () => { + setParams(prevParams => ({ + ...prevParams, + page: 1, + search: '' + })); + set([]) + } + const handleSelect = (value) => { - if (params.hasOwnProperty('search') && params['search'] !== "") { - setParams(prevParams => ({ - ...prevParams, - search: '' - })); - } onChange(value) }; const handleClear = () => { + resetSelectOptions() onChange(undefined); }; const onScroll = async (event) => { - const target = event.target; - if (!loading && target.scrollTop + target.offsetHeight === target.scrollHeight) { - setSelectLoading(true); - console.log("Load..."); - target.scrollTo(0, target.scrollHeight); + if (!isDataLast) { + const target = event.target; + if (!loading && target.scrollTop + target.offsetHeight === target.scrollHeight) { + setSelectLoading(true); + target.scrollTo(0, target.scrollHeight); + createParams() + } } } @@ -59,6 +97,7 @@ const FormRemoteSelectInfiniteScroll = ({ selectAPI, selectAPIParams={}, valueFi ) ) + return ( +
+ name="original_title" + style={{marginBottom: '2px'}}> + From 9459c3e40b913f564743ac0d1b2332b032f2a45c Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 1 Mar 2023 13:22:59 +0100 Subject: [PATCH 016/152] Introducing translation fields. --- .../Forms/components/FormFormattedText.js | 2 +- .../Forms/components/FormTranslateButton.js | 82 ++++++- .../Forms/fields/FindingAidsEntityForm.js | 93 ++++++-- components/Forms/fields/IsadForm.js | 217 +++++++++++++++--- 4 files changed, 338 insertions(+), 56 deletions(-) diff --git a/components/Forms/components/FormFormattedText.js b/components/Forms/components/FormFormattedText.js index 8c9f0ca..d615326 100644 --- a/components/Forms/components/FormFormattedText.js +++ b/components/Forms/components/FormFormattedText.js @@ -19,7 +19,7 @@ export const FormFormattedText = ({value, disabled=false, initialValue, ...props return (
{ const value = Form.useWatch(fieldName, form); + const toFieldValue = Form.useWatch(toField, form); const locale = Form.useWatch('original_locale', form); + const [loading, setLoading] = useState(false); + + const { confirm } = Modal; + const translateText = () => { + let api; + let params = {}; + if (mode === 'toOriginal') { - form.setFieldValue(toField, 'original') + api = '/v1/workflow/translate_to_original/' + params = { + english_text: value, + original_locale: locale + } + } else { + api = '/v1/workflow/translate_to_english/' + params = { + original_text: value, + original_locale: locale + } } + + confirm({ + title: 'Are you sure you would like to translate this field?', + okText: 'Yes', + okType: 'danger', + cancelText: 'No', + onOk() { + setLoading(true) + post(api, params).then(response => { + form.setFieldValue(toField, response.data['text']) + setLoading(false) + }).catch(error => { + notification.error({ + duration: 3, + message: 'Error!', + description: `There is something wrong with the translation engine!`, + }); + setLoading(false) + }) + } + }); + } const getLabel = () => { return mode === 'toOriginal' ? 'Translate to Original Language' : 'Translate to English' } - if (value) { - return ( - - ) - } else { - return '' - } + const detectValue = (v) => { + if (!v) { + return false + } + + if (v === null || v === '' || v === '


' || v === '

' ) { + return false + } + return true + } + if (detectValue(value) && locale && !detectValue(toFieldValue)) { + if (loading) { + return ( +
+ Loading... +
+ ) + } else { + return ( + + ) + } + } else { + return
+ } } export default FormTranslateButton; \ No newline at end of file diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index cb89638..4a704dd 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -138,7 +138,7 @@ const Tab01 = ({form, locale, readOnly}) => (
- + ( + style={{marginBottom: 0}}> ( - + + + name="contents_summary_original" + style={{marginBottom: 0}}> + @@ -257,7 +270,7 @@ const IdentifierTemplate = ({initialValues, type}) => ( ); -const Tab01Template = ({locale, readOnly, type}) => ( +const Tab01Template = ({form, locale, readOnly, type}) => ( @@ -295,16 +308,29 @@ const Tab01Template = ({locale, readOnly, type}) => ( - + + + name="original_title" + style={{marginBottom: 0}}> + @@ -388,31 +414,57 @@ const Tab02 = ({form, locale, readOnly}) => ( - + + + name="physical_description_original" + style={{marginBottom: 0}}> + - + + + name="language_statement_original" + style={{marginBottom: 0}}> + @@ -518,19 +570,32 @@ const Tab04 = ({form, readOnly}) => ( ); -const Tab05 = ({locale, readOnly}) => ( +const Tab05 = ({form, locale, readOnly}) => ( - + + + name="note_original" + style={{marginBottom: 0}}> + diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index 74319c6..6b3304f 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -10,6 +10,7 @@ import {FormFormattedText} from "../components/FormFormattedText"; import {RelatedFindingAids} from "./isad/RelatedFindingAids"; import {LocationOfOriginals} from "./isad/LocationOfOriginals"; import {LocationOfCopies} from "./isad/LocationOfCopies"; +import FormTranslateButton from "../components/FormTranslateButton"; const {TabPane} = Tabs; @@ -160,7 +161,7 @@ const Tab01 = ({form, readOnly}) => ( ); -const Tab02 = ({locale, readOnly}) => { +const Tab02 = ({form, locale, readOnly}) => { return ( @@ -172,108 +173,199 @@ const Tab02 = ({locale, readOnly}) => { - + + + name="carrier_estimated_original" + style={{marginBottom: 0}}> + ) }; -const Tab03 = ({locale, readOnly}) => { +const Tab03 = ({form, locale, readOnly}) => { return ( - + + + name="administrative_history_original" + style={{marginBottom: 0}}> + - + + + name="archival_history_original" + style={{marginBottom: 0}}> + ) }; -const Tab04 = ({locale, readOnly}) => { +const Tab04 = ({form, locale, readOnly}) => { return ( - + + + name="scope_and_content_abstract_original" + style={{marginBottom: 0}}> + - + + + name="scope_and_content_narrative_original" + style={{marginBottom: 0}}> + - + + + name="appraisal_original" + style={{marginBottom: 0}}> + - + + + name="system_of_arrangement_information_original" + style={{marginBottom: 0}}> + ) }; -const Tab05 = ({locale, readOnly}) => { +const Tab05 = ({form, locale, readOnly}) => { return ( @@ -282,16 +374,29 @@ const Tab05 = ({locale, readOnly}) => { - + + + name="physical_characteristics_original" + style={{marginBottom: 0}}> + @@ -300,7 +405,7 @@ const Tab05 = ({locale, readOnly}) => { ) }; -const Tab06 = ({locale, readOnly}) => { +const Tab06 = ({form, locale, readOnly}) => { return ( @@ -310,59 +415,111 @@ const Tab06 = ({locale, readOnly}) => { - + + + name="publication_note_original" + style={{marginBottom: 0}}> + ) }; -const Tab07 = ({locale, readOnly}) => { +const Tab07 = ({form, locale, readOnly}) => { return ( - + + + name="note_original" + style={{marginBottom: 0}}> + - + + + name="internal_note_original" + style={{marginBottom: 0}}> + - + + + name="archivists_original" + style={{marginBottom: 0}}> + From 5126f8577fafc92903ab72fcd440ac7c845cf424 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 1 Mar 2023 14:00:05 +0100 Subject: [PATCH 017/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 4a704dd..2568ab4 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -145,20 +145,20 @@ const Tab01 = ({form, locale, readOnly}) => ( form={form} mode={'toOriginal'} fieldName={'title'} - toField={'original_title'} + toField={'title_original'} disabled={readOnly}/> From e4ec740872512d3156271245b8b7edf19c9c025b Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 2 Mar 2023 14:39:17 +0100 Subject: [PATCH 018/152] Update PersonOtherNames.js --- .../fields/authority_lists/PersonOtherNames.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/authority_lists/PersonOtherNames.js b/components/Forms/fields/authority_lists/PersonOtherNames.js index 5ee33d7..8e804f0 100644 --- a/components/Forms/fields/authority_lists/PersonOtherNames.js +++ b/components/Forms/fields/authority_lists/PersonOtherNames.js @@ -25,12 +25,20 @@ export const PersonOtherNames = ({disabled}) => ( /> - + - + + + + + + From f2ffde55fedd3a72608209466c4d7e35b74bd580 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 2 Mar 2023 17:07:41 +0100 Subject: [PATCH 019/152] Excel export --- components/Grids/FindingAidsGrid.js | 2 +- components/Grids/FindingAidsGridFilter.js | 14 +++++++++++- utils/api.js | 28 +++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/components/Grids/FindingAidsGrid.js b/components/Grids/FindingAidsGrid.js index af8199a..1306a16 100644 --- a/components/Grids/FindingAidsGrid.js +++ b/components/Grids/FindingAidsGrid.js @@ -174,7 +174,7 @@ const FindingAidsGrid = ({seriesID}) => { return ( - +
diff --git a/components/Grids/FindingAidsGridFilter.js b/components/Grids/FindingAidsGridFilter.js index b812511..dbd10b7 100644 --- a/components/Grids/FindingAidsGridFilter.js +++ b/components/Grids/FindingAidsGridFilter.js @@ -1,13 +1,19 @@ import {Button, Col, Form, Input, Popconfirm, Row} from "antd"; import React, {useEffect, useState} from "react"; import style from './FindingAidsGrid.module.css'; +import {getFile} from '../../utils/api'; +import {RiFileExcel2Line} from 'react-icons/ri'; -const FindingAidsGridFilter = ({onFilter, onReplace, onReplaceAll}) => { +const FindingAidsGridFilter = ({seriesID, onFilter, onReplace, onReplaceAll}) => { const [form] = Form.useForm(); const [findDisabled, setFindDisabled] = useState(true); const [replaceDisabled, setReplaceDisabled] = useState(true); + const onExportClick = () => { + getFile(`/v1/finding_aids/grid/list/export/${seriesID}/`, 'export.xlsx') + } + const onFilterClick = () => { const findValue = form.getFieldValue('find'); onFilter(findValue); @@ -65,6 +71,12 @@ const FindingAidsGridFilter = ({onFilter, onReplace, onReplaceAll}) => { + + + + ) diff --git a/utils/api.js b/utils/api.js index 495314a..0b1cfd7 100644 --- a/utils/api.js +++ b/utils/api.js @@ -36,6 +36,34 @@ export const get = async (url, params={}) => { ) }; +export const getFile = async (url, filename) => { + const session = await getSession(); + + axios.get( + `${API}${url}`, + { + headers: { + Authorization: "Bearer " + session.accessToken + }, + responseType: 'blob' + } + ).then(response => { + // create file link in browser's memory + const href = URL.createObjectURL(response.data); + + // create "a" HTML element with href to file & click + const link = document.createElement('a'); + link.href = href; + link.download = filename; + document.body.appendChild(link); + link.click(); + + // clean up "a" element & remove ObjectURL + document.body.removeChild(link); + URL.revokeObjectURL(href); + }); +}; + export const put = async (url, data={}) => { const session = await getSession(); From 644bd1b44e3dc30ce81c8c3a102aca7dc7ab095f Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 3 Mar 2023 13:24:51 +0100 Subject: [PATCH 020/152] Update allowedGroups.js --- utils/config/allowedGroups.js | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js index 3c05b7f..79c2419 100644 --- a/utils/config/allowedGroups.js +++ b/utils/config/allowedGroups.js @@ -2,6 +2,7 @@ export const allowedGroups = { '/': '__ALL__', '/dashboard': '__ALL__', '/accessions': 'Accessions', + '/donors': 'Accessions', '/archival-units': "Archival Units", '/isaar': "ISAAR", '/isad': 'ISAD(G)', From b725a5ca179d06947c8785225a82920d99d2a26a Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 5 Mar 2023 21:00:37 +0100 Subject: [PATCH 021/152] Update ArchivalUnitSelectForm.js --- components/Forms/ArchivalUnitSelectForm.js | 37 ++++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/components/Forms/ArchivalUnitSelectForm.js b/components/Forms/ArchivalUnitSelectForm.js index 61a59af..626d845 100644 --- a/components/Forms/ArchivalUnitSelectForm.js +++ b/components/Forms/ArchivalUnitSelectForm.js @@ -1,36 +1,44 @@ -import React, {useState} from 'react'; +import React, {useEffect, useState} from 'react'; import {Button, Card, Col, Form, Row} from "antd"; import style from "./Forms.module.css"; import FormRemoteSelect from "./components/FormRemoteSelect"; import { ContainerOutlined } from '@ant-design/icons'; import Link from "next/link"; import {renderArchivalUnitDropdown} from "../../utils/renders/renderArchivalUnitDropdown"; +import useStickyState from "../../utils/hooks/useStickyState"; export const ArchivalUnitSelectForm = () => { const [form] = Form.useForm(); - const [fonds, setFonds] = useState(undefined); - const [subfonds, setSubfonds] = useState(undefined); - const [series, setSeries] = useState(undefined); + const [ archivalUnitFormState, setArchivalUnitFormState ] = useStickyState({ + fonds: undefined, + subfonds: undefined, + series: undefined + }, 'ams-select-archival-unit-form') + const onValuesChange = (values) => { if (values.hasOwnProperty('fonds')) { form.setFieldsValue({subfonds: undefined}); form.setFieldsValue({series: undefined}); - setFonds(values['fonds']); - setSubfonds(undefined); - setSeries(undefined); + setArchivalUnitFormState({ + fonds: values['fonds'], subfonds: undefined, series: undefined + }) } if (values.hasOwnProperty('subfonds')) { form.setFieldsValue({series: undefined}); - setSubfonds(values['subfonds']); - setSeries(undefined); + + setArchivalUnitFormState({ + fonds: archivalUnitFormState['fonds'], subfonds: values['subfonds'], series: undefined + }) } if (values.hasOwnProperty('series')) { - setSeries(values['series']); + setArchivalUnitFormState({ + fonds: archivalUnitFormState['fonds'], subfonds: archivalUnitFormState['subfonds'], series: values['series'] + }) } }; @@ -40,6 +48,7 @@ export const ArchivalUnitSelectForm = () => { scrollToFirstError={true} form={form} onValuesChange={onValuesChange} + initialValues={archivalUnitFormState} layout={'vertical'} className={style.Form} > @@ -63,7 +72,7 @@ export const ArchivalUnitSelectForm = () => { valueField={'id'} labelField={'title_full'} renderFunction={renderArchivalUnitDropdown} - selectAPI={fonds ? `/v1/archival_unit/select/${fonds}/` : undefined} + selectAPI={archivalUnitFormState['fonds'] ? `/v1/archival_unit/select/${archivalUnitFormState['fonds']}/` : undefined} placeholder={'- Select Subfonds -'} searchMinLength={0} /> @@ -75,7 +84,7 @@ export const ArchivalUnitSelectForm = () => { valueField={'id'} labelField={'title_full'} renderFunction={renderArchivalUnitDropdown} - selectAPI={subfonds ? `/v1/archival_unit/select/${subfonds}/` : undefined} + selectAPI={archivalUnitFormState['subfonds'] ? `/v1/archival_unit/select/${archivalUnitFormState['subfonds']}/` : undefined} placeholder={'- Select Series -'} searchMinLength={0} /> @@ -85,10 +94,10 @@ export const ArchivalUnitSelectForm = () => { - + From 6d3a99b536b32d539cd30afd2b6ac56878afde7d Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Mar 2023 11:56:11 +0100 Subject: [PATCH 022/152] Change fields --- components/Forms/fields/ArchivalUnitsSeriesForm.js | 4 ++-- components/Forms/fields/ArchivalUnitsSubFondsForm.js | 6 +++--- components/Forms/fields/DonorForm.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/Forms/fields/ArchivalUnitsSeriesForm.js b/components/Forms/fields/ArchivalUnitsSeriesForm.js index 916f755..72cfbae 100644 --- a/components/Forms/fields/ArchivalUnitsSeriesForm.js +++ b/components/Forms/fields/ArchivalUnitsSeriesForm.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Form, Col, Input, Row} from "antd"; +import {Form, Col, Input, Row, InputNumber} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; @@ -42,7 +42,7 @@ export const ArchivalUnitsSeriesForm = ({type, readOnly}) => { name="series" rules={[{ required: true, type: 'number', min: 1 }]} > - + diff --git a/components/Forms/fields/ArchivalUnitsSubFondsForm.js b/components/Forms/fields/ArchivalUnitsSubFondsForm.js index 505b821..a3270ce 100644 --- a/components/Forms/fields/ArchivalUnitsSubFondsForm.js +++ b/components/Forms/fields/ArchivalUnitsSubFondsForm.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Form, Col, Input, Row} from "antd"; +import {Form, Col, Input, Row, InputNumber} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; @@ -26,9 +26,9 @@ export const ArchivalUnitsSubFondsForm = ({type, readOnly}) => { label="Subfonds" name="subfonds" required - rules={[{ required: true, type: 'number', min: 1 }]} + rules={[{ required: true, type: 'number', min: 0 }]} > - + diff --git a/components/Forms/fields/DonorForm.js b/components/Forms/fields/DonorForm.js index 744cec3..a8b6dbe 100644 --- a/components/Forms/fields/DonorForm.js +++ b/components/Forms/fields/DonorForm.js @@ -41,7 +41,7 @@ export const DonorForm = ({readOnly}) => { - + @@ -66,7 +66,7 @@ export const DonorForm = ({readOnly}) => { - + From 2065c939c0467e4f41a744a0eef48d8281252c47 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Mar 2023 14:41:17 +0100 Subject: [PATCH 023/152] Update TableFilters.js --- components/Tables/TableFilters.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Tables/TableFilters.js b/components/Tables/TableFilters.js index 9aaaced..d96d261 100644 --- a/components/Tables/TableFilters.js +++ b/components/Tables/TableFilters.js @@ -18,11 +18,11 @@ const TableFilters = ({onFilterChange, module, filters, ...props}) => { case 'accessions': return ; case 'archival-units': - return ; + return ; case 'isad': - return ; + return ; case 'isaar': - return ; + return ; case 'mlr': return ; case 'digitization': From e1c9f685ccc2f23d305e3d1503bbc99999f2a547 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 7 Mar 2023 07:56:24 +0100 Subject: [PATCH 024/152] Update global.css --- styles/global.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/styles/global.css b/styles/global.css index 916a678..605bc4e 100644 --- a/styles/global.css +++ b/styles/global.css @@ -25,3 +25,11 @@ body { .centerColumn { text-align: center !important; } + +.ant-select-disabled .ant-select-selector { + color: #333 !important; +} + +.ant-input-disabled { + color: #333 !important; +} \ No newline at end of file From c77199dcb16f1f0516e4f244ce7b99381da415bf Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 7 Mar 2023 07:56:30 +0100 Subject: [PATCH 025/152] Update FindingAidsEntityForm.js --- .../Forms/fields/FindingAidsEntityForm.js | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 2568ab4..58ac903 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -372,11 +372,6 @@ const Tab01Template = ({form, locale, readOnly, type}) => ( - - - - - ); @@ -605,6 +600,20 @@ const Tab05 = ({form, locale, readOnly}) => ( ); +const Tab06 = ({form, locale, readOnly}) => { + const digital_version_exists = Form.useWatch('digital_version_exists', form); + + return ( + + + + + + + + ) +} + export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemplate=false}) => { const readOnly = type === 'view'; @@ -638,6 +647,9 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemp + + + From 7250a7f9fe5c72a9c5e1763b77d8ddc6e320fdd6 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 14:33:42 +0100 Subject: [PATCH 026/152] Update FormFilterSearchInput.js --- .../Tables/filters/components/FormFilterSearchInput.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/components/Tables/filters/components/FormFilterSearchInput.js b/components/Tables/filters/components/FormFilterSearchInput.js index 6e788d9..0cb4fe8 100644 --- a/components/Tables/filters/components/FormFilterSearchInput.js +++ b/components/Tables/filters/components/FormFilterSearchInput.js @@ -6,24 +6,20 @@ const FormFilterSearchInput = ({value, onChange, ...props}) => { const {Search} = Input; - const onPressEnter = (e) => { - onChange?.(e.target.value) + const onSearch = (value, e) => { + onChange?.(value) }; const onValueChange = (e) => { const value = e.target.value; setInputValue(value); - if (value === "") { - onChange?.(value) - } }; return ( ) From 8ad229bdd6f0637be15f322ebc66358e7e0135ff Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 14:33:53 +0100 Subject: [PATCH 027/152] Introduce digital version --- .../Forms/fields/FindingAidsEntityForm.js | 24 +---- .../fields/finding_aids/DigitalVersionTab.js | 100 ++++++++++++++++++ 2 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 components/Forms/fields/finding_aids/DigitalVersionTab.js diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 58ac903..a55eb20 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -1,5 +1,5 @@ import React from "react"; -import {Checkbox, Col, Form, Input, Row, Tabs} from "antd"; +import {Badge, Checkbox, Col, Form, Input, Row, Tabs} from "antd"; import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; @@ -13,6 +13,7 @@ import {AdditionalCountries} from "./finding_aids/AdditionalCountries"; import {AdditionalPlaces} from "./finding_aids/AdditionalPlaces"; import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import FormTranslateButton from "../components/FormTranslateButton"; +import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; const {TabPane} = Tabs; @@ -215,11 +216,6 @@ const Tab01 = ({form, locale, readOnly}) => ( - - - - - ); @@ -600,20 +596,6 @@ const Tab05 = ({form, locale, readOnly}) => ( ); -const Tab06 = ({form, locale, readOnly}) => { - const digital_version_exists = Form.useWatch('digital_version_exists', form); - - return ( - - - - - - - - ) -} - export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemplate=false}) => { const readOnly = type === 'view'; @@ -648,7 +630,7 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemp - + diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js new file mode 100644 index 0000000..23b2afb --- /dev/null +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -0,0 +1,100 @@ +import {Badge, Checkbox, Col, Form, Input, Row} from "antd"; +import React from "react"; + +const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { + const digital_version_exists = Form.useWatch('digital_version_exists', form); + const archival_reference_code = Form.useWatch('archival_reference_code', form); + + const {digital_version_exists_container} = initialValues + + const renderContainerDigitalVersion = () => { + const {digital_version} = digital_version_exists_container + + if (digital_version) { + if (digital_version_exists_container['digital_version_online']) { + return ( +
+ +
+ ) + } else { + return ( +
+ +
+ ) + } + } else { + return ( +
+ +
+ ) + } + } + + const renderDigitalVersionIdentifier = () => { + const {digital_version} = digital_version_exists_container + + const renderContainerLevelIdentifier = () => { + return archival_reference_code; + } + + const renderFolderItemLevelIdentifier = () => { + let unit = archival_reference_code.split(':')[0] + let container = archival_reference_code.replace(unit, '').split('/')[0] + let folder = archival_reference_code.replace(unit, '').split('/')[1] + + container = container.replace(":", "").padStart(3, "0") + folder = folder.padStart(3, "0") + + return `${unit.replace(" ", "_")}_${container}_${folder}`; + } + + if (digital_version_exists) { + return renderFolderItemLevelIdentifier() + } else { + if (digital_version) { + if (digital_version_exists_container['digital_version_barcode']) { + return digital_version_exists_container['digital_version_barcode'] + } else { + return renderContainerLevelIdentifier() + } + } else { + return 'N/A' + } + } + } + + return ( + +
+ + {renderContainerDigitalVersion()} + + + + + + + + + + + + + + + + + + ) +} + +export default DigitalVersionTab \ No newline at end of file From c5500cbf78bd129102da5fee0f1f39a0eb44d7d4 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 15:12:00 +0100 Subject: [PATCH 028/152] Update LanguageForm.js --- components/Forms/fields/LanguageForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/fields/LanguageForm.js b/components/Forms/fields/LanguageForm.js index 9b19ade..1ca0bcf 100644 --- a/components/Forms/fields/LanguageForm.js +++ b/components/Forms/fields/LanguageForm.js @@ -15,7 +15,7 @@ export const LanguageForm = ({readOnly}) => { - + From bfa3372d961a789ed87f60fd6d4a3fc6bbaffee8 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 15:12:06 +0100 Subject: [PATCH 029/152] Update FindingAidsTable.js --- components/Tables/FindingAidsTable.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index a6ba7cb..eeb5aa2 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -273,23 +273,18 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco }; const getTemplateButton = () => { - const menu = ( - - { - templateData.map(data => { - return ( - - {data.template_name} - - ) - }) + const menu = () => { + return templateData.map(data => { + return { + key: data.id, + label: {data.template_name} } - - ); + }) + } if (templateData.length > 0) { return ( - + From 066025877e79b405b68ba0ef72bf7ea83f9fc8bd Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 15:13:21 +0100 Subject: [PATCH 030/152] Update Layout.js --- components/Layout/Layout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Layout/Layout.js b/components/Layout/Layout.js index 597bcbe..36553b5 100644 --- a/components/Layout/Layout.js +++ b/components/Layout/Layout.js @@ -36,7 +36,7 @@ export default function AppLayout({children}) { {children} -
Vera & Donald Blinken Open Society Archives © 2021
+
Vera & Donald Blinken Open Society Archives © 2023
) From 7824e602fddc4d7931e2b3cc28a359512e519b38 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 15:18:02 +0100 Subject: [PATCH 031/152] Update FindingAidsEntityQuickForm.js --- .../fields/FindingAidsEntityQuickForm.js | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityQuickForm.js b/components/Forms/fields/FindingAidsEntityQuickForm.js index e181cf9..700ca5d 100644 --- a/components/Forms/fields/FindingAidsEntityQuickForm.js +++ b/components/Forms/fields/FindingAidsEntityQuickForm.js @@ -4,6 +4,7 @@ import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; import {FormFormattedText} from "../components/FormFormattedText"; +import FormTranslateButton from "../components/FormTranslateButton"; const L1_LEVELS = [ @@ -97,16 +98,29 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => {
- + + + name="original_title" + style={{marginBottom: 0}}> + @@ -124,16 +138,29 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => { - + + + name="contents_summary_original" + style={{marginBottom: 0}}> + From dfb8b19cb706b63d89449e5b5649b2670378fa68 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 15:34:44 +0100 Subject: [PATCH 032/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index a55eb20..64f8cf6 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -629,9 +629,12 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemp - - - + { + !isTemplate && + + + + } From 5783e524d989493e04d7d02e6c54e3b7e3eec66a Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 8 Mar 2023 16:10:02 +0100 Subject: [PATCH 033/152] Update FindingAidsEntityQuickForm.js --- components/Forms/fields/FindingAidsEntityQuickForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/fields/FindingAidsEntityQuickForm.js b/components/Forms/fields/FindingAidsEntityQuickForm.js index 700ca5d..aabefa3 100644 --- a/components/Forms/fields/FindingAidsEntityQuickForm.js +++ b/components/Forms/fields/FindingAidsEntityQuickForm.js @@ -111,7 +111,7 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => { From a94200e7a6103d7499f1aeab1a82ce4302602d48 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 Mar 2023 20:21:16 +0100 Subject: [PATCH 034/152] Update ArchivalUnitsSubFondsForm.js --- components/Forms/fields/ArchivalUnitsSubFondsForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/fields/ArchivalUnitsSubFondsForm.js b/components/Forms/fields/ArchivalUnitsSubFondsForm.js index a3270ce..9175586 100644 --- a/components/Forms/fields/ArchivalUnitsSubFondsForm.js +++ b/components/Forms/fields/ArchivalUnitsSubFondsForm.js @@ -32,7 +32,7 @@ export const ArchivalUnitsSubFondsForm = ({type, readOnly}) => { - + From 943dac7a590a4580bc1a06d3fce7a89008b6da4a Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 Mar 2023 23:24:49 +0100 Subject: [PATCH 035/152] Update ArchivalUnitsSubFondsForm.js --- .../Forms/fields/ArchivalUnitsSubFondsForm.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/components/Forms/fields/ArchivalUnitsSubFondsForm.js b/components/Forms/fields/ArchivalUnitsSubFondsForm.js index 9175586..d4f6da3 100644 --- a/components/Forms/fields/ArchivalUnitsSubFondsForm.js +++ b/components/Forms/fields/ArchivalUnitsSubFondsForm.js @@ -3,7 +3,9 @@ import {Form, Col, Input, Row, InputNumber} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; -export const ArchivalUnitsSubFondsForm = ({type, readOnly}) => { +export const ArchivalUnitsSubFondsForm = ({form, type, readOnly}) => { + const subfonds = Form.useWatch('subfonds', form) + return ( @@ -32,7 +34,18 @@ export const ArchivalUnitsSubFondsForm = ({type, readOnly}) => { - + { + if (subfonds !== 0) { + if (value.length === 0) { + return Promise.reject( + new Error("Empty title is only allowed for 0 subfonds!"), + ); + } + } + return Promise.resolve(); + } + }]}> From 38edd01e3fccfaab223feecf304eb099585513e0 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 Mar 2023 23:41:57 +0100 Subject: [PATCH 036/152] Update index.js --- pages/donors/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pages/donors/index.js b/pages/donors/index.js index 6fd39b7..1a7d20b 100644 --- a/pages/donors/index.js +++ b/pages/donors/index.js @@ -17,6 +17,16 @@ export default function DonorList() { key: 'name', width: 400, sorter: true, + }, { + title: 'Country', + dataIndex: 'country', + key: 'country__country', + sorter: true, + }, { + title: 'City', + dataIndex: 'city', + key: 'city', + sorter: true, }, { title: 'Address', dataIndex: 'address', From 2aa3dcbf5f53b8376657cd92a65c6e5a31423ee5 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 9 Mar 2023 23:26:17 +0100 Subject: [PATCH 037/152] Improve documentation linking --- components/Forms/SimpleForm.js | 8 +-- components/Forms/fields/IsaarForm.js | 47 ++++++++++------ components/Forms/fields/IsadForm.js | 72 +++++++++++++++---------- components/Layout/Breadcrumbs.js | 19 ++++++- components/Layout/config/config-help.js | 14 +++++ pages/isaar/create/index.js | 14 +++-- pages/isaar/edit/[id].js | 13 +++-- pages/isaar/view/[id].js | 13 +++-- pages/isad/create/[archival_unit].js | 13 +++-- pages/isad/edit/[id].js | 11 +++- pages/isad/view/[id].js | 14 +++-- 11 files changed, 172 insertions(+), 66 deletions(-) diff --git a/components/Forms/SimpleForm.js b/components/Forms/SimpleForm.js index 02900a2..a7bccfc 100644 --- a/components/Forms/SimpleForm.js +++ b/components/Forms/SimpleForm.js @@ -21,7 +21,7 @@ const MODULES = { 'researchers-db/requests': 'Request' }; -export const SimpleForm = ({api, module, type, initialValues}) => { +export const SimpleForm = ({api, module, type, initialValues, onActiveTabChange}) => { const router = useRouter(); const afterFinish = () => { @@ -43,11 +43,11 @@ export const SimpleForm = ({api, module, type, initialValues}) => { case 'donors': return ; case 'isaar': - return ; + return ; case 'isad': - return ; + return ; case 'finding-aids': - return ; + return ; case 'researchers-db/researchers': return ; case 'researchers-db/requests': diff --git a/components/Forms/fields/IsaarForm.js b/components/Forms/fields/IsaarForm.js index ea5815a..ae5c8b0 100644 --- a/components/Forms/fields/IsaarForm.js +++ b/components/Forms/fields/IsaarForm.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {useEffect} from "react"; import {Col, Form, Input, Row, Tabs} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; import FormSelect from "../components/FormSelect"; @@ -150,24 +150,39 @@ const Tab04 = ({readOnly}) => ( ); -export const IsaarForm = ({form, readOnly}) => { +export const IsaarForm = ({form, readOnly, onActiveTabChange}) => { + useEffect(() => { + onActiveTabChange('required_values') + }, []) + + const onChange = (activeKey) => { + onActiveTabChange(activeKey) + } + + const items = [ + { + key: 'required_values', + label: renderTabTitle(form, FIELD_NAMES['tab01'], "Required Values"), + children: + }, { + key: 'identity', + label: renderTabTitle(form, FIELD_NAMES['tab02'], "Identity"), + children: + }, { + key: 'description', + label: renderTabTitle(form, FIELD_NAMES['tab03'], "Description"), + children: + }, { + key: 'control', + label: 'Control', + children: + } + ] + return ( - - - - - - - - - - - - - - + ) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index 6b3304f..426f146 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {useEffect, useState} from "react"; import {Col, Form, Input, Row, Tabs} from "antd"; import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; @@ -11,8 +11,7 @@ import {RelatedFindingAids} from "./isad/RelatedFindingAids"; import {LocationOfOriginals} from "./isad/LocationOfOriginals"; import {LocationOfCopies} from "./isad/LocationOfCopies"; import FormTranslateButton from "../components/FormTranslateButton"; - -const {TabPane} = Tabs; +import {useRouter} from "next/router"; const ACCRUALS = [ { id: true, accrual: 'Expected'}, @@ -530,33 +529,52 @@ const Tab07 = ({form, locale, readOnly}) => { ) }; -export const IsadForm = ({form, locale, readOnly}) => { +export const IsadForm = ({form, readOnly, onActiveTabChange}) => { + + useEffect(() => { + onActiveTabChange('required_values') + }, []) + + const onChange = (activeKey) => { + onActiveTabChange(activeKey) + } + + const items = [ + { + key: 'required_values', + label: 'Required Values', + children: + }, { + key: 'identity', + label: 'Identity', + children: + }, { + key: 'context', + label: 'Context', + children: + }, { + key: 'content', + label: 'Content', + children: + }, { + key: 'access_and_use', + label: 'Access & Use', + children: + }, { + key: 'allied_materials', + label: 'Allied Materials', + children: + }, { + key: 'notes', + label: 'Notes', + children: + }, + ] + return ( - - - - - - - - - - - - - - - - - - - - - - - + ) diff --git a/components/Layout/Breadcrumbs.js b/components/Layout/Breadcrumbs.js index 7f6b807..85affcc 100644 --- a/components/Layout/Breadcrumbs.js +++ b/components/Layout/Breadcrumbs.js @@ -6,7 +6,22 @@ import React from "react"; import {QuestionCircleOutlined} from '@ant-design/icons'; import config from './config/config-help'; -const Breadcrumbs = ({module, breadcrumbData}) => { +const Breadcrumbs = ({module, breadcrumbData, activeTabKey}) => { + const getHref = () => { + if (module) { + let key; + if (activeTabKey) { + key = `${module}/${activeTabKey}` + } else { + key = module + } + if (config.hasOwnProperty(key)) { + return config[key] + } + } + return '#' + } + return ( @@ -28,7 +43,7 @@ const Breadcrumbs = ({module, breadcrumbData}) => {
- + diff --git a/components/Layout/config/config-help.js b/components/Layout/config/config-help.js index d4aa3b8..097014c 100644 --- a/components/Layout/config/config-help.js +++ b/components/Layout/config/config-help.js @@ -4,8 +4,22 @@ const configHelp = { 'accessions': 'http://manual.osaarchivum.org/accession-records-1', 'donors': 'http://manual.osaarchivum.org/donors', 'archival-units': 'http://manual.osaarchivum.org/archival-unit', + /* ISAAR */ 'isaar': 'http://manual.osaarchivum.org/isaar-cpf', + 'isaar/form/required_values': 'http://manual.osaarchivum.org/required-values-tab', + 'isaar/form/identity': 'http://manual.osaarchivum.org/identity-tab', + 'isaar/form/description': 'http://manual.osaarchivum.org/description-tab', + 'isaar/form/control': 'http://manual.osaarchivum.org/control-tab', + /* ISAD */ 'isad': 'http://manual.osaarchivum.org/isad-g', + 'isad/form/required_values': 'http://manual.osaarchivum.org/required-values-tab-1', + 'isad/form/identifier': 'http://manual.osaarchivum.org/identity-tab-1', + 'isad/form/context': 'http://manual.osaarchivum.org/context-tab', + 'isad/form/content': 'http://manual.osaarchivum.org/content-tab', + 'isad/form/access_and_use': 'http://manual.osaarchivum.org/access-and-use-tab', + 'isad/form/allied_materials': 'http://manual.osaarchivum.org/allied-materials-tab', + 'isad/form/notes': 'http://manual.osaarchivum.org/notes-tab', + /* Finding Aids */ 'finding-aids': 'http://manual.osaarchivum.org/folders-items', 'corporations': 'http://manual.osaarchivum.org/corporations', 'countries': 'http://manual.osaarchivum.org/countries', diff --git a/pages/isaar/create/index.js b/pages/isaar/create/index.js index 8f2bb3f..b60846a 100644 --- a/pages/isaar/create/index.js +++ b/pages/isaar/create/index.js @@ -1,10 +1,12 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; import {SimpleForm} from "../../../components/Forms/SimpleForm"; export default function IsaarCreate() { + const [activeTabKey, setActiveTabKey] = useState('') + const data = { parallel_names: [{}], other_names: [{}], @@ -18,19 +20,25 @@ export default function IsaarCreate() { {text: 'Create'}, ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Create ISAAR-CPF Record - + { data ? : '' + initialValues={data} + onActiveTabChange={onActiveTabChange} + /> : '' } ) diff --git a/pages/isaar/edit/[id].js b/pages/isaar/edit/[id].js index 9057488..4bbe652 100644 --- a/pages/isaar/edit/[id].js +++ b/pages/isaar/edit/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function IsaarEdit() { const router = useRouter(); const { id } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, loading } = useData(id ? `/v1/isaar/${id}/` : null); const manyFieldList = [ @@ -27,19 +29,24 @@ export default function IsaarEdit() { {text: data ? `${data.name}` : ''} ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Edit ISAAR-CPF Records - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} /> : '' } ) diff --git a/pages/isaar/view/[id].js b/pages/isaar/view/[id].js index db57d4b..499ebc9 100644 --- a/pages/isaar/view/[id].js +++ b/pages/isaar/view/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function IsaarView() { const router = useRouter(); const { id } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, error } = useData(id ? `/v1/isaar/${id}/` : undefined); const manyFieldList = [ @@ -27,18 +29,23 @@ export default function IsaarView() { {text: data ? `${data.name}` : ''} ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - View ISAAR-CPF Records - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} /> : '' } ) diff --git a/pages/isad/create/[archival_unit].js b/pages/isad/create/[archival_unit].js index 6c746cf..77120a9 100644 --- a/pages/isad/create/[archival_unit].js +++ b/pages/isad/create/[archival_unit].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function IsadEdit() { const router = useRouter(); const { archival_unit } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, error } = useData(archival_unit ? `/v1/isad/create/${archival_unit}/` : undefined); const manyFieldList = [ @@ -26,19 +28,24 @@ export default function IsadEdit() { {text: 'Create'}, ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Create ISAD(G) Record - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} /> : '' } ) diff --git a/pages/isad/edit/[id].js b/pages/isad/edit/[id].js index 10abb11..135b0b6 100644 --- a/pages/isad/edit/[id].js +++ b/pages/isad/edit/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function IsadEdit() { const router = useRouter(); const { id } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, error } = useData(id ? `/v1/isad/${id}/` : undefined); const manyFieldList = [ @@ -27,18 +29,23 @@ export default function IsadEdit() { {text: data ? `${data.title_full}` : ''} ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Edit ISAD(G) Records - + { data ? : '' } diff --git a/pages/isad/view/[id].js b/pages/isad/view/[id].js index e66466f..095348e 100644 --- a/pages/isad/view/[id].js +++ b/pages/isad/view/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function IsadView() { const router = useRouter(); const { id } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, error } = useData(id ? `/v1/isad/${id}/` : undefined); const manyFieldList = [ @@ -27,19 +29,25 @@ export default function IsadView() { {text: data ? `${data.title_full}` : ''} ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - View ISAD(G) Records - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} + /> : '' } ) From d6c5ff36f8667a4d9021b642fd7960f1869bfac4 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 10 Mar 2023 11:02:36 +0100 Subject: [PATCH 038/152] Implement better documentation --- components/Forms/FindingAidsForm.js | 3 +- .../Forms/fields/FindingAidsEntityForm.js | 81 ++++++++++++------- components/Layout/config/config-help.js | 14 +++- pages/finding-aids/containers/[series].js | 2 +- .../entities/create/[container].js | 14 +++- .../from-template/[template]/[container].js | 15 +++- pages/finding-aids/entities/edit/[id].js | 14 +++- pages/finding-aids/index.js | 2 +- 8 files changed, 102 insertions(+), 43 deletions(-) diff --git a/components/Forms/FindingAidsForm.js b/components/Forms/FindingAidsForm.js index def21bd..861e5df 100644 --- a/components/Forms/FindingAidsForm.js +++ b/components/Forms/FindingAidsForm.js @@ -7,7 +7,7 @@ import {SimpleFormFooter} from "./SimpleFormFooter"; import {FindingAidsEntityForm} from "./fields/FindingAidsEntityForm"; import {useData} from "../../utils/hooks/useData"; -export const FindingAidsForm = ({type, recordID, containerID, seriesID, initialValues}) => { +export const FindingAidsForm = ({type, recordID, containerID, seriesID, onActiveTabChange, initialValues}) => { const [params, setParams] = useState({}); const router = useRouter(); @@ -83,6 +83,7 @@ export const FindingAidsForm = ({type, recordID, containerID, seriesID, initialV form={form} locale={locale} type={type} + onActiveTabChange={onActiveTabChange} /> diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 64f8cf6..9673399 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {useEffect} from "react"; import {Badge, Checkbox, Col, Form, Input, Row, Tabs} from "antd"; import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; @@ -14,6 +14,7 @@ import {AdditionalPlaces} from "./finding_aids/AdditionalPlaces"; import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import FormTranslateButton from "../components/FormTranslateButton"; import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; +import {renderTabTitle} from "../../../utils/functions/renderTabTitle"; const {TabPane} = Tabs; @@ -596,9 +597,57 @@ const Tab05 = ({form, locale, readOnly}) => ( ); -export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemplate=false}) => { +export const FindingAidsEntityForm = ({form, locale, type, initialValues, onActiveTabChange, isTemplate=false}) => { const readOnly = type === 'view'; + useEffect(() => { + onActiveTabChange('basic') + }, []) + + const onChange = (activeKey) => { + onActiveTabChange(activeKey) + } + + let items = [ + { + key: 'basic', + label: 'Basic Metadata', + children: isTemplate ? + : + + }, { + key: 'extra', + label: 'Extra Metadata', + children: + }, { + key: 'contributors', + label: 'Contributors', + children: + }, { + key: 'subjects', + label: 'Subjects', + children: + }, { + key: 'notes', + label: 'Notes', + children: + } + ] + + const getItems = () => { + const digitalVersion = { + key: 'digital_version', + label: 'Digital Version', + children: + } + + if (!isTemplate) { + items.push(digitalVersion) + } + + return items + } + return (
@@ -609,33 +658,7 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, isTemp } - - - { - isTemplate ? - : - - } - - - - - - - - - - - - - - { - !isTemplate && - - - - } - + ) diff --git a/components/Layout/config/config-help.js b/components/Layout/config/config-help.js index 097014c..695976b 100644 --- a/components/Layout/config/config-help.js +++ b/components/Layout/config/config-help.js @@ -4,12 +4,14 @@ const configHelp = { 'accessions': 'http://manual.osaarchivum.org/accession-records-1', 'donors': 'http://manual.osaarchivum.org/donors', 'archival-units': 'http://manual.osaarchivum.org/archival-unit', + /* ISAAR */ 'isaar': 'http://manual.osaarchivum.org/isaar-cpf', 'isaar/form/required_values': 'http://manual.osaarchivum.org/required-values-tab', 'isaar/form/identity': 'http://manual.osaarchivum.org/identity-tab', 'isaar/form/description': 'http://manual.osaarchivum.org/description-tab', 'isaar/form/control': 'http://manual.osaarchivum.org/control-tab', + /* ISAD */ 'isad': 'http://manual.osaarchivum.org/isad-g', 'isad/form/required_values': 'http://manual.osaarchivum.org/required-values-tab-1', @@ -19,8 +21,17 @@ const configHelp = { 'isad/form/access_and_use': 'http://manual.osaarchivum.org/access-and-use-tab', 'isad/form/allied_materials': 'http://manual.osaarchivum.org/allied-materials-tab', 'isad/form/notes': 'http://manual.osaarchivum.org/notes-tab', + /* Finding Aids */ - 'finding-aids': 'http://manual.osaarchivum.org/folders-items', + 'finding-aids/archival-units-select': 'http://manual.osaarchivum.org/finding-aids', + 'finding-aids/containers': 'http://manual.osaarchivum.org/folders-items', + 'finding-aids/form/basic': 'http://manual.osaarchivum.org/basic-metadata-tab', + 'finding-aids/form/extra': 'http://manual.osaarchivum.org/extra-metadata-tab', + 'finding-aids/form/contributors': 'http://manual.osaarchivum.org/contributors-tab', + 'finding-aids/form/subjects': 'http://manual.osaarchivum.org/subjects-tab', + 'finding-aids/form/notes': 'http://manual.osaarchivum.org/notes-tab-1', + + /* Authority List */ 'corporations': 'http://manual.osaarchivum.org/corporations', 'countries': 'http://manual.osaarchivum.org/countries', 'genres': 'http://manual.osaarchivum.org/genres', @@ -28,6 +39,7 @@ const configHelp = { 'people': 'http://manual.osaarchivum.org/people', 'places': 'http://manual.osaarchivum.org/places', 'subjects': 'http://manual.osaarchivum.org/subjects', + 'controlled-lists': 'http://manual.osaarchivum.org/controlled-list', 'mlr': 'http://manual.osaarchivum.org/mlr', 'digitization-log': 'http://manual.osaarchivum.org/digitization-log', diff --git a/pages/finding-aids/containers/[series].js b/pages/finding-aids/containers/[series].js index 58e9b4c..c3c35e2 100644 --- a/pages/finding-aids/containers/[series].js +++ b/pages/finding-aids/containers/[series].js @@ -23,7 +23,7 @@ export default function FindingAidsContainerView() { AMS - Archival Management System - Containers - + { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Create Finding Aids Records - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} + /> : '' } ) diff --git a/pages/finding-aids/entities/create/from-template/[template]/[container].js b/pages/finding-aids/entities/create/from-template/[template]/[container].js index 4d77534..342ae27 100644 --- a/pages/finding-aids/entities/create/from-template/[template]/[container].js +++ b/pages/finding-aids/entities/create/from-template/[template]/[container].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../../../../components/Layout/Breadcrumbs"; @@ -14,6 +14,8 @@ export default function FindingAidsCreateFromTemplate() { const { data, error } = useData(container ? `/v1/finding_aids/pre_create/${container}/` : undefined); const templateData = useData(container ? `/v1/finding_aids/templates/${template}/` : undefined); + const [activeTabKey, setActiveTabKey] = useState('') + const manyFieldList = [ 'dates', 'languages', @@ -38,23 +40,28 @@ export default function FindingAidsCreateFromTemplate() { templateData['data']['folder_no'] = data['folder_no']; templateData['data']['uuid'] = data['uuid']; templateData['data']['archival_reference_code'] = data['archival_reference_code']; - console.log(templateData['data']); return fillManyFields(templateData['data'], manyFieldList); }; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Create Finding Aids Records from Template - + { data && templateData['data'] ? : '' + initialValues={data && templateData['data'] ? generateInitialData() : undefined} + onActiveTabChange={onActiveTabChange} + /> : '' } ) diff --git a/pages/finding-aids/entities/edit/[id].js b/pages/finding-aids/entities/edit/[id].js index 0fb8e63..785d42f 100644 --- a/pages/finding-aids/entities/edit/[id].js +++ b/pages/finding-aids/entities/edit/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../../components/Layout/Breadcrumbs"; @@ -11,6 +11,8 @@ export default function FindingAidsEdit() { const router = useRouter(); const { id } = router.query; + const [activeTabKey, setActiveTabKey] = useState('') + const { data, error } = useData(id ? `/v1/finding_aids/${id}/` : undefined); const manyFieldList = [ @@ -32,19 +34,25 @@ export default function FindingAidsEdit() { {text: data ? `${data.title}` : ''} ]; + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + return ( AMS - Archival Management System - Edit Finding Aids Records - + { data ? : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + onActiveTabChange={onActiveTabChange} + /> : '' } ) diff --git a/pages/finding-aids/index.js b/pages/finding-aids/index.js index 5a0842f..53f6b1b 100644 --- a/pages/finding-aids/index.js +++ b/pages/finding-aids/index.js @@ -15,7 +15,7 @@ export default function FindingAidsSeriesSelect() { AMS - Archival Management System - Finding Aids / Select Archival Unit - + ) From 0d7a48db9c08e55d613a241d0fa38854a63e2de6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 13 Mar 2023 14:04:10 +0100 Subject: [PATCH 039/152] Table spacing stuff --- components/Forms/ContainerCreateForm.js | 7 ++++- components/Tables/ContainerTable.js | 33 +++++++++++---------- components/Tables/ResearchersVisitsTable.js | 2 +- components/Tables/Table.module.scss | 11 +++++-- pages/archival-units/index.js | 2 +- styles/global.css | 5 ++++ 6 files changed, 39 insertions(+), 21 deletions(-) diff --git a/components/Forms/ContainerCreateForm.js b/components/Forms/ContainerCreateForm.js index 952ad27..ffe9a55 100644 --- a/components/Forms/ContainerCreateForm.js +++ b/components/Forms/ContainerCreateForm.js @@ -1,9 +1,10 @@ -import {Button, Card, Col, Form, Input, notification, Row} from "antd"; +import {Button, Col, Form, Input, Row} from "antd"; import style from "./Forms.module.css"; import React, {useState} from "react"; import FormRemoteSelect from "./components/FormRemoteSelect"; import {useData} from "../../utils/hooks/useData"; import {post} from "../../utils/api"; +import {useUpdateEffect} from "react-use"; export const ContainerCreateForm = ({seriesID, containerListRefresh}) => { const [loading, setLoading] = useState(false); @@ -11,6 +12,10 @@ export const ContainerCreateForm = ({seriesID, containerListRefresh}) => { const {data, refresh} = useData(seriesID ? `/v1/container/precreate/${seriesID}/` : undefined); + useUpdateEffect(() => { + form.setFieldValue('container_no', data['container_no']) + }, [data]) + const validateMessages = { required: 'This field is required!' }; diff --git a/components/Tables/ContainerTable.js b/components/Tables/ContainerTable.js index 7edce44..584d173 100644 --- a/components/Tables/ContainerTable.js +++ b/components/Tables/ContainerTable.js @@ -116,21 +116,24 @@ const ContainerTable = ({seriesID, seriesTitle}) => { } }; - return ( - - {renderContainerPublishButton()} - {record.total_number !== 0 && - - } - - ) + if (record.total_number !== 0) { + return ( + + {renderContainerPublishButton()} + + + ) + } else { + return '' + } + }; const columns = [ diff --git a/components/Tables/ResearchersVisitsTable.js b/components/Tables/ResearchersVisitsTable.js index 181d41d..cb4987e 100644 --- a/components/Tables/ResearchersVisitsTable.js +++ b/components/Tables/ResearchersVisitsTable.js @@ -105,7 +105,7 @@ const ResearchersTable = ({...props}) => { return ( - + diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index a6bbaa2..32961fb 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -1,5 +1,5 @@ .Table { - margin-bottom: -12px; + margin-bottom: 0; } .ActionColumn { @@ -53,8 +53,8 @@ } .FindingAidsTable { - margin-left: 14px; - margin-bottom: -10px; + margin-top: 10px; + margin-bottom: 10px; .PublishColumn { border-right: none !important; @@ -63,6 +63,11 @@ :global .ant-table-tbody td { border-bottom: 1px solid #f0f0f0 !important; } + + :global .ant-table-pagination.ant-pagination { + margin-top: 16px !important; + margin-bottom: -10px !important; + } } .ExpandedParent :global td.ant-table-cell { diff --git a/pages/archival-units/index.js b/pages/archival-units/index.js index 805e018..209910b 100644 --- a/pages/archival-units/index.js +++ b/pages/archival-units/index.js @@ -28,7 +28,7 @@ export default function ArchivalUnitList() { AMS - Archival Management System - Archival Units - + Date: Mon, 13 Mar 2023 15:07:27 +0100 Subject: [PATCH 040/152] Container Numbering update --- components/Forms/ContainerCreateForm.js | 6 +++++- components/Tables/ContainerTable.js | 5 ++++- components/Tables/Table.module.scss | 13 +++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/components/Forms/ContainerCreateForm.js b/components/Forms/ContainerCreateForm.js index ffe9a55..65aa9a1 100644 --- a/components/Forms/ContainerCreateForm.js +++ b/components/Forms/ContainerCreateForm.js @@ -6,7 +6,7 @@ import {useData} from "../../utils/hooks/useData"; import {post} from "../../utils/api"; import {useUpdateEffect} from "react-use"; -export const ContainerCreateForm = ({seriesID, containerListRefresh}) => { +export const ContainerCreateForm = ({seriesID, containerListRefresh, deletedContainer}) => { const [loading, setLoading] = useState(false); const [form] = Form.useForm(); @@ -16,6 +16,10 @@ export const ContainerCreateForm = ({seriesID, containerListRefresh}) => { form.setFieldValue('container_no', data['container_no']) }, [data]) + useUpdateEffect(() => { + refresh() + }, [deletedContainer]) + const validateMessages = { required: 'This field is required!' }; diff --git a/components/Tables/ContainerTable.js b/components/Tables/ContainerTable.js index 584d173..138bd15 100644 --- a/components/Tables/ContainerTable.js +++ b/components/Tables/ContainerTable.js @@ -38,6 +38,8 @@ const ContainerTable = ({seriesID, seriesTitle}) => { const [modalVisible, setModalVisible] = useState(false); + const [deletedContainer, setDeletedContainer] = useState(undefined); + const templateData = useData(seriesID ? `/v1/finding_aids/templates/select/${seriesID}/` : undefined); useEffect(() => { @@ -217,6 +219,7 @@ const ContainerTable = ({seriesID, seriesTitle}) => { handleDelete(data.length); deleteAlert(); refresh(); + setDeletedContainer(id); }) } }); @@ -299,7 +302,7 @@ const ContainerTable = ({seriesID, seriesTitle}) => { - + diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index 32961fb..bac5084 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -60,14 +60,19 @@ border-right: none !important; } - :global .ant-table-tbody td { - border-bottom: 1px solid #f0f0f0 !important; - } - :global .ant-table-pagination.ant-pagination { margin-top: 16px !important; margin-bottom: -10px !important; } + + :global tbody.ant-table-tbody tr.ant-table-placeholder td.ant-table-cell { + border-inline-end: 0 !important; + } + + :global .ant-table-footer { + border-top: 1px solid rgba(5, 5, 5, 0.06) !important; + border-right: 0 !important; + } } .ExpandedParent :global td.ant-table-cell { From cc4b79b7618cb25da041993719dc27ef745dc465 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 13 Mar 2023 21:07:59 +0100 Subject: [PATCH 041/152] Update FindingAidsTable.js --- components/Tables/FindingAidsTable.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index eeb5aa2..69b342f 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -48,14 +48,6 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco return ( - - - + - + ( @@ -60,7 +60,7 @@ const Tab01 = ({form, readOnly}) => ( - + ( - + ( disabled={readOnly} /> - + ( - + ( - + ( - + { return ( - + @@ -172,7 +172,7 @@ const Tab02 = ({form, locale, readOnly}) => { - + { @@ -204,7 +204,7 @@ const Tab03 = ({form, locale, readOnly}) => { return ( - + { @@ -229,7 +229,7 @@ const Tab03 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -261,7 +261,7 @@ const Tab04 = ({form, locale, readOnly}) => { return ( - + { @@ -286,7 +286,7 @@ const Tab04 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -311,7 +311,7 @@ const Tab04 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -336,7 +336,7 @@ const Tab04 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -373,7 +373,7 @@ const Tab05 = ({form, locale, readOnly}) => { - + { @@ -414,7 +414,7 @@ const Tab06 = ({form, locale, readOnly}) => { - + { @@ -446,7 +446,7 @@ const Tab07 = ({form, locale, readOnly}) => { return ( - + { @@ -471,7 +471,7 @@ const Tab07 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -496,7 +496,7 @@ const Tab07 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + { @@ -521,7 +521,7 @@ const Tab07 = ({form, locale, readOnly}) => { disabled={readOnly}/> - + diff --git a/components/Forms/fields/isad/Creators.js b/components/Forms/fields/isad/Creators.js index dfed621..82b682b 100644 --- a/components/Forms/fields/isad/Creators.js +++ b/components/Forms/fields/isad/Creators.js @@ -4,7 +4,7 @@ import {CloseOutlined, PlusOutlined} from '@ant-design/icons'; export const Creators = ({disabled}) => ( -
Creators
+
3.2.1 Creators
{(fields, { add, remove }) => { return ( diff --git a/components/Forms/fields/isad/Extents.js b/components/Forms/fields/isad/Extents.js index 0d23e9c..7952bb7 100644 --- a/components/Forms/fields/isad/Extents.js +++ b/components/Forms/fields/isad/Extents.js @@ -5,7 +5,7 @@ import FormRemoteSelect from "../../components/FormRemoteSelect"; export const Extents = ({disabled}) => ( -
Creators
+
3.1.5 Extent of the unit of description
{(fields, { add, remove }) => { return ( diff --git a/components/Forms/fields/isad/LocationOfCopies.js b/components/Forms/fields/isad/LocationOfCopies.js index 548e496..95c7201 100644 --- a/components/Forms/fields/isad/LocationOfCopies.js +++ b/components/Forms/fields/isad/LocationOfCopies.js @@ -4,7 +4,7 @@ import {CloseOutlined, PlusOutlined} from '@ant-design/icons'; export const LocationOfCopies = ({disabled}) => ( -
Location of Copies
+
3.5.2 Location of copies
{(fields, { add, remove }) => { return ( diff --git a/components/Forms/fields/isad/LocationOfOriginals.js b/components/Forms/fields/isad/LocationOfOriginals.js index 968d44f..2ba1633 100644 --- a/components/Forms/fields/isad/LocationOfOriginals.js +++ b/components/Forms/fields/isad/LocationOfOriginals.js @@ -4,7 +4,7 @@ import {CloseOutlined, PlusOutlined} from '@ant-design/icons'; export const LocationOfOriginals = ({disabled}) => ( -
Location of Originals
+
3.5.1 Location of originals
{(fields, { add, remove }) => { return ( diff --git a/components/Forms/fields/isad/RelatedFindingAids.js b/components/Forms/fields/isad/RelatedFindingAids.js index c3cb22c..bbb8ea4 100644 --- a/components/Forms/fields/isad/RelatedFindingAids.js +++ b/components/Forms/fields/isad/RelatedFindingAids.js @@ -4,7 +4,7 @@ import {CloseOutlined, PlusOutlined} from '@ant-design/icons'; export const RelatedFindingAids = ({disabled}) => ( -
Related Finding Aids
+
3.5.3 Related finding aids
{(fields, { add, remove }) => { return ( From 112c1606c7be3946d2dce180661549ea7305b0ad Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 24 Mar 2023 14:03:56 +0100 Subject: [PATCH 046/152] Add dashboard document link --- components/Forms/fields/IsadForm.js | 2 +- components/Layout/config/config-help.js | 1 + pages/dashboard/index.js | 2 +- pages/index.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index 27b96bd..bcc24c7 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -385,7 +385,7 @@ const Tab05 = ({form, locale, readOnly}) => {
diff --git a/components/Layout/config/config-help.js b/components/Layout/config/config-help.js index 695976b..762704e 100644 --- a/components/Layout/config/config-help.js +++ b/components/Layout/config/config-help.js @@ -1,6 +1,7 @@ import React from "react"; const configHelp = { + 'dashbaord': 'http://manual.osaarchivum.org/dashboard', 'accessions': 'http://manual.osaarchivum.org/accession-records-1', 'donors': 'http://manual.osaarchivum.org/donors', 'archival-units': 'http://manual.osaarchivum.org/archival-unit', diff --git a/pages/dashboard/index.js b/pages/dashboard/index.js index d0f4101..a13138e 100644 --- a/pages/dashboard/index.js +++ b/pages/dashboard/index.js @@ -10,7 +10,7 @@ export default function Dashboard() { AMS - Archival Management System - Dashboard - + ) diff --git a/pages/index.js b/pages/index.js index aec9daf..1350598 100644 --- a/pages/index.js +++ b/pages/index.js @@ -10,7 +10,7 @@ export default function Home() { AMS - Archival Management System - Dashboard - + ) From ec02bea39bf818473ab4ddf3aa2bdc5aa5088fb5 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 24 Mar 2023 14:18:36 +0100 Subject: [PATCH 047/152] Update config-help.js --- components/Layout/config/config-help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Layout/config/config-help.js b/components/Layout/config/config-help.js index 762704e..b443d87 100644 --- a/components/Layout/config/config-help.js +++ b/components/Layout/config/config-help.js @@ -1,7 +1,7 @@ import React from "react"; const configHelp = { - 'dashbaord': 'http://manual.osaarchivum.org/dashboard', + 'dashboard': 'http://manual.osaarchivum.org/dashboard', 'accessions': 'http://manual.osaarchivum.org/accession-records-1', 'donors': 'http://manual.osaarchivum.org/donors', 'archival-units': 'http://manual.osaarchivum.org/archival-unit', From 051d4433391a3c31aff3e57adb57505b7fccdb2f Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 24 Mar 2023 17:19:25 +0100 Subject: [PATCH 048/152] IsadForm fix --- components/Forms/fields/IsadForm.js | 1 - pages/isad/edit/[id].js | 2 +- pages/isad/view/[id].js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index bcc24c7..e6aaf16 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -11,7 +11,6 @@ import {RelatedFindingAids} from "./isad/RelatedFindingAids"; import {LocationOfOriginals} from "./isad/LocationOfOriginals"; import {LocationOfCopies} from "./isad/LocationOfCopies"; import FormTranslateButton from "../components/FormTranslateButton"; -import {useRouter} from "next/router"; const ACCRUALS = [ { id: true, accrual: 'Expected'}, diff --git a/pages/isad/edit/[id].js b/pages/isad/edit/[id].js index 135b0b6..3be329f 100644 --- a/pages/isad/edit/[id].js +++ b/pages/isad/edit/[id].js @@ -42,7 +42,7 @@ export default function IsadEdit() { { data ? Date: Tue, 28 Mar 2023 07:31:54 +0200 Subject: [PATCH 049/152] DigitalVersionTab implementation --- components/Forms/fields/ContainerForm.js | 41 ++++++- .../Forms/fields/FindingAidsEntityForm.js | 1 - .../fields/finding_aids/DigitalVersionTab.js | 109 +++++++++++++----- .../fields/finding_aids/ResearchCloudLink.js | 16 +++ 4 files changed, 131 insertions(+), 36 deletions(-) create mode 100644 components/Forms/fields/finding_aids/ResearchCloudLink.js diff --git a/components/Forms/fields/ContainerForm.js b/components/Forms/fields/ContainerForm.js index 2eb6975..70fcb06 100644 --- a/components/Forms/fields/ContainerForm.js +++ b/components/Forms/fields/ContainerForm.js @@ -1,8 +1,25 @@ -import React from 'react'; -import {Form, Col, Input, Checkbox} from "antd"; +import React, {useEffect} from 'react'; +import {Form, Col, Input, Checkbox, Divider, Switch} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; export const ContainerForm = ({form, readOnly}) => { + const digitalVersionExists = Form.useWatch('digital_version_exists', form); + + useEffect(() => { + if (!digitalVersionExists) { + form.setFieldValue("digital_version_research_cloud", false) + form.setFieldValue("digital_version_online", false) + } + }, [digitalVersionExists]) + + const getDisabled = () => { + if (readOnly) { + return true + } else { + return !digitalVersionExists + } + } + return ( @@ -29,9 +46,25 @@ export const ContainerForm = ({form, readOnly}) => { + + + + + + + + + + + + + + + + - - Digital version exists + + diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 9673399..53a0630 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -14,7 +14,6 @@ import {AdditionalPlaces} from "./finding_aids/AdditionalPlaces"; import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import FormTranslateButton from "../components/FormTranslateButton"; import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; -import {renderTabTitle} from "../../../utils/functions/renderTabTitle"; const {TabPane} = Tabs; diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index 23b2afb..2950938 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -1,12 +1,28 @@ -import {Badge, Checkbox, Col, Form, Input, Row} from "antd"; -import React from "react"; +import {Badge, Checkbox, Col, Divider, Form, Input, Row, Switch} from "antd"; +import React, {useEffect} from "react"; +import ResearchCloudLink from "./ResearchCloudLink"; const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { - const digital_version_exists = Form.useWatch('digital_version_exists', form); - const archival_reference_code = Form.useWatch('archival_reference_code', form); + const digitalVersionExists = Form.useWatch('digital_version_exists', form); + const archivalReferenceCode = Form.useWatch('archival_reference_code', form); const {digital_version_exists_container} = initialValues + useEffect(() => { + if (!digitalVersionExists) { + form.setFieldValue("digital_version_research_cloud", false) + form.setFieldValue("digital_version_online", false) + } + }, [digitalVersionExists]) + + const getDisabled = () => { + if (readOnly) { + return true + } else { + return !digitalVersionExists + } + } + const renderContainerDigitalVersion = () => { const {digital_version} = digital_version_exists_container @@ -19,7 +35,9 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { } /> ) - } else { + } + + if (digital_version_exists_container['digital_version_research_cloud']) { return (
{
) } + + return ( +
+ +
+ ) + } else { return (
@@ -43,13 +70,13 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { const {digital_version} = digital_version_exists_container const renderContainerLevelIdentifier = () => { - return archival_reference_code; + return archivalReferenceCode; } const renderFolderItemLevelIdentifier = () => { - let unit = archival_reference_code.split(':')[0] - let container = archival_reference_code.replace(unit, '').split('/')[0] - let folder = archival_reference_code.replace(unit, '').split('/')[1] + let unit = archivalReferenceCode.split(':')[0] + let container = archivalReferenceCode.replace(unit, '').split('/')[0] + let folder = archivalReferenceCode.replace(unit, '').split('/')[1] container = container.replace(":", "").padStart(3, "0") folder = folder.padStart(3, "0") @@ -57,7 +84,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { return `${unit.replace(" ", "_")}_${container}_${folder}`; } - if (digital_version_exists) { + if (digitalVersionExists) { return renderFolderItemLevelIdentifier() } else { if (digital_version) { @@ -73,27 +100,47 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { } return ( - -
- - {renderContainerDigitalVersion()} - - - - - - - - - - - - - - - - - + + + + + + + + + {renderContainerDigitalVersion()} + + + + + + + + + + + + + + + + + + + + + + + + + + ) } diff --git a/components/Forms/fields/finding_aids/ResearchCloudLink.js b/components/Forms/fields/finding_aids/ResearchCloudLink.js new file mode 100644 index 0000000..05bf242 --- /dev/null +++ b/components/Forms/fields/finding_aids/ResearchCloudLink.js @@ -0,0 +1,16 @@ +import {Button} from "antd"; + +const ResearchCloudLink = ({referenceCode, identifier}) => { + const url = 'https://ceuedu.sharepoint.com/sites/osa-researchcloud/Shared Documents/Forms/AllItems.aspx?' + + 'id=/sites/osa-researchcloud/Shared Documents/' + + console.log(referenceCode) + + return ( + + + + ) +} + +export default ResearchCloudLink; \ No newline at end of file From 4ab8eb2e50ce6c7f8a71260d4cb249aec4ee185e Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 30 Mar 2023 14:24:21 +0200 Subject: [PATCH 050/152] Update Table.module.scss --- components/Tables/Table.module.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index bac5084..e4c8e77 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -83,6 +83,10 @@ padding: 0; margin: 0; + &:before { + display: unset !important; + } + :global .ant-modal { height: -webkit-fill-available; max-width: 100vw; @@ -93,7 +97,7 @@ width: 100vw; height: 100vh; top: 0; - overflow: auto; + overflow: hidden; } :global .ant-modal-body { From e0df3789b91051f22f1a7bb59102fe7051ba306b Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 31 Mar 2023 21:44:43 +0200 Subject: [PATCH 051/152] Implement Research Cloud button. --- components/Forms/fields/ContainerForm.js | 22 ++++++++++++-- .../fields/finding_aids/DigitalVersionTab.js | 30 +++++++++++++------ .../fields/finding_aids/ResearchCloudLink.js | 22 ++++++++++---- 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/components/Forms/fields/ContainerForm.js b/components/Forms/fields/ContainerForm.js index 70fcb06..b4d8a15 100644 --- a/components/Forms/fields/ContainerForm.js +++ b/components/Forms/fields/ContainerForm.js @@ -1,9 +1,12 @@ import React, {useEffect} from 'react'; -import {Form, Col, Input, Checkbox, Divider, Switch} from "antd"; +import {Form, Col, Input, Checkbox, Divider, Switch, Button} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; +import ResearchCloudLink from "./finding_aids/ResearchCloudLink"; export const ContainerForm = ({form, readOnly}) => { const digitalVersionExists = Form.useWatch('digital_version_exists', form); + const digitalVersionResearchCloud = Form.useWatch('digital_version_research_cloud', form) + const digitalVersionResearchCloudPath = Form.useWatch('digital_version_research_cloud_path', form) useEffect(() => { if (!digitalVersionExists) { @@ -20,6 +23,8 @@ export const ContainerForm = ({form, readOnly}) => { } } + + return ( @@ -62,7 +67,20 @@ export const ContainerForm = ({form, readOnly}) => { - + { + digitalVersionResearchCloud && + + + + + + + + + + + } + diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index 2950938..47ac45e 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -68,9 +68,18 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { const renderDigitalVersionIdentifier = () => { const {digital_version} = digital_version_exists_container + const {digital_version_barcode} = digital_version_exists_container const renderContainerLevelIdentifier = () => { - return archivalReferenceCode; + if (archivalReferenceCode) { + let unit = archivalReferenceCode.split(':')[0] + let container = archivalReferenceCode.replace(unit, '').split('/')[0] + container = container.replace(":", "").padStart(3, "0") + + return `${unit.replace(" ", "_")}_${container}`; + } else { + return '' + } } const renderFolderItemLevelIdentifier = () => { @@ -88,8 +97,8 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { return renderFolderItemLevelIdentifier() } else { if (digital_version) { - if (digital_version_exists_container['digital_version_barcode']) { - return digital_version_exists_container['digital_version_barcode'] + if (digital_version_barcode) { + return digital_version_barcode } else { return renderContainerLevelIdentifier() } @@ -113,12 +122,15 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { {renderContainerDigitalVersion()} - - - + { + digital_version_exists_container['digital_version_research_cloud'] && + + + + } diff --git a/components/Forms/fields/finding_aids/ResearchCloudLink.js b/components/Forms/fields/finding_aids/ResearchCloudLink.js index 05bf242..1579f91 100644 --- a/components/Forms/fields/finding_aids/ResearchCloudLink.js +++ b/components/Forms/fields/finding_aids/ResearchCloudLink.js @@ -1,14 +1,24 @@ import {Button} from "antd"; -const ResearchCloudLink = ({referenceCode, identifier}) => { - const url = 'https://ceuedu.sharepoint.com/sites/osa-researchcloud/Shared Documents/Forms/AllItems.aspx?' + - 'id=/sites/osa-researchcloud/Shared Documents/' +const ResearchCloudLink = ({path, buttonText='Open'}) => { + const getLink = () => { + const getParentPath = () => { + if (path) { + return path.slice(0, path.lastIndexOf("/")) + } else { + return '' + } + } - console.log(referenceCode) + const basePath = 'sites/osa-researchcloud/Shared Documents' + const url = `https://ceuedu.sharepoint.com/${basePath}/Forms/AllItems.aspx?id=/${basePath}/${path}&parent=${basePath}/${getParentPath()}` + + return encodeURI(url) + } return ( - - + + ) } From 552c299bdf00f95793ed6e9b1479e7cd3188d54c Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 08:16:18 +0200 Subject: [PATCH 052/152] Add Nationalities --- components/Forms/PopupForm.js | 3 ++ components/Forms/fields/NationalityForm.js | 15 +++++++ components/Layout/config/config-menu.js | 1 + pages/controlled-list/nationalities/index.js | 44 ++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 components/Forms/fields/NationalityForm.js create mode 100644 pages/controlled-list/nationalities/index.js diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 6acabec..6488b04 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -27,6 +27,7 @@ import {MLRForm} from "./fields/MLRForm"; import {DigitizationForm} from "./fields/DigitizationForm"; import {RequestsForm} from "./fields/RequestsForm"; import {RequestItemForm} from "./fields/RequestsItemForm"; +import {NationalityForm} from "./fields/NationalityForm"; export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, onClose}) => { const afterFinish = () => { @@ -88,6 +89,8 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel return ; case 'corporation_role': return ; + case 'nationality': + return ; case 'geo_role': return ; case 'finding-aids-quick-edit': diff --git a/components/Forms/fields/NationalityForm.js b/components/Forms/fields/NationalityForm.js new file mode 100644 index 0000000..7575b5e --- /dev/null +++ b/components/Forms/fields/NationalityForm.js @@ -0,0 +1,15 @@ +import React from 'react'; +import {Form, Col, Input} from "antd"; + +export const NationalityForm = ({readOnly}) => { + return ( + + + + + + + + ) +}; + diff --git a/components/Layout/config/config-menu.js b/components/Layout/config/config-menu.js index e6e75f1..a644ad1 100644 --- a/components/Layout/config/config-menu.js +++ b/components/Layout/config/config-menu.js @@ -44,6 +44,7 @@ const configMenu = [ {name: 'Geo Roles', icon: , group: ['Controlled Lists'], link: '/controlled-list/geo-roles'}, {name: 'Keyword', icon: , group: ['Controlled Lists'], link: '/controlled-list/keywords'}, {name: 'Language Usages', icon: , group: ['Controlled Lists'], link: '/controlled-list/language-usages'}, + {name: 'Nationalities', icon: , group: ['Controlled Lists'], link: '/controlled-list/nationalities'}, {name: 'Person Roles', icon: , group: ['Controlled Lists'], link: '/controlled-list/person-roles'}, {name: 'Primary Types', icon: , group: ['Controlled Lists'], link: '/controlled-list/primary-types'}, {name: 'Reproduction Rights', icon: , group: ['Controlled Lists'], link: '/controlled-list/reproduction-rights'}, diff --git a/pages/controlled-list/nationalities/index.js b/pages/controlled-list/nationalities/index.js new file mode 100644 index 0000000..928a59d --- /dev/null +++ b/pages/controlled-list/nationalities/index.js @@ -0,0 +1,44 @@ +import React from 'react' +import AppLayout from "../../../components/Layout/Layout"; +import Head from "next/head"; +import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; +import {Card} from "antd"; +import PopupTable from "../../../components/Tables/PopupTable"; + +export default function KeywordList() { + const name = 'Nationality'; + const field = 'nationality'; + + const breadcrumbData = [ + {text: 'Controlled List'}, + {text: `Nationalities`} + ]; + + const columns = [ + { + title: name, + dataIndex: field, + key: field, + sorter: true, + } + ]; + + return ( + + + AMS - Archival Management System - {`Nationalities`} + + + + + + + ) +} From 40d449dbb1d35caa8587ac30ded667614740cfc3 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 11:17:50 +0200 Subject: [PATCH 053/152] Update FindingAidsTable.js --- components/Tables/FindingAidsTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index 69b342f..dffb299 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -204,6 +204,7 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco onOk() { post(`/v1/finding_aids/clone/${id}/`).then(() => { refresh(); + containerListRefresh(); }) } }); From a48ae11f664e41671f99c395c99d953d745338c6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 15:06:56 +0200 Subject: [PATCH 054/152] Correct researcher creation --- components/Forms/fields/FindingAidsEntityForm.js | 2 -- pages/researchers-db/researchers/create/index.js | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 53a0630..cf82ce0 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -15,8 +15,6 @@ import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import FormTranslateButton from "../components/FormTranslateButton"; import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; -const {TabPane} = Tabs; - const L1_LEVELS = [ { id: 'F', level: 'Folders'}, { id: 'I', level: 'Items'}, diff --git a/pages/researchers-db/researchers/create/index.js b/pages/researchers-db/researchers/create/index.js index c6338f4..75a4df8 100644 --- a/pages/researchers-db/researchers/create/index.js +++ b/pages/researchers-db/researchers/create/index.js @@ -22,9 +22,9 @@ export default function DonorCreate() { ) From 4bbf08db968246a32baae8c3df4b1fa4f86949c2 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 15:09:01 +0200 Subject: [PATCH 055/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index cf82ce0..b683c6d 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -388,7 +388,7 @@ const Tab02 = ({form, locale, readOnly}) => ( - + From 840dfb13ad1d9fdb9b65ac8619af3e9ef088ac44 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 16:17:00 +0200 Subject: [PATCH 056/152] Add onActiveTabChange --- components/Forms/FindingAidsTemplateForm.js | 7 +++++++ pages/finding-aids/templates/create/[series].js | 5 +++-- pages/finding-aids/templates/edit/[id].js | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/Forms/FindingAidsTemplateForm.js b/components/Forms/FindingAidsTemplateForm.js index 6bb0227..a5ff331 100644 --- a/components/Forms/FindingAidsTemplateForm.js +++ b/components/Forms/FindingAidsTemplateForm.js @@ -9,6 +9,12 @@ import {useRouter} from "next/router"; export const FindingAidsTemplateForm = ({type, recordID, seriesID, initialValues}) => { const router = useRouter(); + const [activeTabKey, setActiveTabKey] = useState('') + + const onActiveTabChange = (activeKey) => { + setActiveTabKey(activeKey) + } + const getAPI = () => { switch (type) { case 'create': @@ -52,6 +58,7 @@ export const FindingAidsTemplateForm = ({type, recordID, seriesID, initialValues form={form} locale={locale} type={type} + onActiveTabChange={onActiveTabChange} /> diff --git a/pages/finding-aids/templates/create/[series].js b/pages/finding-aids/templates/create/[series].js index f154745..6a01a87 100644 --- a/pages/finding-aids/templates/create/[series].js +++ b/pages/finding-aids/templates/create/[series].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../../components/Layout/Breadcrumbs"; @@ -40,7 +40,8 @@ export default function FindingAidsTemplateCreate() { : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + /> : '' } ) diff --git a/pages/finding-aids/templates/edit/[id].js b/pages/finding-aids/templates/edit/[id].js index 6b7eb95..2c198af 100644 --- a/pages/finding-aids/templates/edit/[id].js +++ b/pages/finding-aids/templates/edit/[id].js @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useState} from 'react' import AppLayout from "../../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../../components/Layout/Breadcrumbs"; @@ -42,7 +42,8 @@ export default function FindingAidsTemplateEdit() { recordID={id} seriesID={data ? data.archival_unit : undefined} type={'edit'} - initialValues={data ? fillManyFields(data, manyFieldList) : undefined} /> : '' + initialValues={data ? fillManyFields(data, manyFieldList) : undefined} + /> : '' } ) From 421c9e8c8ef2c732bc103378a8a4949af0fc380e Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 5 Apr 2023 11:51:10 +0200 Subject: [PATCH 057/152] Update FormFormattedText.js --- components/Forms/components/FormFormattedText.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/components/FormFormattedText.js b/components/Forms/components/FormFormattedText.js index d615326..ee71066 100644 --- a/components/Forms/components/FormFormattedText.js +++ b/components/Forms/components/FormFormattedText.js @@ -13,7 +13,7 @@ export const FormFormattedText = ({value, disabled=false, initialValue, ...props ], defaultStyle: 'font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; ' + 'font-size: 14px; color: #5c6873;', - resizingBar : false + resizingBar : true }; return ( From 2c7e02806aca20f1587305bd345da0fc64abab76 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 5 Apr 2023 13:33:23 +0200 Subject: [PATCH 058/152] Update FormFormattedText.js --- components/Forms/components/FormFormattedText.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Forms/components/FormFormattedText.js b/components/Forms/components/FormFormattedText.js index ee71066..5bffcd3 100644 --- a/components/Forms/components/FormFormattedText.js +++ b/components/Forms/components/FormFormattedText.js @@ -9,7 +9,8 @@ export const FormFormattedText = ({value, disabled=false, initialValue, ...props ['bold', 'underline', 'italic'], ['list', 'link'], ['outdent', 'indent'], - ['undo', 'redo'] + ['undo', 'redo'], + ['removeFormat'] ], defaultStyle: 'font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; ' + 'font-size: 14px; color: #5c6873;', From f73e34da2b7b879d70c0fb1dad30cbf787c70fb8 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 13 Apr 2023 00:16:39 +0200 Subject: [PATCH 059/152] Update [id].js --- pages/isad/edit/[id].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/isad/edit/[id].js b/pages/isad/edit/[id].js index 3be329f..3b199ba 100644 --- a/pages/isad/edit/[id].js +++ b/pages/isad/edit/[id].js @@ -42,7 +42,7 @@ export default function IsadEdit() { { data ? Date: Thu, 13 Apr 2023 12:32:21 +0200 Subject: [PATCH 060/152] Correct ending slash --- components/Grids/FindingAidsGrid.js | 39 +++++++++------------- components/Grids/FindingAidsHideColumns.js | 18 ++++++++++ pages/isad/edit/[id].js | 2 +- 3 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 components/Grids/FindingAidsHideColumns.js diff --git a/components/Grids/FindingAidsGrid.js b/components/Grids/FindingAidsGrid.js index 1306a16..6c54c75 100644 --- a/components/Grids/FindingAidsGrid.js +++ b/components/Grids/FindingAidsGrid.js @@ -10,6 +10,7 @@ import { registerAllModules } from 'handsontable/registry'; import {get, patch} from "../../utils/api"; import FindingAidsGridFilter from "./FindingAidsGridFilter"; +import FindingAidsHideColumns from "./FindingAidsHideColumns"; registerAllModules(); @@ -25,16 +26,6 @@ const FindingAidsGrid = ({seriesID}) => { const loadingIcon = ; - const colHeaders = [ - 'Archival Reference Code', - 'Title', 'Title (Original)', - 'Locale', - 'Contents Summary', 'Contents Summary (Original)', - 'Date (From)', 'Date (To)', - 'Start Time', 'End Time', - 'Note', 'Note (Original)' - ]; - const getLocales = (query, process) => { get(`/v1/controlled_list/select/locales`, query ? {search: query} : undefined) .then(response => response.data.map(ld => {return ld['id']})) @@ -42,18 +33,18 @@ const FindingAidsGrid = ({seriesID}) => { }; const columns = [ - {data: 'archival_reference_code', readOnly: true, width: 200}, - {data: 'title', width: 300}, - {data: 'title_original', width: 300}, - {data: 'original_locale', width: 100, type: 'dropdown', source: getLocales}, - {data: 'contents_summary', width: 300}, - {data: 'contents_summary_original', width: 300}, - {data: 'date_from', width: 100}, - {data: 'date_to', width: 100}, - {data: 'time_start', width: 100}, - {data: 'time_end', width: 100}, - {data: 'note', width: 200}, - {data: 'note_original', width: 200}, + {data: 'archival_reference_code', label: 'Archival Reference Code', readOnly: true, width: 200}, + {data: 'title', label: 'Title', width: 300}, + {data: 'title_original', label: 'Title (Original)', width: 300}, + {data: 'original_locale', label: 'Locale', width: 100, type: 'dropdown', source: getLocales}, + {data: 'contents_summary', label: 'Contents Summary', width: 300}, + {data: 'contents_summary_original', label: 'Contents Summary (Original)', width: 300}, + {data: 'date_from', label: 'Date (From)', width: 100}, + {data: 'date_to', label: 'Date (To)', width: 100}, + {data: 'time_start', label: 'Start Time', width: 100}, + {data: 'time_end', label: 'End Time', width: 100}, + {data: 'note', label: 'Note', width: 200}, + {data: 'note_original', label: 'Note (Original)', width: 200}, ]; const afterChange = (changes, source) => { @@ -188,9 +179,9 @@ const FindingAidsGrid = ({seriesID}) => { data={data} columns={columns} rowHeaders={false} - colHeaders={colHeaders} + colHeaders={(index) => columns[index]['label']} + manualColumnMove={true} dropdownMenu={['filter_by_condition', 'filter_by_value', 'filter_action_bar']} - contextMenu={false} filters={true} licenseKey={'non-commercial-and-evaluation'} minHeight={500} diff --git a/components/Grids/FindingAidsHideColumns.js b/components/Grids/FindingAidsHideColumns.js new file mode 100644 index 0000000..7ebf4d3 --- /dev/null +++ b/components/Grids/FindingAidsHideColumns.js @@ -0,0 +1,18 @@ +import {Button, Col, Row} from "antd"; + +const FindingAidsHideColumns = ({columns}) => { + const renderButtons = () => ( + columns.map(col => ( + + ))) + + return ( + + + {renderButtons()} + + + ) +} + +export default FindingAidsHideColumns; \ No newline at end of file diff --git a/pages/isad/edit/[id].js b/pages/isad/edit/[id].js index 3be329f..3b199ba 100644 --- a/pages/isad/edit/[id].js +++ b/pages/isad/edit/[id].js @@ -42,7 +42,7 @@ export default function IsadEdit() { { data ? Date: Thu, 13 Apr 2023 15:58:00 +0200 Subject: [PATCH 061/152] Add digital_version values --- .../Tables/filters/DigitizationTableFilter.js | 38 +++++++++++++++++-- pages/digitization/index.js | 18 ++++++++- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/components/Tables/filters/DigitizationTableFilter.js b/components/Tables/filters/DigitizationTableFilter.js index a0a7fb1..4e8d469 100644 --- a/components/Tables/filters/DigitizationTableFilter.js +++ b/components/Tables/filters/DigitizationTableFilter.js @@ -1,14 +1,19 @@ -import {Col, Form, Row} from "antd"; +import {Col, Form, Row, Select} from "antd"; import React from "react"; import FormRemoteSelect from "../../Forms/components/FormRemoteSelect"; import FormFilterSearchInput from "./components/FormFilterSearchInput"; import style from "../TableFilters.module.css"; const DigitizationTableFilter = () => { + const digitalVersion = [ + { value: 'yes', label: 'Yes'}, + { value: 'no', label: 'No'}, + ]; + return ( - + { className={style.Search}/> - + { /> + + + + + + + + + + + + + + + + + + ) +}; + +export default DigitizationTableFilter; diff --git a/pages/digitization/index.js b/pages/digitization/index.js index 80814cd..929dc93 100644 --- a/pages/digitization/index.js +++ b/pages/digitization/index.js @@ -1,92 +1,21 @@ import React from 'react' +import Head from 'next/head' import AppLayout from "../../components/Layout/Layout"; -import Head from "next/head"; import Breadcrumbs from "../../components/Layout/Breadcrumbs"; -import {Card} from "antd"; -import PopupTable from "../../components/Tables/PopupTable"; -import {renderDigitalVersion} from "../../utils/renders/renderDigitalVersion"; +import DigitizationLogView from "../../components/Digitization/DigitizationLogView"; -export default function DigitizationLogList() { +export default function Digitization() { const breadcrumbData = [ {text: 'Digitization Log'} ]; - const columns = [ - { - title: 'Container No.', - dataIndex: 'container_no', - key: 'container_no', - sorter: true, - width: 200 - }, { - title: 'Barcode', - dataIndex: 'barcode', - key: 'barcode', - width: 150, - sorter: true - }, { - title: 'Digital Version', - dataIndex: 'digital_version_exists', - key: 'digital_version_exists', - width: 150, - className: 'centerColumn', - sorter: true, - render: renderDigitalVersion - }, { - title: 'Research Cloud', - dataIndex: 'digital_version_research_cloud', - key: 'digital_version_research_cloud', - width: 150, - className: 'centerColumn', - sorter: true, - render: renderDigitalVersion - }, { - title: 'Online', - dataIndex: 'digital_version_online', - key: 'digital_version_online', - width: 150, - className: 'centerColumn', - sorter: true, - render: renderDigitalVersion - }, { - title: 'Creation Date', - dataIndex: 'digital_version_creation_date', - key: 'digital_version_creation_date', - className: 'centerColumn', - width: 150, - sorter: true - }, { - title: 'Duration', - dataIndex: 'duration', - key: 'duration', - width: 100, - className: 'centerColumn', - }, { - title: 'Carrier Type', - dataIndex: 'carrier_type', - key: 'carrier_type', - className: 'centerColumn', - sorter: true - }, - ]; - return ( AMS - Archival Management System - Digitization Log - - - + ) } diff --git a/utils/renders/renderDigitalVersionResearchCloud.js b/utils/renders/renderDigitalVersionResearchCloud.js new file mode 100644 index 0000000..4a2e1a6 --- /dev/null +++ b/utils/renders/renderDigitalVersionResearchCloud.js @@ -0,0 +1,19 @@ +import React from 'react'; +import {Badge} from "antd"; +import ResearchCloudLink from "../../components/Forms/fields/finding_aids/ResearchCloudLink"; + +export const renderDigitalVersionResearchCloud = (data) => { + console.log(data) + switch (data['digital_version_research_cloud']) { + case true: + return ( + + ); + case false: + return ( + + ); + default: + break; + } +}; From 99b8b7d92162a271e2ebdfe496560a599acdad76 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 14 Apr 2023 16:28:22 +0200 Subject: [PATCH 063/152] Update --- .../Digitization/DigitizationContainerList.js | 20 +++++++++---------- .../DigitizationFindingAidsList.js | 20 +++++++++---------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/components/Digitization/DigitizationContainerList.js b/components/Digitization/DigitizationContainerList.js index db24cc1..e60f652 100644 --- a/components/Digitization/DigitizationContainerList.js +++ b/components/Digitization/DigitizationContainerList.js @@ -64,16 +64,14 @@ export default function DigitizationContainerList() { ]; return ( - - - + ) } diff --git a/components/Digitization/DigitizationFindingAidsList.js b/components/Digitization/DigitizationFindingAidsList.js index 7ef7904..8836fc2 100644 --- a/components/Digitization/DigitizationFindingAidsList.js +++ b/components/Digitization/DigitizationFindingAidsList.js @@ -52,16 +52,14 @@ export default function DigitizationFindingAidsList() { ]; return ( - - - + ) } From cecff4933d0547be6c2094e49bad748c171248ae Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 20 Apr 2023 17:08:14 +0200 Subject: [PATCH 064/152] Update ResearchersVisitsTable.js --- components/Tables/ResearchersVisitsTable.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Tables/ResearchersVisitsTable.js b/components/Tables/ResearchersVisitsTable.js index cb4987e..19b2753 100644 --- a/components/Tables/ResearchersVisitsTable.js +++ b/components/Tables/ResearchersVisitsTable.js @@ -1,5 +1,5 @@ import { Button, Card, Col, Modal, notification, Row, Table } from "antd"; -import React, {useState} from "react"; +import React, {useEffect, useState} from "react"; import { LoadingOutlined, CaretUpOutlined, CaretRightOutlined, @@ -13,7 +13,7 @@ import {put, remove} from "../../utils/api"; import {deleteAlert} from "./functions/deleteAlert"; const ResearchersTable = ({...props}) => { - const { data, loading, refresh, tableState, handleTableChange} = useTable('researcherVisits', `/v1/research/visits`); + const { data, loading, refresh, tableState, handleDataChange, handleTableChange} = useTable('researcherVisits', `/v1/research/visits`); const [createFormOpen, setCreateFormOpen] = useState(true); @@ -51,6 +51,12 @@ const ResearchersTable = ({...props}) => { }, ]; + useEffect(() => { + if (data) { + handleDataChange(data.count) + } + }, [data]); + const onCheckOut = (data) => { const { confirm } = Modal; From bd8944a2f21b44d6c71814c3cee2972d4a8942f1 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 21 Apr 2023 09:55:38 +0200 Subject: [PATCH 065/152] Update allowedGroups.js --- utils/config/allowedGroups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js index 79c2419..57d4604 100644 --- a/utils/config/allowedGroups.js +++ b/utils/config/allowedGroups.js @@ -10,6 +10,6 @@ export const allowedGroups = { '/authority-list': 'Authority Lists', '/controlled-list': 'Controlled Lists', '/mlr': 'MLR', - '/digitzation-log': '__ALL__', + '/digitzation': '__ALL__', '/researchers-db': 'Research' } \ No newline at end of file From 78557056e324fc42294e8659f4fde050822f9e9b Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 21 Apr 2023 10:04:19 +0200 Subject: [PATCH 066/152] Update allowedGroups.js --- utils/config/allowedGroups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js index 57d4604..bd991f8 100644 --- a/utils/config/allowedGroups.js +++ b/utils/config/allowedGroups.js @@ -10,6 +10,6 @@ export const allowedGroups = { '/authority-list': 'Authority Lists', '/controlled-list': 'Controlled Lists', '/mlr': 'MLR', - '/digitzation': '__ALL__', + '/digitization': '__ALL__', '/researchers-db': 'Research' } \ No newline at end of file From ff9dab0a8dfe669f31029fec19618a1f7f51dfca Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 21 Apr 2023 10:31:54 +0200 Subject: [PATCH 067/152] CSS correction --- pages/researchers-db/visits/index.js | 1 - styles/global.css | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/researchers-db/visits/index.js b/pages/researchers-db/visits/index.js index d38906b..0a25731 100644 --- a/pages/researchers-db/visits/index.js +++ b/pages/researchers-db/visits/index.js @@ -2,7 +2,6 @@ import React from 'react' import AppLayout from "../../../components/Layout/Layout"; import Head from "next/head"; import Breadcrumbs from "../../../components/Layout/Breadcrumbs"; -import {Card} from "antd"; import ResearchersVisitsTable from "../../../components/Tables/ResearchersVisitsTable"; export default function ResearchersVisits() { diff --git a/styles/global.css b/styles/global.css index ab5e949..3ea6605 100644 --- a/styles/global.css +++ b/styles/global.css @@ -37,4 +37,8 @@ body { .ant-table-pagination.ant-pagination { margin-top: 16px !important; margin-bottom: 4px !important; +} + +.ant-layout-sider.ant-layout-sider-dark.ant-layout-sider-has-trigger { + height: calc(100vh - 48px) !important; } \ No newline at end of file From e59cebdd0535dde668ea6a1592019480c84ee412 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Tue, 25 Apr 2023 15:55:56 +0200 Subject: [PATCH 068/152] Update allowedGroups.js --- utils/config/allowedGroups.js | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/config/allowedGroups.js b/utils/config/allowedGroups.js index bd991f8..442e755 100644 --- a/utils/config/allowedGroups.js +++ b/utils/config/allowedGroups.js @@ -1,6 +1,7 @@ export const allowedGroups = { '/': '__ALL__', '/dashboard': '__ALL__', + '/profile': '__ALL__', '/accessions': 'Accessions', '/donors': 'Accessions', '/archival-units': "Archival Units", From b82486b3c7636beab9b38c52943efff7b01929fa Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 5 May 2023 12:03:47 +0200 Subject: [PATCH 069/152] Implement Date Filter --- components/Forms/components/FormRadioGroup.js | 8 +- components/Tables/RequestsTable.js | 15 +++- .../Tables/filters/RequestsTableFilter.js | 83 ++++++++++++------- 3 files changed, 68 insertions(+), 38 deletions(-) diff --git a/components/Forms/components/FormRadioGroup.js b/components/Forms/components/FormRadioGroup.js index b2a6790..2b08d37 100644 --- a/components/Forms/components/FormRadioGroup.js +++ b/components/Forms/components/FormRadioGroup.js @@ -1,17 +1,19 @@ import React, {useState, useEffect} from 'react'; import {Radio} from "antd"; -const FormRadioGroup = ({ value, options, onChange, valueField, labelField, disabled=false, ...props }) => { +const FormRadioGroup = ({ value, options, defaultValue = undefined, optionType='radio', onChange, valueField, labelField, disabled=false, ...props }) => { const radioOptions = options.map((d, idx) => ( {d[labelField]} )); return ( onChange(e.target.value)} disabled={disabled} + optionType={optionType} + buttonStyle="solid" > {radioOptions} diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index 3d097bf..9f15bd1 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -9,13 +9,13 @@ import { import TableFilters from "./TableFilters"; import style from './Table.module.scss'; import {put, remove} from "../../utils/api"; -import {useData} from "../../utils/hooks/useData"; import {useTable} from "../../utils/hooks/useTable"; import {deleteAlert} from "./functions/deleteAlert"; import moment from "moment"; import {PopupForm} from "../Forms/PopupForm"; import _ from 'lodash'; -import Link from "next/link"; +import {AiOutlineLoading} from "react-icons/ai"; + const ORIGIN = { 'FA': 'Archival', @@ -37,7 +37,14 @@ const ResearchersTable = ({...props}) => { key: 'request__request_date', width: 100, render: (data) => renderDate(data) , - sorter: false, + sorter: true, + }, { + title: 'Created at', + dataIndex: 'created_date', + key: 'request__created_date', + width: 100, + render: (data) => renderDate(data) , + sorter: true, }, { title: 'Identifier', key: 'archival_reference_number', @@ -250,7 +257,7 @@ const ResearchersTable = ({...props}) => { size={'small'} loading={{ spinning: loading, - indicator: , + indicator: , }} footer={() => getFooter()} pagination={tableState['pagination']} diff --git a/components/Tables/filters/RequestsTableFilter.js b/components/Tables/filters/RequestsTableFilter.js index 8a0ced9..2d1887b 100644 --- a/components/Tables/filters/RequestsTableFilter.js +++ b/components/Tables/filters/RequestsTableFilter.js @@ -1,6 +1,7 @@ -import React from "react"; +import React, {useState} from "react"; import {Form, Col, Row, Select, Button} from "antd"; import FormRemoteSelect from "../../Forms/components/FormRemoteSelect"; +import FormRadioGroup from "../../Forms/components/FormRadioGroup"; const ITEM_TYPES = [ { value: 'FA', label: 'Archival'}, @@ -8,6 +9,13 @@ const ITEM_TYPES = [ { value: 'FL', label: 'Film Library'} ] +const REQUEST_DATE = [ + { value: 'today', label: 'Today'}, + { value: 'next_day', label: 'Next Day'}, + { value: 'next_week', label: 'Next Week'}, + { value: 'all', label: 'All'} +] + const STATUSES = [ { value: '1', label: 'In Queue'}, { value: '2', label: 'Pending'}, @@ -19,36 +27,49 @@ const STATUSES = [ const RequestsTableFilter = () => { return ( - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + ) }; From 5dab06f90f94f64b0da6c950b28f80a20e92a96e Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 5 May 2023 12:04:18 +0200 Subject: [PATCH 070/152] Implement quantity --- components/Forms/fields/RequestsItemForm.js | 17 +++++++++++++++-- .../Forms/fields/requests/RequestItems.js | 18 ++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/components/Forms/fields/RequestsItemForm.js b/components/Forms/fields/RequestsItemForm.js index b1bb0a1..6c343d9 100644 --- a/components/Forms/fields/RequestsItemForm.js +++ b/components/Forms/fields/RequestsItemForm.js @@ -24,6 +24,8 @@ export const RequestItemForm = ({form}) => { return item_type === 'FA' case 'title': return item_type === 'FA' + case 'quantity': + return item_type === 'FA' default: return true } @@ -107,7 +109,7 @@ export const RequestItemForm = ({form}) => { /> - + { /> - + { /> + + checkRequiredIfLibrary(form, 'item_origin')]} + > + + + ) diff --git a/components/Forms/fields/requests/RequestItems.js b/components/Forms/fields/requests/RequestItems.js index fffcb03..03e0dda 100644 --- a/components/Forms/fields/requests/RequestItems.js +++ b/components/Forms/fields/requests/RequestItems.js @@ -28,6 +28,8 @@ export const RequestItems = ({form}) => { return item_type !== 'FA' case 'identifier': return item_type === 'FA' + case 'quantity': + return item_type === 'FA' case 'title': return item_type === 'FA' default: @@ -112,7 +114,7 @@ export const RequestItems = ({form}) => { /> - + { /> - + { /> + + checkRequiredIfLibrary(form, [field.name, 'quantity'], true)]} + > + + + + + + + + + { /> - + + + { /> - + Date: Tue, 16 May 2023 14:19:41 +0200 Subject: [PATCH 074/152] Update [archival_unit].js --- pages/isad/create/[archival_unit].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/isad/create/[archival_unit].js b/pages/isad/create/[archival_unit].js index 77120a9..04d41ad 100644 --- a/pages/isad/create/[archival_unit].js +++ b/pages/isad/create/[archival_unit].js @@ -41,9 +41,9 @@ export default function IsadEdit() { { data ? : '' } From b6694f58c1f0358df7aed6f907e38367c0335895 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 19 May 2023 13:23:29 +0200 Subject: [PATCH 075/152] Update ResearcherForm.js --- components/Forms/fields/ResearcherForm.js | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/components/Forms/fields/ResearcherForm.js b/components/Forms/fields/ResearcherForm.js index 06e1720..6fc9d06 100644 --- a/components/Forms/fields/ResearcherForm.js +++ b/components/Forms/fields/ResearcherForm.js @@ -21,8 +21,21 @@ const YES_NO = [ { value: 'no', label: 'No' } ] +const HOW_DO_YOU_KNOW_CHOICES = [ + { value: 'web', label: 'OSA web page'}, + { value: 'event', label: 'Event at OSA'}, + { value: 'verzio', label: 'Verzio'}, + { value: 'ceu', label: 'CEU'}, + { value: 'contacts', label: 'Personal contacts'}, + { value: 'media', label: 'Media'}, + { value: 'other', label: 'Other'} +] + export const ResearcherForm = ({form, readOnly}) => { const cardNumber = form.getFieldValue('card_number') + const howDoYouKnowOSA = Form.useWatch('how_do_you_know_osa') + + console.log(howDoYouKnowOSA) return ( @@ -106,6 +119,20 @@ export const ResearcherForm = ({form, readOnly}) => { + + + + { + howDoYouKnowOSA === 'other' && + + + + } From 7fd1b4835bc3d8680a71b0bbd31dfc3250928c45 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 31 May 2023 13:16:36 +0200 Subject: [PATCH 076/152] Introduce Wikidata registration. --- .../Forms/components/FormAuthoritySelect.js | 22 +++-- ...le.css => FormAuthoritySelect.module.scss} | 4 + components/Forms/fields/CorporationForm.js | 12 +++ components/Forms/fields/CountryForm.js | 12 +++ components/Forms/fields/GenreForm.js | 12 +++ components/Forms/fields/PersonForm.js | 12 +++ components/Forms/fields/PlaceForm.js | 12 +++ components/Forms/fields/SubjectForm.js | 12 +++ package.json | 1 + pages/authority-list/corporations/index.js | 7 ++ pages/authority-list/countries/index.js | 7 ++ pages/authority-list/genres/index.js | 9 +- pages/authority-list/languages/index.js | 7 ++ pages/authority-list/people/index.js | 7 ++ pages/authority-list/places/index.js | 7 ++ pages/authority-list/subjects/index.js | 7 ++ utils/renders/renderWikidataURL.js | 5 ++ yarn.lock | 90 ++++++++++++++++++- 18 files changed, 237 insertions(+), 8 deletions(-) rename components/Forms/components/{FormAuthoritySelect.module.css => FormAuthoritySelect.module.scss} (74%) create mode 100644 utils/renders/renderWikidataURL.js diff --git a/components/Forms/components/FormAuthoritySelect.js b/components/Forms/components/FormAuthoritySelect.js index 450574b..b3acf08 100644 --- a/components/Forms/components/FormAuthoritySelect.js +++ b/components/Forms/components/FormAuthoritySelect.js @@ -1,10 +1,11 @@ import {Button, Col, Form, Input, Tooltip, Row, Table} from "antd"; import React, {useState} from "react"; import { SelectOutlined } from '@ant-design/icons'; -import style from "./FormAuthoritySelect.module.css"; +import style from "./FormAuthoritySelect.module.scss"; import {useData} from "../../../utils/hooks/useData"; +import ReactHtmlParser from 'react-html-parser'; -const AuthoritySelectTable = ({tableColumnTitle, tableColumnField, dataSource, ...props}) => { +const AuthoritySelectTable = ({tableColumnTitle, tableColumnField, urlField, dataSource, ...props}) => { const renderSelectButton = (data) => { return( @@ -17,14 +18,19 @@ const AuthoritySelectTable = ({tableColumnTitle, tableColumnField, dataSource, . const renderTitle = (data) => { return( - {data} + + {data[tableColumnField]} + ) }; + const renderName = (data) => { + return (ReactHtmlParser(data)) + } + const columns = [ { title: tableColumnTitle, - dataIndex: tableColumnField, key: tableColumnField, width: 400, sorter: false, @@ -34,6 +40,7 @@ const AuthoritySelectTable = ({tableColumnTitle, tableColumnField, dataSource, . dataIndex: 'name', key: 'name', sorter: false, + render: renderName }, { title: 'Actions', width: 150, @@ -54,13 +61,15 @@ const AuthoritySelectTable = ({tableColumnTitle, tableColumnField, dataSource, . ) }; -export const FormAuthoritySelect = ({api, type, nameField='name', field, form, columnTitle, columnField}) => { +export const FormAuthoritySelect = ({api, type, nameField='name', field, form, columnTitle, columnField, + isWikidata=false, urlField}) => { const [searchValue, setSearchValue] = useState(''); - const {data, loading} = useData(api, {query: searchValue, type: type}); + const {data, loading} = useData(api, {query: searchValue, type: isWikidata ? undefined : type}); const onSearch = () => { const search = form.getFieldValue(nameField); + if (search !== '') { setSearchValue(search); } @@ -91,6 +100,7 @@ export const FormAuthoritySelect = ({api, type, nameField='name', field, form, c onSelect={(val) => form.setFieldsValue({[field]: val})} tableColumnTitle={columnTitle} tableColumnField={columnField} + urlField={urlField} /> diff --git a/components/Forms/components/FormAuthoritySelect.module.css b/components/Forms/components/FormAuthoritySelect.module.scss similarity index 74% rename from components/Forms/components/FormAuthoritySelect.module.css rename to components/Forms/components/FormAuthoritySelect.module.scss index 23740ed..0c26ab7 100644 --- a/components/Forms/components/FormAuthoritySelect.module.css +++ b/components/Forms/components/FormAuthoritySelect.module.scss @@ -1,5 +1,9 @@ .AuthorityTable { margin-top: 15px; + + :global .searchmatch { + background-color: yellow; + } } .SearchButton { diff --git a/components/Forms/fields/CorporationForm.js b/components/Forms/fields/CorporationForm.js index edfae5f..209b74c 100644 --- a/components/Forms/fields/CorporationForm.js +++ b/components/Forms/fields/CorporationForm.js @@ -34,6 +34,18 @@ export const CorporationForm = ({form, readOnly}) => { type={'corporation'} /> + + + { type={'country'} /> + + + { type={'genre'} /> + + + { type={'person'} /> + + + { type={'place'} /> + + + { type={'subject'} /> + + + { + return text && {`https://www.wikidata.org/wiki/${text}`} +}; diff --git a/yarn.lock b/yarn.lock index f3560da..5b70eea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -748,11 +748,44 @@ dom-align@^1.7.0: resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.4.tgz#3503992eb2a7cfcb2ed3b2a6d21e0b9c00d54511" integrity sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw== +dom-serializer@0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" + integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== + dependencies: + domelementtype "^2.0.1" + entities "^2.0.0" + +domelementtype@1, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domelementtype@^2.0.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + dompurify@^2.1.1: version "2.4.1" resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.1.tgz#f9cb1a275fde9af6f2d0a2644ef648dd6847b631" integrity sha512-ewwFzHzrrneRjxzmK6oVz/rZn9VWspGFRDb4/rRtIsM1n36t9AKma/ye8syCpcw+XJ25kOK/hOG7t1j2I2yBqA== +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + dotignore@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" @@ -760,6 +793,16 @@ dotignore@~0.1.2: dependencies: minimatch "^3.0.4" +entities@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + error-stack-parser@^2.0.6: version "2.1.4" resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286" @@ -997,6 +1040,18 @@ has@^1.0.3, has@~1.0.3: dependencies: function-bind "^1.1.1" +htmlparser2@^3.9.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + hyperformula@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/hyperformula/-/hyperformula-2.3.0.tgz#8f2679ded48807033fc228870fb44345f85bd1c8" @@ -1024,7 +1079,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@~2.0.4: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1839,6 +1894,13 @@ react-dom@17.0.2: object-assign "^4.1.1" scheduler "^0.20.2" +react-html-parser@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/react-html-parser/-/react-html-parser-2.0.2.tgz#6dbe1ddd2cebc1b34ca15215158021db5fc5685e" + integrity sha512-XeerLwCVjTs3njZcgCOeDUqLgNIt/t+6Jgi5/qPsO/krUWl76kWKXMeVs2LhY2gwM6X378DkhLjur0zUQdpz0g== + dependencies: + htmlparser2 "^3.9.0" + react-icons@^4.7.1: version "4.7.1" resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.7.1.tgz#0f4b25a5694e6972677cb189d2a72eabea7a8345" @@ -1887,6 +1949,15 @@ react@17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" +readable-stream@^3.1.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1967,6 +2038,11 @@ rw@^1.3.2: resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== +safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" @@ -2129,6 +2205,13 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -2272,6 +2355,11 @@ use-sync-external-store@1.2.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" From 7fdee660452bac4322818cab6e24eb064a89702f Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 31 May 2023 13:41:13 +0200 Subject: [PATCH 077/152] Correct field names --- components/Forms/fields/CountryForm.js | 1 + components/Forms/fields/GenreForm.js | 1 + components/Forms/fields/PlaceForm.js | 1 + components/Forms/fields/SubjectForm.js | 1 + 4 files changed, 4 insertions(+) diff --git a/components/Forms/fields/CountryForm.js b/components/Forms/fields/CountryForm.js index d497f42..a0be1b8 100644 --- a/components/Forms/fields/CountryForm.js +++ b/components/Forms/fields/CountryForm.js @@ -40,6 +40,7 @@ export const CountryForm = ({form, readOnly}) => { api={'/v1/authority_list/wikidata/'} form={form} field={'wikidata_id'} + nameField={'country'} columnTitle={'Wikipedia ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} diff --git a/components/Forms/fields/GenreForm.js b/components/Forms/fields/GenreForm.js index 357dc1f..1a0b6f4 100644 --- a/components/Forms/fields/GenreForm.js +++ b/components/Forms/fields/GenreForm.js @@ -34,6 +34,7 @@ export const GenreForm = ({form, readOnly}) => { { api={'/v1/authority_list/wikidata/'} form={form} field={'wikidata_id'} + nameField={'place'} columnTitle={'Wikipedia ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} diff --git a/components/Forms/fields/SubjectForm.js b/components/Forms/fields/SubjectForm.js index 3628b25..9a8c0c0 100644 --- a/components/Forms/fields/SubjectForm.js +++ b/components/Forms/fields/SubjectForm.js @@ -34,6 +34,7 @@ export const SubjectForm = ({form, readOnly}) => { Date: Thu, 1 Jun 2023 12:13:40 +0200 Subject: [PATCH 078/152] Update LanguageForm.js --- components/Forms/fields/LanguageForm.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/Forms/fields/LanguageForm.js b/components/Forms/fields/LanguageForm.js index 1ca0bcf..818431d 100644 --- a/components/Forms/fields/LanguageForm.js +++ b/components/Forms/fields/LanguageForm.js @@ -1,7 +1,8 @@ import React from 'react'; import {Form, Col, Input} from "antd"; +import {FormAuthoritySelect} from "../components/FormAuthoritySelect"; -export const LanguageForm = ({readOnly}) => { +export const LanguageForm = ({form, readOnly}) => { return ( @@ -29,6 +30,19 @@ export const LanguageForm = ({readOnly}) => { + + + ) }; From 695d4a4b6ba13314ee8428f9556e777cd9f7f3f5 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 1 Jun 2023 13:19:32 +0200 Subject: [PATCH 079/152] Update LanguageForm.js --- components/Forms/fields/LanguageForm.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/Forms/fields/LanguageForm.js b/components/Forms/fields/LanguageForm.js index 818431d..d5698c0 100644 --- a/components/Forms/fields/LanguageForm.js +++ b/components/Forms/fields/LanguageForm.js @@ -5,11 +5,16 @@ import {FormAuthoritySelect} from "../components/FormAuthoritySelect"; export const LanguageForm = ({form, readOnly}) => { return ( - + + + + + + From 2ced46acd364c62fab656b1d5173d397de62054e Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 1 Jun 2023 13:23:25 +0200 Subject: [PATCH 080/152] Typo correction --- components/Forms/fields/CorporationForm.js | 2 +- components/Forms/fields/CountryForm.js | 2 +- components/Forms/fields/GenreForm.js | 2 +- components/Forms/fields/LanguageForm.js | 2 +- components/Forms/fields/PersonForm.js | 2 +- components/Forms/fields/PlaceForm.js | 2 +- components/Forms/fields/SubjectForm.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/Forms/fields/CorporationForm.js b/components/Forms/fields/CorporationForm.js index 209b74c..9cf071f 100644 --- a/components/Forms/fields/CorporationForm.js +++ b/components/Forms/fields/CorporationForm.js @@ -39,7 +39,7 @@ export const CorporationForm = ({form, readOnly}) => { api={'/v1/authority_list/wikidata/'} form={form} field={'wikidata_id'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/CountryForm.js b/components/Forms/fields/CountryForm.js index a0be1b8..73bacff 100644 --- a/components/Forms/fields/CountryForm.js +++ b/components/Forms/fields/CountryForm.js @@ -41,7 +41,7 @@ export const CountryForm = ({form, readOnly}) => { form={form} field={'wikidata_id'} nameField={'country'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/GenreForm.js b/components/Forms/fields/GenreForm.js index 1a0b6f4..d4d35aa 100644 --- a/components/Forms/fields/GenreForm.js +++ b/components/Forms/fields/GenreForm.js @@ -36,7 +36,7 @@ export const GenreForm = ({form, readOnly}) => { form={form} nameField={'genre'} field={'wikidata_id'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/LanguageForm.js b/components/Forms/fields/LanguageForm.js index d5698c0..219ff31 100644 --- a/components/Forms/fields/LanguageForm.js +++ b/components/Forms/fields/LanguageForm.js @@ -41,7 +41,7 @@ export const LanguageForm = ({form, readOnly}) => { form={form} field={'wikidata_id'} nameField={'language'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/PersonForm.js b/components/Forms/fields/PersonForm.js index 450ffbb..eebabe9 100644 --- a/components/Forms/fields/PersonForm.js +++ b/components/Forms/fields/PersonForm.js @@ -43,7 +43,7 @@ export const PersonForm = ({form, readOnly}) => { api={'/v1/authority_list/wikidata/'} form={form} field={'wikidata_id'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/PlaceForm.js b/components/Forms/fields/PlaceForm.js index d2003fd..84d7461 100644 --- a/components/Forms/fields/PlaceForm.js +++ b/components/Forms/fields/PlaceForm.js @@ -37,7 +37,7 @@ export const PlaceForm = ({form, readOnly}) => { form={form} field={'wikidata_id'} nameField={'place'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} diff --git a/components/Forms/fields/SubjectForm.js b/components/Forms/fields/SubjectForm.js index 9a8c0c0..38b6032 100644 --- a/components/Forms/fields/SubjectForm.js +++ b/components/Forms/fields/SubjectForm.js @@ -36,7 +36,7 @@ export const SubjectForm = ({form, readOnly}) => { form={form} nameField={'subject'} field={'wikidata_id'} - columnTitle={'Wikipedia ID'} + columnTitle={'Wikidata ID'} columnField={'wikidata_id'} urlField={'wikidata_url'} isWikidata={true} From 4785bcffe714d8842496a42255b173df7df1ad9b Mon Sep 17 00:00:00 2001 From: JoshBone Date: Tue, 6 Jun 2023 14:18:01 +0200 Subject: [PATCH 081/152] Update RequestsTable.js --- components/Tables/RequestsTable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index 7d4b64c..cf73ee8 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -113,7 +113,7 @@ const ResearchersTable = ({...props}) => { const renderActions = (record) => { const detectDisabled = () => { - return record['status'] !== '1' && record['status'] !== '2' + return record['status'] !== '1' && record['status'] !== '2' && record['status'] !== '3' } return ( @@ -176,9 +176,9 @@ const ResearchersTable = ({...props}) => { case '1': return (generateBadges('In Queue', '#ba3300', false)); case '2': - return (generateBadges('Pending', '#fa8c16')); + return (generateBadges('Pending', '#fa8c16', false)); case '3': - return (generateBadges('Delivered', 'rgba(45,184,227,0.66)')); + return (generateBadges('Delivered', 'rgba(45,184,227,0.66)', false)); case '4': return (generateBadges('Returned', '#83c04d')); case '5': From 097a632936c3fd5765376c5e9ac3514f476be18a Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 7 Jun 2023 09:56:36 +0200 Subject: [PATCH 082/152] Update RequestsTable.js --- components/Tables/RequestsTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index cf73ee8..a6e91d4 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -182,9 +182,9 @@ const ResearchersTable = ({...props}) => { case '4': return (generateBadges('Returned', '#83c04d')); case '5': - return (generateBadges('Reshelved', '#376e18', false)); + return (generateBadges('Reshelved', '#376e18')); case '9': - return (generateBadges('Served', '#223f00', false)); + return (generateBadges('Served', '#223f00')); default: break; } From d1cacc0a281cb1aaf3cbdf1f55192172f3d24012 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 7 Jun 2023 16:36:44 +0200 Subject: [PATCH 083/152] Implement Access Rights on folder/item level. --- components/Forms/components/FormDatePicker.js | 25 ++ .../Forms/fields/FindingAidsEntityForm.js | 292 +++++++++++------- .../fields/FindingAidsEntityQuickForm.js | 60 +++- components/Grids/FindingAidsGrid.js | 21 +- components/Tables/FindingAidsTable.js | 2 +- 5 files changed, 281 insertions(+), 119 deletions(-) create mode 100644 components/Forms/components/FormDatePicker.js diff --git a/components/Forms/components/FormDatePicker.js b/components/Forms/components/FormDatePicker.js new file mode 100644 index 0000000..0f1dbe0 --- /dev/null +++ b/components/Forms/components/FormDatePicker.js @@ -0,0 +1,25 @@ +import React from 'react'; +import {DatePicker} from "antd"; +import dayjs from "dayjs"; + + +const FormDatePicker = ({ format, disabled=false, value, onChange, ...props }) => { + + + const handleChange = (dateObj, dateString) => { + onChange(dateString) + } + + return ( + + ) +}; + +export default FormDatePicker; diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index b683c6d..6a87079 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -1,5 +1,5 @@ -import React, {useEffect} from "react"; -import {Badge, Checkbox, Col, Form, Input, Row, Tabs} from "antd"; +import React, {useEffect, useState} from "react"; +import {Badge, Button, Checkbox, Col, DatePicker, Form, Input, Row, Space, Tabs} from "antd"; import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; @@ -14,6 +14,8 @@ import {AdditionalPlaces} from "./finding_aids/AdditionalPlaces"; import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import FormTranslateButton from "../components/FormTranslateButton"; import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; +import FormDatePicker from "../components/FormDatePicker"; +import dayjs from "dayjs"; const L1_LEVELS = [ { id: 'F', level: 'Folders'}, @@ -29,6 +31,11 @@ const DESCRIPTION_LEVELS = [ { id: 'L2', level: 'Level 2'}, ]; +const ACCESS_RIGHTS = [ + { id: '1', right: 'Not Restricted'}, + { id: '3', right: 'Restricted'}, +]; + const createData = (maxValue) => { const data = [...Array(maxValue+1).keys()].map(value => {return {id: value, number: value}}); data.shift(); @@ -102,120 +109,173 @@ const Identifier = ({initialValues, type}) => ( ); -const Tab01 = ({form, locale, readOnly}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); +const Tab01 = ({form, locale, readOnly}) => { + const accessRights = Form.useWatch('access_rights', form) + const dateFrom = Form.useWatch('date_from', form) + const restrictionDate = Form.useWatch('access_rights_restriction_date', form) + + const setRestrictionDate = (number) => { + let dObj; + if (restrictionDate) { + dObj = dayjs(restrictionDate) + } else { + if (dateFrom) { + try { + dObj = dayjs(`${dateFrom.slice(0, 4)}-12-31`) + } catch (error) { + // Invalid date + } + } + } + if (dObj.isValid()) { + form.setFieldValue('access_rights_restriction_date', dObj.add(number, 'year').format('YYYY-MM-DD')) + } + } + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} const IdentifierTemplate = ({initialValues, type}) => ( ( ( export const FindingAidsEntityQuickForm = ({form, locale, type}) => { const readOnly = type === 'view'; + const accessRights = Form.useWatch('access_rights', form) + const dateFrom = Form.useWatch('date_from', form) + const restrictionDate = Form.useWatch('access_rights_restriction_date', form) + + const setRestrictionDate = (number) => { + let dObj; + if (restrictionDate) { + dObj = dayjs(restrictionDate) + } else { + if (dateFrom) { + try { + dObj = dayjs(`${dateFrom.slice(0, 4)}-12-31`) + } catch (error) { + // Invalid date + } + } + } + if (dObj.isValid()) { + form.setFieldValue('access_rights_restriction_date', dObj.add(number, 'year').format('YYYY-MM-DD')) + } + } + return ( @@ -137,6 +166,35 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => { + + + + + + + + + + + + + + + + + + diff --git a/components/Grids/FindingAidsGrid.js b/components/Grids/FindingAidsGrid.js index 6c54c75..e662f09 100644 --- a/components/Grids/FindingAidsGrid.js +++ b/components/Grids/FindingAidsGrid.js @@ -26,12 +26,21 @@ const FindingAidsGrid = ({seriesID}) => { const loadingIcon = ; + const ACCESS_RIGHTS = [ + {value: '1', label: 'Not Restricted'}, + {value: '3', label: 'Restricted'} + ] + const getLocales = (query, process) => { get(`/v1/controlled_list/select/locales`, query ? {search: query} : undefined) .then(response => response.data.map(ld => {return ld['id']})) .then(data => process(data)); }; + const getAccessRights = (query, process) => { + return process(ACCESS_RIGHTS.map(ar => ar['label'])) + } + const columns = [ {data: 'archival_reference_code', label: 'Archival Reference Code', readOnly: true, width: 200}, {data: 'title', label: 'Title', width: 300}, @@ -41,6 +50,8 @@ const FindingAidsGrid = ({seriesID}) => { {data: 'contents_summary_original', label: 'Contents Summary (Original)', width: 300}, {data: 'date_from', label: 'Date (From)', width: 100}, {data: 'date_to', label: 'Date (To)', width: 100}, + {data: 'access_rights', label: 'Access Rights', width: 100, type: 'dropdown', source: getAccessRights}, + {data: 'access_rights_restriction_date', label: 'Restriction Date', width: 100, type: 'date'}, {data: 'time_start', label: 'Start Time', width: 100}, {data: 'time_end', label: 'End Time', width: 100}, {data: 'note', label: 'Note', width: 200}, @@ -72,7 +83,7 @@ const FindingAidsGrid = ({seriesID}) => { changes.forEach(change => { const [row, prop, oldValue, newValue] = change; - const value = getNewValue(prop, newValue); + let value = getNewValue(prop, newValue); if (!oldValue && value === "") { return; @@ -82,6 +93,14 @@ const FindingAidsGrid = ({seriesID}) => { const id = data[row]['id']; const col = columns.findIndex(d => d.data === prop); + // access_rights + if (prop === 'access_rights') { + const filtered = ACCESS_RIGHTS.filter(ar => ar['label'] === value) + if (filtered.length > 0) { + value = filtered[0]['value'] + } + } + patch(`/v1/finding_aids/${id}/`, {[prop]: value}).then(response => { hot.current.hotInstance.setCellMeta(row, col, 'className', 'success'); hot.current.hotInstance.render(); diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index dffb299..1e7e870 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -290,7 +290,7 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco }) } - if (templateData.length > 0) { + if (templateData && templateData.length > 0) { return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); +const Tab02 = ({form, locale, readOnly}) => { + const timeStart = Form.useWatch('time_start', form) + const timeEnd = Form.useWatch('time_end', form) + + useEffect(() => { + const ts = dayjs(timeStart, 'HH:mm:ss') + const te = dayjs(timeEnd, 'HH:mm:ss') + + if (ts.isValid() && te.isValid()) { + const duration = te.diff(ts) + form.setFieldValue('duration', dayjs(duration).subtract(1, 'hour').format('HH:mm:ss')) + } else { + form.setFieldValue('duration', 'Invalid time format') + } + }, [timeStart, timeEnd]) + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) +}; const Tab03 = ({form, readOnly}) => ( From 03e9beadd7e09baf8ab976905e8fef039f200106 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Tue, 27 Jun 2023 09:26:59 +0200 Subject: [PATCH 086/152] Include Identifiers --- .../Forms/fields/FindingAidsEntityForm.js | 4 ++ .../Forms/fields/finding_aids/Identifiers.js | 63 +++++++++++++++++++ .../entities/create/[container].js | 1 + .../from-template/[template]/[container].js | 1 + pages/finding-aids/entities/edit/[id].js | 1 + 5 files changed, 70 insertions(+) create mode 100644 components/Forms/fields/finding_aids/Identifiers.js diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 99cf801..04fd323 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -16,6 +16,7 @@ import FormTranslateButton from "../components/FormTranslateButton"; import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; import FormDatePicker from "../components/FormDatePicker"; import dayjs from "dayjs"; +import {Identifiers} from "./finding_aids/Identifiers"; const L1_LEVELS = [ { id: 'F', level: 'Folders'}, @@ -447,6 +448,9 @@ const Tab02 = ({form, locale, readOnly}) => { return ( + + + ( + +
Identifiers
+ + {(fields, { add, remove }) => { + return ( + <> + {fields.map((field, idx) => ( + +
+ + + + + + + + + + + + + } + + ) + }} + + +); diff --git a/pages/finding-aids/entities/create/[container].js b/pages/finding-aids/entities/create/[container].js index 2fb40f1..5508de5 100644 --- a/pages/finding-aids/entities/create/[container].js +++ b/pages/finding-aids/entities/create/[container].js @@ -17,6 +17,7 @@ export default function FindingAidsCreate() { const manyFieldList = [ 'dates', + 'identifiers', 'languages', 'extents', 'associated_people', diff --git a/pages/finding-aids/entities/create/from-template/[template]/[container].js b/pages/finding-aids/entities/create/from-template/[template]/[container].js index 342ae27..50aedcb 100644 --- a/pages/finding-aids/entities/create/from-template/[template]/[container].js +++ b/pages/finding-aids/entities/create/from-template/[template]/[container].js @@ -18,6 +18,7 @@ export default function FindingAidsCreateFromTemplate() { const manyFieldList = [ 'dates', + 'identifiers', 'languages', 'extents', 'associated_people', diff --git a/pages/finding-aids/entities/edit/[id].js b/pages/finding-aids/entities/edit/[id].js index 785d42f..038a47c 100644 --- a/pages/finding-aids/entities/edit/[id].js +++ b/pages/finding-aids/entities/edit/[id].js @@ -17,6 +17,7 @@ export default function FindingAidsEdit() { const manyFieldList = [ 'dates', + 'identifiers', 'languages', 'extents', 'associated_people', From fdd9be3f56de282e3577807729348a872ba492d4 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 28 Jun 2023 13:45:32 +0200 Subject: [PATCH 087/152] Update IsadForm.js --- components/Forms/fields/IsadForm.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index e6aaf16..9e26d92 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -244,13 +244,13 @@ const Tab03 = ({form, locale, readOnly}) => { name="archival_history_original" style={{marginBottom: 0}}> - + ) From cf3d5cd6b0e5ee7972bc037c30d4b51f985f9f3f Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 21 Jul 2023 12:56:16 +0200 Subject: [PATCH 088/152] Added 'created' and 'updated' info to popup forms. --- components/Forms/Forms.module.css | 1 + components/Forms/PopupForm.js | 18 ++++++++++++++++++ components/Forms/fields/ContainerForm.js | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/components/Forms/Forms.module.css b/components/Forms/Forms.module.css index 42d46d2..72e5651 100644 --- a/components/Forms/Forms.module.css +++ b/components/Forms/Forms.module.css @@ -31,6 +31,7 @@ .FooterInfo { border-top: 0; + margin-top: 20px; margin-bottom: 0; } diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 6488b04..63ffe4d 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -199,6 +199,24 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel } + {data && data.hasOwnProperty('date_created') && +
+ +
+

+ Record created: + {data['date_created']} + {data['user_created'] ? ` by '${data['user_created']}'` : ''} +

+

+ Record updated: + {data['date_updated']} + {data['user_updated'] ? ` by '${data['user_updated']}'` : ''} +

+ + + + } ) diff --git a/components/Forms/fields/ContainerForm.js b/components/Forms/fields/ContainerForm.js index b4d8a15..8c5b54b 100644 --- a/components/Forms/fields/ContainerForm.js +++ b/components/Forms/fields/ContainerForm.js @@ -2,6 +2,7 @@ import React, {useEffect} from 'react'; import {Form, Col, Input, Checkbox, Divider, Switch, Button} from "antd"; import FormRemoteSelect from "../components/FormRemoteSelect"; import ResearchCloudLink from "./finding_aids/ResearchCloudLink"; +import {FormFormattedText} from "../components/FormFormattedText"; export const ContainerForm = ({form, readOnly}) => { const digitalVersionExists = Form.useWatch('digital_version_exists', form); @@ -52,6 +53,12 @@ export const ContainerForm = ({form, readOnly}) => { + + + + + + From 10ddff60333a7c5f33856c7cb5a2677d84d34b9a Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 15 Sep 2023 14:09:14 +0200 Subject: [PATCH 089/152] Update DigitalVersionTab.js --- .../Forms/fields/finding_aids/DigitalVersionTab.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index 47ac45e..15449b8 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -73,10 +73,10 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { const renderContainerLevelIdentifier = () => { if (archivalReferenceCode) { let unit = archivalReferenceCode.split(':')[0] - let container = archivalReferenceCode.replace(unit, '').split('/')[0] - container = container.replace(":", "").padStart(3, "0") + let container = archivalReferenceCode.replaceAll(unit, '').split('/')[0] + container = container.replaceAll(":", "").padStart(4, "0") - return `${unit.replace(" ", "_")}_${container}`; + return `${unit.replaceAll(" ", "_")}-${container}`; } else { return '' } @@ -84,13 +84,13 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { const renderFolderItemLevelIdentifier = () => { let unit = archivalReferenceCode.split(':')[0] - let container = archivalReferenceCode.replace(unit, '').split('/')[0] - let folder = archivalReferenceCode.replace(unit, '').split('/')[1] + let container = archivalReferenceCode.replaceAll(unit, '').split('/')[0] + let folder = archivalReferenceCode.replaceAll(unit, '').split('/')[1] - container = container.replace(":", "").padStart(3, "0") + container = container.replaceAll(":", "").padStart(4, "0") folder = folder.padStart(3, "0") - return `${unit.replace(" ", "_")}_${container}_${folder}`; + return `${unit.replaceAll(" ", "_")}-${container}-${folder}`; } if (digitalVersionExists) { From 14bdd9ea381165ad0d59950d316daf3a23c2bc07 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 15 Sep 2023 14:45:08 +0200 Subject: [PATCH 090/152] Update DigitalVersionTab.js --- components/Forms/fields/finding_aids/DigitalVersionTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index 15449b8..ee5fa01 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -9,7 +9,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { const {digital_version_exists_container} = initialValues useEffect(() => { - if (!digitalVersionExists) { + if (digitalVersionExists && !digitalVersionExists) { form.setFieldValue("digital_version_research_cloud", false) form.setFieldValue("digital_version_online", false) } From d1a67ef38286163ddc99ebff4dc020b485ca86e1 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 19 Sep 2023 16:00:37 +0200 Subject: [PATCH 091/152] AccessRights fields --- .../Forms/fields/FindingAidsEntityForm.js | 265 +++++++++++------- .../fields/FindingAidsEntityQuickForm.js | 6 +- components/Forms/fields/IsadForm.js | 2 +- 3 files changed, 163 insertions(+), 110 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 04fd323..1af7161 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -33,8 +33,8 @@ const DESCRIPTION_LEVELS = [ ]; const ACCESS_RIGHTS = [ - { id: '1', right: 'Not Restricted'}, - { id: '3', right: 'Restricted'}, + { id: 1, right: 'Not Restricted'}, + { id: 3, right: 'Restricted'}, ]; const createData = (maxValue) => { @@ -211,7 +211,7 @@ const Tab01 = ({form, locale, readOnly}) => { - + ( ); -const Tab01Template = ({form, locale, readOnly, type}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const Tab01Template = ({form, locale, readOnly, type}) => { + const accessRights = Form.useWatch('access_rights', form) + const dateFrom = Form.useWatch('date_from', form) + const restrictionDate = Form.useWatch('access_rights_restriction_date', form) + + const setRestrictionDate = (number) => { + let dObj; + if (restrictionDate) { + dObj = dayjs(restrictionDate) + } else { + if (dateFrom) { + try { + dObj = dayjs(`${dateFrom.slice(0, 4)}-12-31`) + } catch (error) { + // Invalid date + } + } + } + if (dObj.isValid()) { + form.setFieldValue('access_rights_restriction_date', dObj.add(number, 'year').format('YYYY-MM-DD')) + } + } + + return ( + + + - - -); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} const Tab02 = ({form, locale, readOnly}) => { const timeStart = Form.useWatch('time_start', form) diff --git a/components/Forms/fields/FindingAidsEntityQuickForm.js b/components/Forms/fields/FindingAidsEntityQuickForm.js index 0e94aad..5551c7c 100644 --- a/components/Forms/fields/FindingAidsEntityQuickForm.js +++ b/components/Forms/fields/FindingAidsEntityQuickForm.js @@ -24,8 +24,8 @@ const DESCRIPTION_LEVELS = [ ]; const ACCESS_RIGHTS = [ - { id: '1', right: 'Not Restricted'}, - { id: '3', right: 'Restricted'}, + { id: 1, right: 'Not Restricted'}, + { id: 3, right: 'Restricted'}, ]; const Identifier = ({initialValues, type}) => ( @@ -167,7 +167,7 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => { - + ( valueField={'id'} labelField={'statement'} selectAPI={'/v1/controlled_list/select/access_rights/'} - disabled={readOnly} + disabled={true} /> From 86ba233595923270fb0a2cf00c16ca51da4a84ea Mon Sep 17 00:00:00 2001 From: JoshBone Date: Wed, 20 Sep 2023 10:37:38 +0200 Subject: [PATCH 092/152] Update IsadForm.js --- components/Forms/fields/IsadForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index 7f3d18c..bd34716 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -508,14 +508,14 @@ const Tab07 = ({form, locale, readOnly}) => { From 714c18fef9671bdd50eb595da36ea9dd7f601369 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 26 Sep 2023 15:09:09 +0200 Subject: [PATCH 093/152] Update SunEditor --- .../Forms/components/FormFormattedText.js | 6 +++- package.json | 3 +- yarn.lock | 32 ++++++------------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/components/Forms/components/FormFormattedText.js b/components/Forms/components/FormFormattedText.js index 5bffcd3..1def748 100644 --- a/components/Forms/components/FormFormattedText.js +++ b/components/Forms/components/FormFormattedText.js @@ -1,7 +1,11 @@ -import SunEditor from "suneditor-react"; import 'suneditor/dist/css/suneditor.min.css'; import React from "react"; import style from "./FormFormattedText.module.css"; +import dynamic from "next/dynamic"; + +const SunEditor = dynamic(() => import("suneditor-react"), { + ssr: false, +}); export const FormFormattedText = ({value, disabled=false, initialValue, ...props}) => { const options = { diff --git a/package.json b/package.json index cefa149..f564005 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "react-json-view-lite": "^0.9.2", "react-use": "^17.4.0", "sass": "^1.56.2", - "suneditor-react": "^2.16.1", + "suneditor": "^2.45.1", + "suneditor-react": "^3.6.1", "swr": "^1.1.2" }, "browser": { diff --git a/yarn.lock b/yarn.lock index 5b70eea..673ee2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1271,7 +1271,7 @@ longest@^1.0.1: resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" integrity sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg== -loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -1500,15 +1500,6 @@ pretty-format@^3.8.0: resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew== -prop-types@^15.7.2: - version "15.8.1" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" - integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.13.1" - rc-align@^4.0.0: version "4.0.12" resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.12.tgz#065b5c68a1cc92a00800c9239320d9fdf5f16207" @@ -1906,7 +1897,7 @@ react-icons@^4.7.1: resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.7.1.tgz#0f4b25a5694e6972677cb189d2a72eabea7a8345" integrity sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw== -react-is@^16.12.0, react-is@^16.13.1: +react-is@^16.12.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -2229,18 +2220,15 @@ stylis@^4.0.13, stylis@^4.0.6: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== -suneditor-react@^2.16.1: - version "2.16.5" - resolved "https://registry.yarnpkg.com/suneditor-react/-/suneditor-react-2.16.5.tgz#85af8ca095fa29b8b242b75d0042bd0ed80d2679" - integrity sha512-zBUMX7h2LwQyRvG0jxM4Q7Zl4aiAyAHch2sOxbIIBLmOsP9CrZ7LpDfS9vNUzMeO7LR4rFCI7h2yP6xrVFdY4A== - dependencies: - prop-types "^15.7.2" - suneditor "^2.38.8" +suneditor-react@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/suneditor-react/-/suneditor-react-3.6.1.tgz#62bd64784a48f5402e8bae19362fd3d32a7c2fd3" + integrity sha512-12f9KLnEB6pAdyHJINTzRBg3UOWVZZ+jVYSEtwdBTDYQW4amUZr0xOnpikbBAlxb9rcTYV5RHAsad3gnNhLsuA== -suneditor@^2.38.8: - version "2.44.3" - resolved "https://registry.yarnpkg.com/suneditor/-/suneditor-2.44.3.tgz#dd928c37fd82d58414b8d34aa70b8b3cdbc9d39a" - integrity sha512-B25DrbAxcwkvAANNm2EClugBCxATCa3SvV03SpyaMJybKj4bzQnS1iq6Wo3h+v970tNSnjfeoT3ID3Nj0NuiBA== +suneditor@^2.45.1: + version "2.45.1" + resolved "https://registry.yarnpkg.com/suneditor/-/suneditor-2.45.1.tgz#5ce56a2d67bfd31e2c21f777cc7f5a522631eb06" + integrity sha512-fLxc0nLwd77vaPuf78D+VAFNAgX9hLps6h96JA/LUCpqt4LeYnEaIE1RfJojX+BhSA+krl5qZ8pdgqcoo3dN3g== supports-color@^2.0.0: version "2.0.0" From b4089af15c8bb4a3250b21816d53b8a1bbc30fb2 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 27 Sep 2023 17:53:28 +0200 Subject: [PATCH 094/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 1af7161..d9e3b9c 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -494,8 +494,6 @@ const Tab02 = ({form, locale, readOnly}) => { if (ts.isValid() && te.isValid()) { const duration = te.diff(ts) form.setFieldValue('duration', dayjs(duration).subtract(1, 'hour').format('HH:mm:ss')) - } else { - form.setFieldValue('duration', 'Invalid time format') } }, [timeStart, timeEnd]) From 7c517bfae3743045c3bb52c065b78cd465b67950 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 28 Sep 2023 17:33:57 +0200 Subject: [PATCH 095/152] Update FindingAidsEntityForm.js --- .../Forms/fields/FindingAidsEntityForm.js | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index d9e3b9c..76516fb 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -491,10 +491,29 @@ const Tab02 = ({form, locale, readOnly}) => { const ts = dayjs(timeStart, 'HH:mm:ss') const te = dayjs(timeEnd, 'HH:mm:ss') - if (ts.isValid() && te.isValid()) { - const duration = te.diff(ts) - form.setFieldValue('duration', dayjs(duration).subtract(1, 'hour').format('HH:mm:ss')) + if (timeStart) { + if (timeEnd) { + if (ts.isValid() && te.isValid()) { + if (ts.isBefore(te)) { + const duration = te.diff(ts) + form.setFieldValue('duration', dayjs(duration).subtract(1, 'hour').format('HH:mm:ss')) + } else { + form.setFieldValue('duration', '') + } + } else { + form.setFieldValue('duration', '') + } + } else { + if (ts.isValid()) { + form.setFieldValue('duration', timeStart) + } else { + form.setFieldValue('duration', '') + } + } + } else { + form.setFieldValue('duration', '') } + }, [timeStart, timeEnd]) return ( From 71000547fa7f142f9fe8e701c8b361fd06cc67b1 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 12 Oct 2023 14:31:06 +0200 Subject: [PATCH 096/152] Remove ids from manyFields when creating from template. --- .../create/from-template/[template]/[container].js | 7 +++++-- utils/functions/removeIDFromManyFields.js | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 utils/functions/removeIDFromManyFields.js diff --git a/pages/finding-aids/entities/create/from-template/[template]/[container].js b/pages/finding-aids/entities/create/from-template/[template]/[container].js index 50aedcb..23e3810 100644 --- a/pages/finding-aids/entities/create/from-template/[template]/[container].js +++ b/pages/finding-aids/entities/create/from-template/[template]/[container].js @@ -6,6 +6,7 @@ import {useRouter} from "next/router"; import {useData} from "../../../../../../utils/hooks/useData"; import {fillManyFields} from "../../../../../../utils/functions/fillManyFields"; import {FindingAidsForm} from "../../../../../../components/Forms/FindingAidsForm"; +import {removeIDFromManyFields} from "../../../../../../utils/functions/removeIDFromManyFields"; export default function FindingAidsCreateFromTemplate() { const router = useRouter(); @@ -31,7 +32,7 @@ export default function FindingAidsCreateFromTemplate() { {text: data ? `${data['archival_unit_title_full']}` : ''}, {text: data ? `${data['container']}` : ''}, {text: 'Folders - Items'}, - {text: templateData ? `Create from Template: ${templateData['template_name']}`: ''}, + {text: templateData && templateData['data'] ? `Create from Template: ${templateData['data']['template_name']}`: ''}, ]; const generateInitialData = () => { @@ -41,7 +42,9 @@ export default function FindingAidsCreateFromTemplate() { templateData['data']['folder_no'] = data['folder_no']; templateData['data']['uuid'] = data['uuid']; templateData['data']['archival_reference_code'] = data['archival_reference_code']; - return fillManyFields(templateData['data'], manyFieldList); + const tData = removeIDFromManyFields(templateData['data'], manyFieldList) + console.log(tData) + return fillManyFields(tData, manyFieldList); }; const onActiveTabChange = (activeKey) => { diff --git a/utils/functions/removeIDFromManyFields.js b/utils/functions/removeIDFromManyFields.js new file mode 100644 index 0000000..0354450 --- /dev/null +++ b/utils/functions/removeIDFromManyFields.js @@ -0,0 +1,12 @@ +export const removeIDFromManyFields = (data, fieldList) => { + fieldList.forEach(field => { + if (data.hasOwnProperty(field)) { + data[field].forEach(f => { + if (f.hasOwnProperty('id')) { + delete(f['id']) + } + }) + } + }); + return data; +}; From 20b047b17c78318425253a7b93b6c5593d0ecc47 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 12 Oct 2023 14:48:33 +0200 Subject: [PATCH 097/152] Update [container].js --- .../entities/create/from-template/[template]/[container].js | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/finding-aids/entities/create/from-template/[template]/[container].js b/pages/finding-aids/entities/create/from-template/[template]/[container].js index 23e3810..ceede59 100644 --- a/pages/finding-aids/entities/create/from-template/[template]/[container].js +++ b/pages/finding-aids/entities/create/from-template/[template]/[container].js @@ -43,7 +43,6 @@ export default function FindingAidsCreateFromTemplate() { templateData['data']['uuid'] = data['uuid']; templateData['data']['archival_reference_code'] = data['archival_reference_code']; const tData = removeIDFromManyFields(templateData['data'], manyFieldList) - console.log(tData) return fillManyFields(tData, manyFieldList); }; From 7c0ab4d9d86900c591e258b1d2399e516918a887 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 18 Oct 2023 12:55:46 +0200 Subject: [PATCH 098/152] Add mm to the admin panel for the carrier types. --- components/Forms/fields/CarrierTypeForm.js | 6 +++--- pages/controlled-list/carrier-types/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/Forms/fields/CarrierTypeForm.js b/components/Forms/fields/CarrierTypeForm.js index 89a59f4..70c5789 100644 --- a/components/Forms/fields/CarrierTypeForm.js +++ b/components/Forms/fields/CarrierTypeForm.js @@ -15,17 +15,17 @@ export const CarrierTypeForm = ({readOnly}) => { - + - + - + diff --git a/pages/controlled-list/carrier-types/index.js b/pages/controlled-list/carrier-types/index.js index 0766515..9823376 100644 --- a/pages/controlled-list/carrier-types/index.js +++ b/pages/controlled-list/carrier-types/index.js @@ -26,17 +26,17 @@ export default function CarrierTypeList() { key: 'type_original_language', sorter: true }, { - title: 'Width', + title: 'Width (mm)', dataIndex: 'width', key: 'width', width: 100 }, { - title: 'Height', + title: 'Height (mm)', dataIndex: 'height', key: 'height', width: 100 }, { - title: 'Depth', + title: 'Depth (mm)', dataIndex: 'depth', key: 'depth', width: 100 From 5e95a2c68f1084b2eac33d35863335d736108db5 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 15 Nov 2023 16:31:02 +0100 Subject: [PATCH 099/152] Update DigitalVersionTab.js --- components/Forms/fields/finding_aids/DigitalVersionTab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index ee5fa01..d122a42 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -76,7 +76,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { let container = archivalReferenceCode.replaceAll(unit, '').split('/')[0] container = container.replaceAll(":", "").padStart(4, "0") - return `${unit.replaceAll(" ", "_")}-${container}`; + return `${unit.replaceAll(" ", "_")}_${container}`; } else { return '' } @@ -90,7 +90,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { container = container.replaceAll(":", "").padStart(4, "0") folder = folder.padStart(3, "0") - return `${unit.replaceAll(" ", "_")}-${container}-${folder}`; + return `${unit.replaceAll(" ", "_")}_${container}_${folder}`; } if (digitalVersionExists) { From b0f61f6421641ecf68fea3c8d14340733a07a88b Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 29 Nov 2023 12:22:23 +0100 Subject: [PATCH 100/152] Display email address --- components/Tables/RequestsTable.js | 15 ++++++++++++++- components/Tables/Table.module.scss | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index a6e91d4..b683a4f 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -52,9 +52,9 @@ const ResearchersTable = ({...props}) => { sorter: false, }, { title: 'Researcher', - dataIndex: 'researcher', key: 'request__researcher__last_name', width: 100, + render: (record) => renderResearcher(record), sorter: true, }, { title: 'Origin', @@ -111,6 +111,19 @@ const ResearchersTable = ({...props}) => { } + const renderResearcher = (record) => { + if (record['researcher_email']) { + return ( + <> +
{record['researcher']}
+
{record['researcher_email']}
+ + ) + } else { + return record['researcher'] + } + } + const renderActions = (record) => { const detectDisabled = () => { return record['status'] !== '1' && record['status'] !== '2' && record['status'] !== '3' diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index e4c8e77..c4b1bec 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -134,4 +134,8 @@ justify-content: center; align-items: center; } +} + +.Italic { + font-size: 12px; } \ No newline at end of file From 90baf8c9711717328bc39b7cdec24df586c338a0 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 7 Dec 2023 10:25:41 +0100 Subject: [PATCH 101/152] Update ResearcherForm.js --- components/Forms/fields/ResearcherForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/ResearcherForm.js b/components/Forms/fields/ResearcherForm.js index 6fc9d06..d1d8c31 100644 --- a/components/Forms/fields/ResearcherForm.js +++ b/components/Forms/fields/ResearcherForm.js @@ -55,13 +55,13 @@ export const ResearcherForm = ({form, readOnly}) => { - + - + - + Date: Thu, 18 Jan 2024 15:32:56 +0100 Subject: [PATCH 102/152] Update RequestsTable.js --- components/Tables/RequestsTable.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index b683a4f..657efa6 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -96,7 +96,16 @@ const ResearchersTable = ({...props}) => { const renderIdentifier = (record) => { if (record['item_origin'] === 'FA') { - return record['archival_reference_number'] + if (record['has_restricted_content']) { + return ( +
+
{record['archival_reference_number']}
+ +
+ ) + } else { + return record['archival_reference_number'] + } } else { return record['identifier'] } From c615e729aa7408a2104e4cb9e935b2ac6b1ab935 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 8 Feb 2024 11:57:48 +0100 Subject: [PATCH 103/152] Update FindingAidsTable.js --- components/Tables/FindingAidsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Tables/FindingAidsTable.js b/components/Tables/FindingAidsTable.js index 1e7e870..1f0fdf6 100644 --- a/components/Tables/FindingAidsTable.js +++ b/components/Tables/FindingAidsTable.js @@ -89,7 +89,7 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco const columns = [ { - title: 'Archiaval Reference Code', + title: 'Archival Reference Code', dataIndex: 'archival_reference_code', key: 'archival_reference_code', sorter: false, From ffc2b398cfe711ca42f22e581d13c98c2dfa0c81 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 31 May 2024 14:31:02 +0200 Subject: [PATCH 104/152] Updatez --- components/Tables/RequestsTable.js | 22 +++++++++++++++++++++- components/Tables/Table.module.scss | 9 +++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index 657efa6..669e988 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -44,6 +44,12 @@ const ResearchersTable = ({...props}) => { width: 130, render: (record) => renderIdentifier(record), sorter: true, + }, { + title: 'Folders / Items', + key: 'parts', + width: 130, + render: (record) => renderFoldersItems(record), + sorter: false, }, { title: 'MLR', key: 'mlr', @@ -71,7 +77,7 @@ const ResearchersTable = ({...props}) => { }, { title: 'Status', key: 'status', - width: 120, + width: 100, className: style.ActionColumn, render: (record) => renderStatus(record), sorter: false, @@ -175,6 +181,20 @@ const ResearchersTable = ({...props}) => { return record['mlr'] } + const renderFoldersItems = (record) => { + const renderRecords = () => ( + record['parts'].map(rec => { + return ( +
+ {rec['reference_code']} +
+ ) + }) + ) + + return renderRecords() + } + const renderStatus = (record) => { const generateBadges = (badgeText, color, withUndo=true) => { return ( diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index c4b1bec..4681d83 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -138,4 +138,13 @@ .Italic { font-size: 12px; +} + +.Restricted { + display: inline-block; + background-color: #e03c3c; + color: #FFF; + padding: 0 8px; + border-radius: 3px; + margin-bottom: 3px; } \ No newline at end of file From d4582709e33edc7f5657a81f59e0ebd8fc126505 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 24 Jun 2024 16:44:58 +0200 Subject: [PATCH 105/152] Update DigitalVersionTab.js --- components/Forms/fields/finding_aids/DigitalVersionTab.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index d122a42..f5d4d2a 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -76,7 +76,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { let container = archivalReferenceCode.replaceAll(unit, '').split('/')[0] container = container.replaceAll(":", "").padStart(4, "0") - return `${unit.replaceAll(" ", "_")}_${container}`; + return `${unit.replaceAll(" ", "_").replaceAll("-", "_")}_${container}`; } else { return '' } @@ -88,9 +88,9 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { let folder = archivalReferenceCode.replaceAll(unit, '').split('/')[1] container = container.replaceAll(":", "").padStart(4, "0") - folder = folder.padStart(3, "0") + folder = folder.padStart(4, "0") - return `${unit.replaceAll(" ", "_")}_${container}_${folder}`; + return `${unit.replaceAll(" ", "_").replaceAll("-", "_")}_${container}_${folder}`; } if (digitalVersionExists) { From 9cff18955eba21898697f4d51e97b3ca3f1d50f5 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 4 Jul 2024 09:42:25 +0200 Subject: [PATCH 106/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 76516fb..7ac7dae 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -760,24 +760,29 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, onActi { key: 'basic', label: 'Basic Metadata', + forceRender: true, children: isTemplate ? : }, { key: 'extra', label: 'Extra Metadata', + forceRender: true, children: }, { key: 'contributors', label: 'Contributors', + forceRender: true, children: }, { key: 'subjects', label: 'Subjects', + forceRender: true, children: }, { key: 'notes', label: 'Notes', + forceRender: true, children: } ] @@ -786,6 +791,7 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, onActi const digitalVersion = { key: 'digital_version', label: 'Digital Version', + forceRender: true, children: } From 19b15d2db62cc1871b8c4f9848b2de603ea02567 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 5 Jul 2024 12:56:05 +0200 Subject: [PATCH 107/152] Markdown Editor --- .../Forms/components/FormFormattedTextV3.js | 38 + .../FormFormattedTextV3.module.scss | 21 + .../Forms/fields/FindingAidsEntityForm.js | 5 +- next.config.js | 4 +- package.json | 3 + yarn.lock | 1783 ++++++++++++++++- 6 files changed, 1849 insertions(+), 5 deletions(-) create mode 100644 components/Forms/components/FormFormattedTextV3.js create mode 100644 components/Forms/components/FormFormattedTextV3.module.scss diff --git a/components/Forms/components/FormFormattedTextV3.js b/components/Forms/components/FormFormattedTextV3.js new file mode 100644 index 0000000..6e549ec --- /dev/null +++ b/components/Forms/components/FormFormattedTextV3.js @@ -0,0 +1,38 @@ +import 'suneditor/dist/css/suneditor.min.css'; +import React from "react"; +import style from "./FormFormattedTextV3.module.scss"; +import rehypeSanitize from "rehype-sanitize"; + +import dynamic from "next/dynamic"; +import "@uiw/react-md-editor/markdown-editor.css"; +import "@uiw/react-markdown-preview/markdown.css"; + +import * as commands from "@uiw/react-md-editor/commands" + +const MDEditor = dynamic( + () => import("@uiw/react-md-editor/nohighlight").then((mod) => mod.default), + { ssr: false } +) + +export const FormFormattedTextV3 = ({value, disabled=false, initialValue, ...props}) => { + return ( +
+ +
+ ) +}; diff --git a/components/Forms/components/FormFormattedTextV3.module.scss b/components/Forms/components/FormFormattedTextV3.module.scss new file mode 100644 index 0000000..92c0ae8 --- /dev/null +++ b/components/Forms/components/FormFormattedTextV3.module.scss @@ -0,0 +1,21 @@ +.FormattedTextArea { + :global .w-md-editor-toolbar { + border-radius: 1px; + height: 40px; + } + + :global .w-md-editor { + border-radius: 1px; + } + + :global .w-md-editor-preview { + background-color: #F7F7F7; + + :global .wmde-markdown { + background-color: #F7F7F7; + font-size: 14px !important; + line-height: 21px !important; + } + + } +} \ No newline at end of file diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 7ac7dae..39663fb 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -17,6 +17,7 @@ import DigitalVersionTab from "./finding_aids/DigitalVersionTab"; import FormDatePicker from "../components/FormDatePicker"; import dayjs from "dayjs"; import {Identifiers} from "./finding_aids/Identifiers"; +import {FormFormattedTextV3} from "../components/FormFormattedTextV3"; const L1_LEVELS = [ { id: 'F', level: 'Folders'}, @@ -241,7 +242,7 @@ const Tab01 = ({form, locale, readOnly}) => {
- + { label={renderLabelFlag(locale, 'Contents Summary - Original Language')} name="contents_summary_original" style={{marginBottom: 0}}> - + =2.14.0" +"@types/prismjs@^1.0.0": + version "1.26.4" + resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.26.4.tgz#1a9e1074619ce1d7322669e5b46fbe823925103a" + integrity sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg== + +"@types/unist@*", "@types/unist@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.2.tgz#6dd61e43ef60b34086287f83683a5c1b2dc53d20" + integrity sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ== + +"@types/unist@^2", "@types/unist@^2.0.0": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc" + integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA== + +"@uiw/copy-to-clipboard@~1.0.12": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@uiw/copy-to-clipboard/-/copy-to-clipboard-1.0.17.tgz#86f501ddc8a6db0b45e6899bcd9d48e0b78f233e" + integrity sha512-O2GUHV90Iw2VrSLVLK0OmNIMdZ5fgEg4NhvtwINsX+eZ/Wf6DWD0TdsK9xwV7dNRnK/UI2mQtl0a2/kRgm1m1A== + +"@uiw/react-markdown-preview@^5.0.6": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@uiw/react-markdown-preview/-/react-markdown-preview-5.1.2.tgz#9de14c85536dbf3858a895195ea13031d37da2d9" + integrity sha512-IheBzajVKZ3NUhYAfrnnereJmKVNQ6vRZDjQhKEQy7IMarJXrUKC1eG8OzTgy1J/3m67MBTs6d52kkSB699efA== + dependencies: + "@babel/runtime" "^7.17.2" + "@uiw/copy-to-clipboard" "~1.0.12" + react-markdown "~9.0.1" + rehype-attr "~3.0.1" + rehype-autolink-headings "~7.1.0" + rehype-ignore "^2.0.0" + rehype-prism-plus "2.0.0" + rehype-raw "^7.0.0" + rehype-rewrite "~4.0.0" + rehype-slug "~6.0.0" + remark-gfm "~4.0.0" + remark-github-blockquote-alert "^1.0.0" + unist-util-visit "^5.0.0" + +"@uiw/react-md-editor@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@uiw/react-md-editor/-/react-md-editor-4.0.4.tgz#142c42eb722035d60c1b71209e1d89b34d9fc4d4" + integrity sha512-JH9nDXXRhJtWPP4yE61VE+9ryFo9tg9v7KMwGfJCnaOOKuLF1MR3l/MNsiJCGkRjUwyto5WrU7kBSq8ODJEtYw== + dependencies: + "@babel/runtime" "^7.14.6" + "@uiw/react-markdown-preview" "^5.0.6" + rehype "~13.0.0" + rehype-prism-plus "~2.0.0" + +"@ungap/structured-clone@^1.0.0", "@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" resolved "https://registry.yarnpkg.com/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz#80224a6919272f405b87913ca13b92929bdf3c4d" integrity sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ== +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + +ajv@^8.0.0, ajv@^8.9.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" + integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== + dependencies: + fast-deep-equal "^3.1.3" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.4.1" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -434,6 +792,13 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + antd@^5.0.6: version "5.0.7" resolved "https://registry.yarnpkg.com/antd/-/antd-5.0.7.tgz#0c182ad33c9de81b204f4fa430d75480fad7e0d6" @@ -511,11 +876,34 @@ axios@^0.25.0: dependencies: follow-redirects "^1.14.7" +babel-loader@^9.1.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.3.tgz#3d0e01b4e69760cc694ee306fe16d358aa1c6f9a" + integrity sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw== + dependencies: + find-cache-dir "^4.0.0" + schema-utils "^4.0.0" + +babel-plugin-transform-remove-imports@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-imports/-/babel-plugin-transform-remove-imports-1.8.0.tgz#75b05d2167f8423807b71257158ff1d931eb6440" + integrity sha512-QdE5ZnIjON1pSgTPU8KzLnl/LEzdq9PLmZNuHgGKTx0LOI9PBrHBj0fz9uCg2CdssiTw7v/zVRYs8GJxbvhKnQ== + +bail@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" + integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +bcp-47-match@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/bcp-47-match/-/bcp-47-match-2.0.3.tgz#603226f6e5d3914a581408be33b28a53144b09d0" + integrity sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ== + bignumber.js@^8.0.1: version "8.1.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-8.1.1.tgz#4b072ae5aea9c20f6730e4e5d529df1271c4d885" @@ -526,6 +914,11 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -541,6 +934,16 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" +browserslist@^4.22.2: + version "4.23.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== + dependencies: + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" + node-releases "^2.0.14" + update-browserslist-db "^1.0.16" + call-bind@^1.0.0, call-bind@^1.0.2, call-bind@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -559,6 +962,16 @@ caniuse-lite@^1.0.30001406: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz#ab7371faeb4adff4b74dad1718a6fd122e45d9cb" integrity sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A== +caniuse-lite@^1.0.30001629: + version "1.0.30001640" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz#32c467d4bf1f1a0faa63fc793c2ba81169e7652f" + integrity sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA== + +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== + center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -578,6 +991,35 @@ chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +character-entities-html4@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" + integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== + +character-entities-legacy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" + integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== + +character-entities@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" + integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== + +character-reference-invalid@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" + integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== + chevrotain@^6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-6.5.0.tgz#dcbef415516b0af80fd423cc0d96b28d3f11374e" @@ -614,11 +1056,33 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + color-hash@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/color-hash/-/color-hash-2.0.2.tgz#abf735705da71874ddec7dcef50cd7479e7d64e9" integrity sha512-6exeENAqBTuIR1wIo36mR8xVVBv6l1hSLd7Qmvf6158Ld1L15/dbahR9VUOiX7GmGJBCnQyS0EY+I8x+wa7egg== +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +comma-separated-tokens@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" + integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== + +common-path-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" + integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== + compute-scroll-into-view@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-2.0.2.tgz#ac5cc71ca833884866e581a82d8558a6ed7ee877" @@ -634,6 +1098,11 @@ contour_plot@^0.0.1: resolved "https://registry.yarnpkg.com/contour_plot/-/contour_plot-0.0.1.tgz#475870f032b8e338412aa5fc507880f0bf495c77" integrity sha512-Nil2HI76Xux6sVGORvhSS8v66m+/h5CwFkBJDO+U5vWaMdNC0yXNCsGDPbzPhvqOEU5koebhdEvD372LI+IyLw== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + cookie@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" @@ -658,6 +1127,11 @@ css-in-js-utils@^3.1.0: dependencies: hyphenate-style-name "^1.0.3" +css-selector-parser@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-3.0.5.tgz#9b636ebccf7c4bcce5c1ac21ae27de9f01180ae9" + integrity sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g== + css-tree@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" @@ -708,11 +1182,25 @@ dayjs@^1.10.4, dayjs@^1.11.1: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== +debug@^4.0.0, debug@^4.1.0, debug@^4.3.1: + version "4.3.5" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + dependencies: + ms "2.1.2" + decamelize@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +decode-named-character-reference@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" + integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== + dependencies: + character-entities "^2.0.0" + deep-equal@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" @@ -738,11 +1226,28 @@ defined@~1.0.0: resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf" integrity sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q== +dequal@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + detect-browser@^5.0.0, detect-browser@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca" integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w== +devlop@^1.0.0, devlop@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" + integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== + dependencies: + dequal "^2.0.0" + +direction@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/direction/-/direction-2.0.1.tgz#71800dd3c4fa102406502905d3866e65bdebb985" + integrity sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA== + dom-align@^1.7.0: version "1.12.4" resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.4.tgz#3503992eb2a7cfcb2ed3b2a6d21e0b9c00d54511" @@ -793,6 +1298,11 @@ dotignore@~0.1.2: dependencies: minimatch "^3.0.4" +electron-to-chromium@^1.4.796: + version "1.4.816" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz#3624649d1e7fde5cdbadf59d31a524245d8ee85f" + integrity sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw== + entities@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" @@ -803,6 +1313,11 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + error-stack-parser@^2.0.6: version "2.1.4" resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286" @@ -850,11 +1365,31 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -escape-string-regexp@^1.0.2: +escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + +estree-util-is-identifier-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz#0b5ef4c4ff13508b34dcd01ecfa945f61fce5dbd" + integrity sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg== + +extend@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -887,6 +1422,22 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +find-cache-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2" + integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg== + dependencies: + common-path-prefix "^3.0.0" + pkg-dir "^7.0.0" + +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + fmin@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/fmin/-/fmin-0.0.2.tgz#59bbb40d43ffdc1c94cd00a568c41f95f1973017" @@ -940,6 +1491,11 @@ functions-have-names@^1.2.2: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" @@ -957,6 +1513,11 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +github-slugger@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-2.0.0.tgz#52cf2f9279a21eb6c59dd385b410f0c0adda8f1a" + integrity sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw== + gl-matrix@^3.0.0, gl-matrix@^3.3.0, gl-matrix@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.4.3.tgz#fc1191e8320009fd4d20e9339595c6041ddc22c9" @@ -981,6 +1542,11 @@ glob@~7.2.3: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + gopd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" @@ -1014,6 +1580,11 @@ has-bigints@^1.0.1, has-bigints@^1.0.2: resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + has-property-descriptors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" @@ -1040,6 +1611,215 @@ has@^1.0.3, has@~1.0.3: dependencies: function-bind "^1.1.1" +hast-util-from-html@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz#9cd38ee81bf40b2607368b92a04b0905fa987488" + integrity sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g== + dependencies: + "@types/hast" "^3.0.0" + devlop "^1.1.0" + hast-util-from-parse5 "^8.0.0" + parse5 "^7.0.0" + vfile "^6.0.0" + vfile-message "^4.0.0" + +hast-util-from-parse5@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz#654a5676a41211e14ee80d1b1758c399a0327651" + integrity sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + devlop "^1.0.0" + hastscript "^8.0.0" + property-information "^6.0.0" + vfile "^6.0.0" + vfile-location "^5.0.0" + web-namespaces "^2.0.0" + +hast-util-has-property@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz#4e595e3cddb8ce530ea92f6fc4111a818d8e7f93" + integrity sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-heading-rank@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz#2d5c6f2807a7af5c45f74e623498dd6054d2aba8" + integrity sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-is-element@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz#6e31a6532c217e5b533848c7e52c9d9369ca0932" + integrity sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-parse-selector@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz#25ab00ae9e75cbc62cf7a901f68a247eade659e2" + integrity sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA== + dependencies: + "@types/hast" "^2.0.0" + +hast-util-parse-selector@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz#352879fa86e25616036037dd8931fb5f34cb4a27" + integrity sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-raw@^9.0.0: + version "9.0.4" + resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-9.0.4.tgz#2da03e37c46eb1a6f1391f02f9b84ae65818f7ed" + integrity sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + "@ungap/structured-clone" "^1.0.0" + hast-util-from-parse5 "^8.0.0" + hast-util-to-parse5 "^8.0.0" + html-void-elements "^3.0.0" + mdast-util-to-hast "^13.0.0" + parse5 "^7.0.0" + unist-util-position "^5.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" + +hast-util-sanitize@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-5.0.1.tgz#8e90068cd68e651c569960b77a1b25076579b4cf" + integrity sha512-IGrgWLuip4O2nq5CugXy4GI2V8kx4sFVy5Hd4vF7AR2gxS0N9s7nEAVUyeMtZKZvzrxVsHt73XdTsno1tClIkQ== + dependencies: + "@types/hast" "^3.0.0" + "@ungap/structured-clone" "^1.2.0" + unist-util-position "^5.0.0" + +hast-util-select@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hast-util-select/-/hast-util-select-6.0.2.tgz#f1e6c583ab6227cb510383471328734342bd1d1c" + integrity sha512-hT/SD/d/Meu+iobvgkffo1QecV8WeKWxwsNMzcTJsKw1cKTQKSR/7ArJeURLNJF9HDjp9nVoORyNNJxrvBye8Q== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + bcp-47-match "^2.0.0" + comma-separated-tokens "^2.0.0" + css-selector-parser "^3.0.0" + devlop "^1.0.0" + direction "^2.0.0" + hast-util-has-property "^3.0.0" + hast-util-to-string "^3.0.0" + hast-util-whitespace "^3.0.0" + not "^0.1.0" + nth-check "^2.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + unist-util-visit "^5.0.0" + zwitch "^2.0.0" + +hast-util-to-html@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.1.tgz#d108aba473c0ced8377267b1a725b25e818ff3c8" + integrity sha512-hZOofyZANbyWo+9RP75xIDV/gq+OUKx+T46IlwERnKmfpwp81XBFbT9mi26ws+SJchA4RVUQwIBJpqEOBhMzEQ== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + ccount "^2.0.0" + comma-separated-tokens "^2.0.0" + hast-util-raw "^9.0.0" + hast-util-whitespace "^3.0.0" + html-void-elements "^3.0.0" + mdast-util-to-hast "^13.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + stringify-entities "^4.0.0" + zwitch "^2.0.4" + +hast-util-to-jsx-runtime@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.0.tgz#3ed27caf8dc175080117706bf7269404a0aa4f7c" + integrity sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ== + dependencies: + "@types/estree" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + comma-separated-tokens "^2.0.0" + devlop "^1.0.0" + estree-util-is-identifier-name "^3.0.0" + hast-util-whitespace "^3.0.0" + mdast-util-mdx-expression "^2.0.0" + mdast-util-mdx-jsx "^3.0.0" + mdast-util-mdxjs-esm "^2.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + style-to-object "^1.0.0" + unist-util-position "^5.0.0" + vfile-message "^4.0.0" + +hast-util-to-parse5@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz#477cd42d278d4f036bc2ea58586130f6f39ee6ed" + integrity sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw== + dependencies: + "@types/hast" "^3.0.0" + comma-separated-tokens "^2.0.0" + devlop "^1.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" + +hast-util-to-string@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-3.0.0.tgz#2a131948b4b1b26461a2c8ac876e2c88d02946bd" + integrity sha512-OGkAxX1Ua3cbcW6EJ5pT/tslVb90uViVkcJ4ZZIMW/R33DX/AkcJcRrPebPwJkHYwlDHXz4aIwvAAaAdtrACFA== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-whitespace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" + integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== + dependencies: + "@types/hast" "^3.0.0" + +hastscript@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-7.2.0.tgz#0eafb7afb153d047077fa2a833dc9b7ec604d10b" + integrity sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw== + dependencies: + "@types/hast" "^2.0.0" + comma-separated-tokens "^2.0.0" + hast-util-parse-selector "^3.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + +hastscript@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-8.0.0.tgz#4ef795ec8dee867101b9f23cc830d4baf4fd781a" + integrity sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw== + dependencies: + "@types/hast" "^3.0.0" + comma-separated-tokens "^2.0.0" + hast-util-parse-selector "^4.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + +html-url-attributes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-url-attributes/-/html-url-attributes-3.0.0.tgz#fc4abf0c3fb437e2329c678b80abb3c62cff6f08" + integrity sha512-/sXbVCWayk6GDVg3ctOX6nxaVj7So40FcFAnWlWGNAB1LpYKcV5Cd10APjPjW80O7zYW2MsjBV4zZ7IZO5fVow== + +html-void-elements@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" + integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== + htmlparser2@^3.9.0: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -1084,6 +1864,11 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.4: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inline-style-parser@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.2.3.tgz#e35c5fb45f3a83ed7849fe487336eb7efa25971c" + integrity sha512-qlD8YNDqyTKTyuITrDOffsl6Tdhv+UC4hcdAVuQsK4IMQ99nSgd1MIA/Q+jQYoh9r3hVUXhYh7urSRmXPkW04g== + inline-style-prefixer@^6.0.0: version "6.0.4" resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz#4290ed453ab0e4441583284ad86e41ad88384f44" @@ -1101,6 +1886,19 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +is-alphabetical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" + integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== + +is-alphanumerical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" + integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== + dependencies: + is-alphabetical "^2.0.0" + is-decimal "^2.0.0" + is-arguments@^1.0.4: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" @@ -1155,6 +1953,11 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-decimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" + integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1167,6 +1970,11 @@ is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hexadecimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" + integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== + is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -1184,6 +1992,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-plain-obj@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0" + integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg== + is-regex@^1.0.4, is-regex@^1.1.4, is-regex@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -1230,11 +2043,21 @@ js-cookie@^2.2.1: resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== -"js-tokens@^3.0.0 || ^4.0.0": +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json2module@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/json2module/-/json2module-0.0.3.tgz#00fb5f4a9b7adfc3f0647c29cb17bcd1979be9b2" @@ -1249,6 +2072,11 @@ json2mq@^0.2.0: dependencies: string-convert "^0.2.0" +json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -1261,11 +2089,23 @@ lazy-cache@^1.0.3: resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" integrity sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ== +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +longest-streak@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" + integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -1278,6 +2118,13 @@ loose-envify@^1.1.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -1285,11 +2132,469 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +markdown-table@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.3.tgz#e6331d30e493127e031dd385488b5bd326e4a6bd" + integrity sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw== + +mdast-util-find-and-replace@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz#a6fc7b62f0994e973490e45262e4bc07607b04e0" + integrity sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA== + dependencies: + "@types/mdast" "^4.0.0" + escape-string-regexp "^5.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + +mdast-util-from-markdown@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz#32a6e8f512b416e1f51eb817fc64bd867ebcd9cc" + integrity sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + mdast-util-to-string "^4.0.0" + micromark "^4.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-decode-string "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + unist-util-stringify-position "^4.0.0" + +mdast-util-gfm-autolink-literal@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz#5baf35407421310a08e68c15e5d8821e8898ba2a" + integrity sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg== + dependencies: + "@types/mdast" "^4.0.0" + ccount "^2.0.0" + devlop "^1.0.0" + mdast-util-find-and-replace "^3.0.0" + micromark-util-character "^2.0.0" + +mdast-util-gfm-footnote@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz#25a1753c7d16db8bfd53cd84fe50562bd1e6d6a9" + integrity sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.1.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + +mdast-util-gfm-strikethrough@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz#d44ef9e8ed283ac8c1165ab0d0dfd058c2764c16" + integrity sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm-table@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz#7a435fb6223a72b0862b33afbd712b6dae878d38" + integrity sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + markdown-table "^3.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm-task-list-item@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz#e68095d2f8a4303ef24094ab642e1047b991a936" + integrity sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ== + dependencies: + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-gfm@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz#3f2aecc879785c3cb6a81ff3a243dc11eca61095" + integrity sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw== + dependencies: + mdast-util-from-markdown "^2.0.0" + mdast-util-gfm-autolink-literal "^2.0.0" + mdast-util-gfm-footnote "^2.0.0" + mdast-util-gfm-strikethrough "^2.0.0" + mdast-util-gfm-table "^2.0.0" + mdast-util-gfm-task-list-item "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-mdx-expression@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz#4968b73724d320a379110d853e943a501bfd9d87" + integrity sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-mdx-jsx@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.2.tgz#daae777c72f9c4a106592e3025aa50fb26068e1b" + integrity sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + ccount "^2.0.0" + devlop "^1.1.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + parse-entities "^4.0.0" + stringify-entities "^4.0.0" + unist-util-remove-position "^5.0.0" + unist-util-stringify-position "^4.0.0" + vfile-message "^4.0.0" + +mdast-util-mdxjs-esm@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz#019cfbe757ad62dd557db35a695e7314bcc9fa97" + integrity sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-phrasing@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3" + integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w== + dependencies: + "@types/mdast" "^4.0.0" + unist-util-is "^6.0.0" + +mdast-util-to-hast@^13.0.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4" + integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA== + dependencies: + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + "@ungap/structured-clone" "^1.0.0" + devlop "^1.0.0" + micromark-util-sanitize-uri "^2.0.0" + trim-lines "^3.0.0" + unist-util-position "^5.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + +mdast-util-to-markdown@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz#9813f1d6e0cdaac7c244ec8c6dabfdb2102ea2b4" + integrity sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + longest-streak "^3.0.0" + mdast-util-phrasing "^4.0.0" + mdast-util-to-string "^4.0.0" + micromark-util-decode-string "^2.0.0" + unist-util-visit "^5.0.0" + zwitch "^2.0.0" + +mdast-util-to-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz#7a5121475556a04e7eddeb67b264aae79d312814" + integrity sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg== + dependencies: + "@types/mdast" "^4.0.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== +micromark-core-commonmark@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz#9a45510557d068605c6e9a80f282b2bb8581e43d" + integrity sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA== + dependencies: + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-factory-destination "^2.0.0" + micromark-factory-label "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-factory-title "^2.0.0" + micromark-factory-whitespace "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-html-tag-name "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-autolink-literal@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz#f1e50b42e67d441528f39a67133eddde2bbabfd9" + integrity sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-footnote@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz#91afad310065a94b636ab1e9dab2c60d1aab953c" + integrity sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg== + dependencies: + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-strikethrough@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz#6917db8e320da70e39ffbf97abdbff83e6783e61" + integrity sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-table@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz#2cf3fe352d9e089b7ef5fff003bdfe0da29649b7" + integrity sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm-tagfilter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz#f26d8a7807b5985fba13cf61465b58ca5ff7dc57" + integrity sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg== + dependencies: + micromark-util-types "^2.0.0" + +micromark-extension-gfm-task-list-item@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz#ee8b208f1ced1eb9fb11c19a23666e59d86d4838" + integrity sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw== + dependencies: + devlop "^1.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-extension-gfm@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz#3e13376ab95dd7a5cfd0e29560dfe999657b3c5b" + integrity sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w== + dependencies: + micromark-extension-gfm-autolink-literal "^2.0.0" + micromark-extension-gfm-footnote "^2.0.0" + micromark-extension-gfm-strikethrough "^2.0.0" + micromark-extension-gfm-table "^2.0.0" + micromark-extension-gfm-tagfilter "^2.0.0" + micromark-extension-gfm-task-list-item "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-destination@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz#857c94debd2c873cba34e0445ab26b74f6a6ec07" + integrity sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-label@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz#17c5c2e66ce39ad6f4fc4cbf40d972f9096f726a" + integrity sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw== + dependencies: + devlop "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-space@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz#5e7afd5929c23b96566d0e1ae018ae4fcf81d030" + integrity sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-title@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz#726140fc77892af524705d689e1cf06c8a83ea95" + integrity sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-whitespace@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz#9e92eb0f5468083381f923d9653632b3cfb5f763" + integrity sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-character@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.0.tgz#31320ace16b4644316f6bf057531689c71e2aee1" + integrity sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ== + dependencies: + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-chunked@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz#e51f4db85fb203a79dbfef23fd41b2f03dc2ef89" + integrity sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-classify-character@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz#8c7537c20d0750b12df31f86e976d1d951165f34" + integrity sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-combine-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz#75d6ab65c58b7403616db8d6b31315013bfb7ee5" + integrity sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ== + dependencies: + micromark-util-chunked "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-decode-numeric-character-reference@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz#2698bbb38f2a9ba6310e359f99fcb2b35a0d2bd5" + integrity sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-decode-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz#7dfa3a63c45aecaa17824e656bcdb01f9737154a" + integrity sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz#0921ac7953dc3f1fd281e3d1932decfdb9382ab1" + integrity sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA== + +micromark-util-html-tag-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz#ae34b01cbe063363847670284c6255bb12138ec4" + integrity sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw== + +micromark-util-normalize-identifier@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz#91f9a4e65fe66cc80c53b35b0254ad67aa431d8b" + integrity sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-resolve-all@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz#189656e7e1a53d0c86a38a652b284a252389f364" + integrity sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA== + dependencies: + micromark-util-types "^2.0.0" + +micromark-util-sanitize-uri@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz#ec8fbf0258e9e6d8f13d9e4770f9be64342673de" + integrity sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-subtokenize@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz#76129c49ac65da6e479c09d0ec4b5f29ec6eace5" + integrity sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-symbol@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz#12225c8f95edf8b17254e47080ce0862d5db8044" + integrity sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw== + +micromark-util-types@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.0.tgz#63b4b7ffeb35d3ecf50d1ca20e68fc7caa36d95e" + integrity sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w== + +micromark@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-4.0.0.tgz#84746a249ebd904d9658cfabc1e8e5f32cbc6249" + integrity sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ== + dependencies: + "@types/debug" "^4.0.0" + debug "^4.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -1307,6 +2612,11 @@ moment@2.29.4, moment@>=2.14.0: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + nano-css@^5.3.1: version "5.3.5" resolved "https://registry.yarnpkg.com/nano-css/-/nano-css-5.3.5.tgz#3075ea29ffdeb0c7cb6d25edb21d8f7fa8e8fe8e" @@ -1341,6 +2651,15 @@ next-auth@^4.18.4: preact-render-to-string "^5.1.19" uuid "^8.3.2" +next-remove-imports@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/next-remove-imports/-/next-remove-imports-1.0.12.tgz#30be38374121ff8fc7734ab2d437fc77291931b0" + integrity sha512-3tdL6VuSykJ/mcUwxfjQ+Fd4OpEmrwWVHtLZ/fhNcSaToWCutUp7nrfIww7/4CURe9I7BDCQE9AWl4fkY3YZOQ== + dependencies: + "@babel/core" "^7.22.9" + babel-loader "^9.1.3" + babel-plugin-transform-remove-imports "^1.7.0" + next@12.3.4: version "12.3.4" resolved "https://registry.yarnpkg.com/next/-/next-12.3.4.tgz#f2780a6ebbf367e071ce67e24bd8a6e05de2fcb1" @@ -1367,11 +2686,28 @@ next@12.3.4: "@next/swc-win32-ia32-msvc" "12.3.4" "@next/swc-win32-x64-msvc" "12.3.4" +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +not@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/not/-/not-0.1.0.tgz#c9691c1746c55dcfbe54cbd8bd4ff041bc2b519d" + integrity sha512-5PDmaAsVfnWUgTUbJ3ERwn7u79Z0dYxN9ErxCpVJJqe2RK0PJ3z+iFUxuqjwtlDDegXvtWoxD/3Fzxox7tFGWA== + +nth-check@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== + dependencies: + boolbase "^1.0.0" + numbro@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/numbro/-/numbro-2.1.2.tgz#2d51104f09b5d69aef7e15bb565d7795e47ecfd6" @@ -1444,6 +2780,51 @@ openid-client@^5.1.0: object-hash "^2.0.1" oidc-token-hash "^5.0.1" +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + +parse-entities@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.1.tgz#4e2a01111fb1c986549b944af39eeda258fc9e4e" + integrity sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w== + dependencies: + "@types/unist" "^2.0.0" + character-entities "^2.0.0" + character-entities-legacy "^3.0.0" + character-reference-invalid "^2.0.0" + decode-named-character-reference "^1.0.0" + is-alphanumerical "^2.0.0" + is-decimal "^2.0.0" + is-hexadecimal "^2.0.0" + +parse-numeric-range@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz#7c63b61190d61e4d53a1197f0c83c47bb670ffa3" + integrity sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ== + +parse5@^7.0.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1464,6 +2845,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -1474,6 +2860,13 @@ pikaday@1.8.2: resolved "https://registry.yarnpkg.com/pikaday/-/pikaday-1.8.2.tgz#72cc73fab7ccc068cbdf7dcaa1ce400fcfd894e3" integrity sha512-TNtsE+34BIax3WtkB/qqu5uepV1McKYEgvL3kWzU7aqPCpMEN6rBF3AOwu4WCwAealWlBGobXny/9kJb49C1ew== +pkg-dir@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11" + integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA== + dependencies: + find-up "^6.3.0" + postcss@8.4.14: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" @@ -1500,6 +2893,16 @@ pretty-format@^3.8.0: resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew== +property-information@^6.0.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.5.0.tgz#6212fbb52ba757e92ef4fb9d657563b933b7ffec" + integrity sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig== + +punycode@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + rc-align@^4.0.0: version "4.0.12" resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.12.tgz#065b5c68a1cc92a00800c9239320d9fdf5f16207" @@ -1907,6 +3310,22 @@ react-json-view-lite@^0.9.2: resolved "https://registry.yarnpkg.com/react-json-view-lite/-/react-json-view-lite-0.9.4.tgz#a7c6c66c6c8e73e130618b2e9cacf34044060638" integrity sha512-gKc1lvyRa8cjtlqw/m6+PF5jsyNMCgjjtktZaUUIyV0rsZRiZK+jGExepXJDeRq1Z7IuYNd0sc5LyTnm9R28uA== +react-markdown@~9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-9.0.1.tgz#c05ddbff67fd3b3f839f8c648e6fb35d022397d1" + integrity sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg== + dependencies: + "@types/hast" "^3.0.0" + devlop "^1.0.0" + hast-util-to-jsx-runtime "^2.0.0" + html-url-attributes "^3.0.0" + mdast-util-to-hast "^13.0.0" + remark-parse "^11.0.0" + remark-rehype "^11.0.0" + unified "^11.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + react-universal-interface@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b" @@ -1956,11 +3375,26 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +refractor@^4.8.0: + version "4.8.1" + resolved "https://registry.yarnpkg.com/refractor/-/refractor-4.8.1.tgz#fbdd889333a3d86c9c864479622855c9b38e9d42" + integrity sha512-/fk5sI0iTgFYlmVGYVew90AoYnNMP6pooClx/XKqyeeCQXrL0Kvgn8V0VEht5ccdljbzzF1i3Q213gcntkRExg== + dependencies: + "@types/hast" "^2.0.0" + "@types/prismjs" "^1.0.0" + hastscript "^7.0.0" + parse-entities "^4.0.0" + regenerator-runtime@^0.13.11: version "0.13.11" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + regexp-to-ast@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/regexp-to-ast/-/regexp-to-ast-0.4.0.tgz#f3dbcb42726cd71902ba50193f63eab5325cd7cb" @@ -1975,11 +3409,171 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" +rehype-attr@~3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/rehype-attr/-/rehype-attr-3.0.3.tgz#36b9c3d2bd91708f0c56080bc3005cba60dec4a7" + integrity sha512-Up50Xfra8tyxnkJdCzLBIBtxOcB2M1xdeKe1324U06RAvSjYm7ULSeoM+b/nYPQPVd7jsXJ9+39IG1WAJPXONw== + dependencies: + unified "~11.0.0" + unist-util-visit "~5.0.0" + +rehype-autolink-headings@~7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/rehype-autolink-headings/-/rehype-autolink-headings-7.1.0.tgz#531087e155d9df053944923efd47d99728f3b196" + integrity sha512-rItO/pSdvnvsP4QRB1pmPiNHUskikqtPojZKJPPPAVx9Hj8i8TwMBhofrrAYRhYOOBZH9tgmG5lPqDLuIWPWmw== + dependencies: + "@types/hast" "^3.0.0" + "@ungap/structured-clone" "^1.0.0" + hast-util-heading-rank "^3.0.0" + hast-util-is-element "^3.0.0" + unified "^11.0.0" + unist-util-visit "^5.0.0" + +rehype-ignore@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/rehype-ignore/-/rehype-ignore-2.0.2.tgz#1212335d3c8bd86422c15d4a4e5afaabc0488802" + integrity sha512-BpAT/3lU9DMJ2siYVD/dSR0A/zQgD6Fb+fxkJd4j+wDVy6TYbYpK+FZqu8eM9EuNKGvi4BJR7XTZ/+zF02Dq8w== + dependencies: + hast-util-select "^6.0.0" + unified "^11.0.0" + unist-util-visit "^5.0.0" + +rehype-parse@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-9.0.0.tgz#3949faeec6f466ec57774215661e0d75469195d9" + integrity sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw== + dependencies: + "@types/hast" "^3.0.0" + hast-util-from-html "^2.0.0" + unified "^11.0.0" + +rehype-prism-plus@2.0.0, rehype-prism-plus@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/rehype-prism-plus/-/rehype-prism-plus-2.0.0.tgz#75b1e2d0dd7496125987a1732cb7d560de02a0fd" + integrity sha512-FeM/9V2N7EvDZVdR2dqhAzlw5YI49m9Tgn7ZrYJeYHIahM6gcXpH0K1y2gNnKanZCydOMluJvX2cB9z3lhY8XQ== + dependencies: + hast-util-to-string "^3.0.0" + parse-numeric-range "^1.3.0" + refractor "^4.8.0" + rehype-parse "^9.0.0" + unist-util-filter "^5.0.0" + unist-util-visit "^5.0.0" + +rehype-raw@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/rehype-raw/-/rehype-raw-7.0.0.tgz#59d7348fd5dbef3807bbaa1d443efd2dd85ecee4" + integrity sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww== + dependencies: + "@types/hast" "^3.0.0" + hast-util-raw "^9.0.0" + vfile "^6.0.0" + +rehype-rewrite@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/rehype-rewrite/-/rehype-rewrite-4.0.2.tgz#7b094bb586dfda83333994cb3dbb01cb1e8c361d" + integrity sha512-rjLJ3z6fIV11phwCqHp/KRo8xuUCO8o9bFJCNw5o6O2wlLk6g8r323aRswdGBQwfXPFYeSuZdAjp4tzo6RGqEg== + dependencies: + hast-util-select "^6.0.0" + unified "^11.0.3" + unist-util-visit "^5.0.0" + +rehype-sanitize@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/rehype-sanitize/-/rehype-sanitize-6.0.0.tgz#16e95f4a67a69cbf0f79e113c8e0df48203db73c" + integrity sha512-CsnhKNsyI8Tub6L4sm5ZFsme4puGfc6pYylvXo1AeqaGbjOYyzNv3qZPwvs0oMJ39eryyeOdmxwUIo94IpEhqg== + dependencies: + "@types/hast" "^3.0.0" + hast-util-sanitize "^5.0.0" + +rehype-slug@~6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/rehype-slug/-/rehype-slug-6.0.0.tgz#1d21cf7fc8a83ef874d873c15e6adaee6344eaf1" + integrity sha512-lWyvf/jwu+oS5+hL5eClVd3hNdmwM1kAC0BUvEGD19pajQMIzcNUd/k9GsfQ+FfECvX+JE+e9/btsKH0EjJT6A== + dependencies: + "@types/hast" "^3.0.0" + github-slugger "^2.0.0" + hast-util-heading-rank "^3.0.0" + hast-util-to-string "^3.0.0" + unist-util-visit "^5.0.0" + +rehype-stringify@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/rehype-stringify/-/rehype-stringify-10.0.0.tgz#2031cf6fdd0355393706f0474ec794c75e5492f2" + integrity sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ== + dependencies: + "@types/hast" "^3.0.0" + hast-util-to-html "^9.0.0" + unified "^11.0.0" + +rehype@~13.0.0: + version "13.0.1" + resolved "https://registry.yarnpkg.com/rehype/-/rehype-13.0.1.tgz#56384ba83955e2f3aa7eca1975b406c67d9dbd5e" + integrity sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg== + dependencies: + "@types/hast" "^3.0.0" + rehype-parse "^9.0.0" + rehype-stringify "^10.0.0" + unified "^11.0.0" + +remark-gfm@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-4.0.0.tgz#aea777f0744701aa288b67d28c43565c7e8c35de" + integrity sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-gfm "^3.0.0" + micromark-extension-gfm "^3.0.0" + remark-parse "^11.0.0" + remark-stringify "^11.0.0" + unified "^11.0.0" + +remark-github-blockquote-alert@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/remark-github-blockquote-alert/-/remark-github-blockquote-alert-1.2.1.tgz#adb58d7fb57e96bc5a53674167f130029d1cb3c0" + integrity sha512-qNf2mSAoZgh3Cl23/9Y1L7S4Kbf9NsdHvYK398ab/52yEsDPDU5I4cuTcgDRrdIX7Ltc6RK+KCLRtWkbFnL6Dg== + dependencies: + unist-util-visit "^5.0.0" + +remark-parse@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-11.0.0.tgz#aa60743fcb37ebf6b069204eb4da304e40db45a1" + integrity sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-from-markdown "^2.0.0" + micromark-util-types "^2.0.0" + unified "^11.0.0" + +remark-rehype@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-11.1.0.tgz#d5f264f42bcbd4d300f030975609d01a1697ccdc" + integrity sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g== + dependencies: + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + mdast-util-to-hast "^13.0.0" + unified "^11.0.0" + vfile "^6.0.0" + +remark-stringify@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-11.0.0.tgz#4c5b01dd711c269df1aaae11743eb7e2e7636fd3" + integrity sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-to-markdown "^2.0.0" + unified "^11.0.0" + repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + resize-observer-polyfill@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" @@ -2060,6 +3654,16 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" +schema-utils@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" + screenfull@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba" @@ -2072,6 +3676,11 @@ scroll-into-view-if-needed@^3.0.3: dependencies: compute-scroll-into-view "^2.0.2" +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + set-harmonic-interval@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-harmonic-interval/-/set-harmonic-interval-1.0.1.tgz#e1773705539cdfb80ce1c3d99e7f298bb3995249" @@ -2135,6 +3744,11 @@ sourcemap-codec@^1.4.8: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== +space-separated-tokens@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" + integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== + stack-generator@^2.0.5: version "2.0.10" resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-2.0.10.tgz#8ae171e985ed62287d4f1ed55a1633b3fb53bb4d" @@ -2203,6 +3817,14 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +stringify-entities@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3" + integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg== + dependencies: + character-entities-html4 "^2.0.0" + character-entities-legacy "^3.0.0" + strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -2210,6 +3832,13 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" +style-to-object@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.6.tgz#0c28aed8be1813d166c60d962719b2907c26547b" + integrity sha512-khxq+Qm3xEyZfKd/y9L3oIWQimxuc4STrQKtQn8aSDRHb8mFgpukgX1hdzfrMEW6JCjyJ8p89x+IUMVnCBI1PA== + dependencies: + inline-style-parser "0.2.3" + styled-jsx@5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.7.tgz#be44afc53771b983769ac654d355ca8d019dff48" @@ -2235,6 +3864,13 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -2281,6 +3917,11 @@ tiny-emitter@^2.1.0: resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423" integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q== +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -2293,6 +3934,16 @@ toggle-selection@^1.0.6: resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== +trim-lines@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" + integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== + +trough@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f" + integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw== + ts-easing@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/ts-easing/-/ts-easing-0.2.0.tgz#c8a8a35025105566588d87dbda05dd7fbfa5a4ec" @@ -2333,11 +3984,94 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +unified@^11.0.0, unified@^11.0.3, unified@~11.0.0: + version "11.0.5" + resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1" + integrity sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA== + dependencies: + "@types/unist" "^3.0.0" + bail "^2.0.0" + devlop "^1.0.0" + extend "^3.0.0" + is-plain-obj "^4.0.0" + trough "^2.0.0" + vfile "^6.0.0" + +unist-util-filter@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/unist-util-filter/-/unist-util-filter-5.0.1.tgz#f9f3a0bdee007e040964c274dda27bac663d0a39" + integrity sha512-pHx7D4Zt6+TsfwylH9+lYhBhzyhEnCXs/lbq/Hstxno5z4gVdyc2WEW0asfjGKPyG4pEKrnBv5hdkO6+aRnQJw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + +unist-util-is@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" + integrity sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw== + dependencies: + "@types/unist" "^3.0.0" + +unist-util-position@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4" + integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA== + dependencies: + "@types/unist" "^3.0.0" + +unist-util-remove-position@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz#fea68a25658409c9460408bc6b4991b965b52163" + integrity sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q== + dependencies: + "@types/unist" "^3.0.0" + unist-util-visit "^5.0.0" + +unist-util-stringify-position@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2" + integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ== + dependencies: + "@types/unist" "^3.0.0" + +unist-util-visit-parents@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" + integrity sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + +unist-util-visit@^5.0.0, unist-util-visit@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" + integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + unorm@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== +update-browserslist-db@^1.0.16: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + +uri-js@^4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + use-sync-external-store@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" @@ -2353,6 +4087,36 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +vfile-location@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-5.0.2.tgz#220d9ca1ab6f8b2504a4db398f7ebc149f9cb464" + integrity sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg== + dependencies: + "@types/unist" "^3.0.0" + vfile "^6.0.0" + +vfile-message@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.2.tgz#c883c9f677c72c166362fd635f21fc165a7d1181" + integrity sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-stringify-position "^4.0.0" + +vfile@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.1.tgz#1e8327f41eac91947d4fe9d237a2dd9209762536" + integrity sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-stringify-position "^4.0.0" + vfile-message "^4.0.0" + +web-namespaces@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" + integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -2379,6 +4143,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" @@ -2393,3 +4162,13 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" + +yocto-queue@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110" + integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g== + +zwitch@^2.0.0, zwitch@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== From a3abcc6a8b7a9ec5ea011e52f763b9bcf7c8be34 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 31 Jul 2024 23:24:57 +0200 Subject: [PATCH 108/152] Markdown Editors --- .../Forms/fields/FindingAidsEntityForm.js | 21 +++++++++---------- .../fields/FindingAidsEntityQuickForm.js | 6 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 39663fb..a19aaba 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -3,7 +3,6 @@ import {Badge, Button, Checkbox, Col, DatePicker, Form, Input, Row, Space, Tabs} import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; -import {FormFormattedText} from "../components/FormFormattedText"; import {Dates} from "./finding_aids/Dates"; import {Languages} from "./finding_aids/Languages"; import {Extents} from "./finding_aids/Extents"; @@ -460,14 +459,14 @@ const Tab01Template = ({form, locale, readOnly, type}) => { - + - + @@ -550,12 +549,12 @@ const Tab02 = ({form, locale, readOnly}) => { - + - + { label={renderLabelFlag(locale, 'Physical Description - Original Language')} name="physical_description_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, 'Language Statement - Original Language')} name="language_statement_original" style={{marginBottom: 0}}> - + ( - + ( label={renderLabelFlag(locale, 'Note - Original Language')} name="note_original" style={{marginBottom: 0}}> - + ( - + diff --git a/components/Forms/fields/FindingAidsEntityQuickForm.js b/components/Forms/fields/FindingAidsEntityQuickForm.js index 5551c7c..38c1c62 100644 --- a/components/Forms/fields/FindingAidsEntityQuickForm.js +++ b/components/Forms/fields/FindingAidsEntityQuickForm.js @@ -3,7 +3,7 @@ import {Button, Col, Form, Input, Row, Space} from "antd"; import FormSelect from "../components/FormSelect"; import FormRemoteSelect from "../components/FormRemoteSelect"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; -import {FormFormattedText} from "../components/FormFormattedText"; +import {FormFormattedTextV3} from "../components/FormFormattedTextV3"; import FormTranslateButton from "../components/FormTranslateButton"; import FormDatePicker from "../components/FormDatePicker"; import dayjs from "dayjs"; @@ -197,7 +197,7 @@ export const FindingAidsEntityQuickForm = ({form, locale, type}) => { - + { label={renderLabelFlag(locale, 'Contents Summary - Original Language')} name="contents_summary_original" style={{marginBottom: 0}}> - + Date: Wed, 28 Aug 2024 10:05:55 +0200 Subject: [PATCH 109/152] Update IsadForm.js --- components/Forms/fields/IsadForm.js | 41 +++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index bd34716..e93519e 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -11,6 +11,7 @@ import {RelatedFindingAids} from "./isad/RelatedFindingAids"; import {LocationOfOriginals} from "./isad/LocationOfOriginals"; import {LocationOfCopies} from "./isad/LocationOfCopies"; import FormTranslateButton from "../components/FormTranslateButton"; +import {FormFormattedTextV3} from "../components/FormFormattedTextV3"; const ACCRUALS = [ { id: true, accrual: 'Expected'}, @@ -172,7 +173,7 @@ const Tab02 = ({form, locale, readOnly}) => { - + { label={renderLabelFlag(locale, 'Estimated amount of carriers - Original language')} name="carrier_estimated_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.2.2 Administrative history - Original language')} name="administrative_history_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.2.3 Archival history - Original language')} name="archival_history_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.3.1 Scope and content (abstract) - Original Language')} name="scope_and_content_abstract_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.3.1 Scope and content (narrative) - Original Language')} name="scope_and_content_narrative_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.3.2 Appraisal - Original language')} name="appraisal_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.3.4 System of arrangement information - Original language')} name="system_of_arrangement_information_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.4.4 Physical characteristics and technical requirements - Original language')} name="physical_characteristics_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.5.4 Publication note - Original Language')} name="publication_note_original" style={{marginBottom: 0}}> - + { - + { label={renderLabelFlag(locale, '3.6.1 Note - Original language')} name="note_original" style={{marginBottom: 0}}> - + Date: Wed, 28 Aug 2024 10:23:57 +0200 Subject: [PATCH 110/152] Update IsadForm.js --- components/Forms/fields/IsadForm.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/Forms/fields/IsadForm.js b/components/Forms/fields/IsadForm.js index e93519e..b9356a4 100644 --- a/components/Forms/fields/IsadForm.js +++ b/components/Forms/fields/IsadForm.js @@ -6,7 +6,6 @@ import {Creators} from "./isad/Creators"; import {FormRemoteSelectWithEdit} from "../components/FormRemoteSelectWithEdit"; import {renderLabelFlag} from "../../../utils/functions/renderLabelFlag"; import {Extents} from "./isad/Extents"; -import {FormFormattedText} from "../components/FormFormattedText"; import {RelatedFindingAids} from "./isad/RelatedFindingAids"; import {LocationOfOriginals} from "./isad/LocationOfOriginals"; import {LocationOfCopies} from "./isad/LocationOfCopies"; From f88335bd9410c9f62e5850e66a704244eb7225df Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 26 Sep 2024 11:32:28 +0200 Subject: [PATCH 111/152] Update ContainerForm.js --- components/Forms/fields/ContainerForm.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/Forms/fields/ContainerForm.js b/components/Forms/fields/ContainerForm.js index 8c5b54b..1890bc6 100644 --- a/components/Forms/fields/ContainerForm.js +++ b/components/Forms/fields/ContainerForm.js @@ -52,6 +52,11 @@ export const ContainerForm = ({form, readOnly}) => { + + + + + From b76743df7cbac34af4e9ac4c3083180b0f3955cd Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 10 Oct 2024 16:20:05 +0200 Subject: [PATCH 112/152] Update FindingAidsGrid.js --- components/Grids/FindingAidsGrid.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/Grids/FindingAidsGrid.js b/components/Grids/FindingAidsGrid.js index e662f09..276dde2 100644 --- a/components/Grids/FindingAidsGrid.js +++ b/components/Grids/FindingAidsGrid.js @@ -43,6 +43,7 @@ const FindingAidsGrid = ({seriesID}) => { const columns = [ {data: 'archival_reference_code', label: 'Archival Reference Code', readOnly: true, width: 200}, + {data: 'legacy_id', label: 'Legacy ID', width: 150}, {data: 'title', label: 'Title', width: 300}, {data: 'title_original', label: 'Title (Original)', width: 300}, {data: 'original_locale', label: 'Locale', width: 100, type: 'dropdown', source: getLocales}, From 079e0f44ce13f3a82f694d32ea9bc93bf859bfbc Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 14 Oct 2024 23:39:08 +0200 Subject: [PATCH 113/152] Update FindingAidsEntityForm.js --- components/Forms/fields/FindingAidsEntityForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index a19aaba..9d375e6 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -660,9 +660,9 @@ const Tab04 = ({form, readOnly}) => ( - + Date: Fri, 25 Oct 2024 14:08:48 +0200 Subject: [PATCH 114/152] Update PopupForm.js --- components/Forms/PopupForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 63ffe4d..ee14904 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -78,7 +78,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel case 'donors': return ; case 'isaar': - return ; + return {}} />; case 'barcode': return ; case 'container': From 66184100535c3d8bc0bf55a1dbd55faa7eaebb90 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 18 Nov 2024 18:48:52 +0100 Subject: [PATCH 115/152] AuditLog display --- components/Forms/PopupForm.js | 2 + components/Forms/SimpleFormFooter.js | 2 + components/Forms/auditLog/AuditLog.js | 68 +++++++++++ .../Forms/auditLog/AuditLog.module.scss | 0 .../Grids/components/FormattedTextEditor.js | 114 ++++++++++++++++++ 5 files changed, 186 insertions(+) create mode 100644 components/Forms/auditLog/AuditLog.js create mode 100644 components/Forms/auditLog/AuditLog.module.scss create mode 100644 components/Grids/components/FormattedTextEditor.js diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index ee14904..1217c43 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -28,6 +28,7 @@ import {DigitizationForm} from "./fields/DigitizationForm"; import {RequestsForm} from "./fields/RequestsForm"; import {RequestItemForm} from "./fields/RequestsItemForm"; import {NationalityForm} from "./fields/NationalityForm"; +import AuditLog from "./auditLog/AuditLog"; export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, onClose}) => { const afterFinish = () => { @@ -213,6 +214,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel {data['date_updated']} {data['user_updated'] ? ` by '${data['user_updated']}'` : ''}

+ diff --git a/components/Forms/SimpleFormFooter.js b/components/Forms/SimpleFormFooter.js index 0eab350..bfd9261 100644 --- a/components/Forms/SimpleFormFooter.js +++ b/components/Forms/SimpleFormFooter.js @@ -3,6 +3,7 @@ import style from "./Forms.module.css"; import React, {useState} from "react"; import {useRouter} from "next/router"; import Collapse from "@kunukn/react-collapse"; +import AuditLog from "./auditLog/AuditLog"; export const SimpleFormFooter = ({form, type, loading, module}) => { const router = useRouter(); @@ -53,6 +54,7 @@ export const SimpleFormFooter = ({form, type, loading, module}) => { {form.getFieldValue('date_updated')} {form.getFieldValue('user_updated') ? ` by '${form.getFieldValue('user_updated')}'` : ''}

+ diff --git a/components/Forms/auditLog/AuditLog.js b/components/Forms/auditLog/AuditLog.js new file mode 100644 index 0000000..5968831 --- /dev/null +++ b/components/Forms/auditLog/AuditLog.js @@ -0,0 +1,68 @@ +import React from "react"; +import {useData} from "../../../utils/hooks/useData"; +import moment from "moment"; + +const AuditLog = ({module, object_id}) => { + const getParams = () => { + let model = '' + + if (module.includes('finding-aids/container')) { + model ='FindingAidsEntity' + } else { + switch(module) { + case 'accessions': + model = 'Accession' + break; + case 'donor': + model = 'Donor' + break; + case 'isad': + model = 'Isad' + break; + case 'isaar': + model = 'Isaar' + break; + case 'container': + model = 'Container' + break; + } + } + + return { + model_name: model, + object_id: object_id + } + } + const { data, error } = useData(`/v1/audit_log/`, getParams()); + + const renderLogs = () => { + if (data.length > 0) { + return ( +
    + { + data.map(d => { + return
  • + {moment(d.timestamp).format('YYYY-MM-DD hh:mm:ss')} | [{d.action}] by {d.user}{d.changed_fields && <> | Fields: {d.changed_fields.join(', ')}} +
  • + }) + } +
+ ) + } + } + + if (data && data.length > 0) { + return ( + <> +
+ {`Audit Log (from 2024. November 18th):`} + {renderLogs()} + + ) + } else { + return '' + } + +} + +export default AuditLog; \ No newline at end of file diff --git a/components/Forms/auditLog/AuditLog.module.scss b/components/Forms/auditLog/AuditLog.module.scss new file mode 100644 index 0000000..e69de29 diff --git a/components/Grids/components/FormattedTextEditor.js b/components/Grids/components/FormattedTextEditor.js new file mode 100644 index 0000000..1b12979 --- /dev/null +++ b/components/Grids/components/FormattedTextEditor.js @@ -0,0 +1,114 @@ +import Handsontable from 'handsontable'; +import Quill from 'quill'; + +class FormattedTextEditor extends Handsontable.editors.TextEditor { + init() { + this.offsetLeft; + this.offsetTop; + this.editor; + this.isOpen = false; + this.isMoveWindow = false; + + this.quillWidth = 400; + this.quillHeight = 100; + } + + prepare(row, col, prop, TD, originalValue, cellProperties) { + this.TD = TD; + this.row = row; + this.col = col; + this.prop = prop; + this.originalValue = originalValue; + this.cellProperties = cellProperties; + this.state = 'STATE_VIRGIN'; + + super.prepare(row, col, prop, TD, originalValue, cellProperties); + + if (this.editableDiv) return; + + this.editableDiv = document.createElement('div'); + this.editableDiv.innerHTML = originalValue; + this.TEXTAREA_PARENT.className += ' quillEditor'; + this.TEXTAREA_PARENT.appendChild(this.editableDiv); + this.TEXTAREA_PARENT.style.width = this.quillWidth + 'px'; + this.TEXTAREA_PARENT.style.height = this.quillHeight + 'px'; + this.TEXTAREA_PARENT.style.display = 'none'; + + this.quill = new Quill(this.editableDiv, { + theme: 'snow', + modules: { + toolbar: [ + ['bold', 'strike', 'clean'], + [{'color': []}], + ], + }, + }); + + const that = this; + + this.quill.root.addEventListener('keydown', function(event) { + if (!this.isOpen) return; + + if (event.keyCode === 13 && !event.shiftKey) { + event.stopImmediatePropagation(); + that.finishEditing(false, false); + that.close(); + } else if (event.keyCode === 27) { + event.stopImmediatePropagation(); + that.finishEditing(true, false); + that.close(); + } + }); + + this.instance._registerTimeout(setTimeout(function() { + that.refreshDimensions(); + }, 0)); + } + + open(keyboardEvent) { + this.isOpen = true; + + this.refreshDimensions(); + + if (keyboardEvent) { + this.setValue(this.TD.innerHTML); + } + + const that = this; + + setTimeout(function() { + const toolbar = document.getElementsByClassName('ql-toolbar')[0]; + const editor = toolbar.parentNode; + editor.style.top = that.TD.offsetTop + that.TD.offsetHeight + 'px'; + editor.style.left = that.TD.offsetLeft + 'px'; + editor.style.display = ''; + + toolbar.onmousedown = function(event) { + this.offsetLeft = event.clientX - parseInt(editor.style.left); + this.offsetTop = event.clientY - parseInt(editor.style.top); + document.addEventListener('mousemove', onMouseMove); + }; + toolbar.onmouseup = function(event) { + document.removeEventListener('mousemove', onMouseMove); + if (this.isMoveWindow) { + this.isMoveWindow = false; + that.quill.setSelection(0, 0); + } + }; + + that.quill.setText(''); + that.quill.pasteHTML(0, that.TD.innerHTML); + // Set focus; + that.quill.setSelection(0, 0); + }, 1); + } + + close() { + this.isOpen = false; + this.instance.listen(); + this.TEXTAREA_PARENT.display = 'none'; + this.close.apply(this, arguments); + } +} + +export default FormattedTextEditor; \ No newline at end of file From bc9f05cd13378609b4a1950936ddcbf6222f18e7 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 18 Nov 2024 20:16:07 +0100 Subject: [PATCH 116/152] Update AuditLog.js --- components/Forms/auditLog/AuditLog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/auditLog/AuditLog.js b/components/Forms/auditLog/AuditLog.js index 5968831..82d0d4d 100644 --- a/components/Forms/auditLog/AuditLog.js +++ b/components/Forms/auditLog/AuditLog.js @@ -42,7 +42,7 @@ const AuditLog = ({module, object_id}) => { { data.map(d => { return
  • - {moment(d.timestamp).format('YYYY-MM-DD hh:mm:ss')} | [{d.action}] by {d.user}{d.changed_fields && <> | Fields: {d.changed_fields.join(', ')}} + {moment(d.timestamp).format('YYYY-MM-DD HH:mm:ss')} | [{d.action}] by {d.user}{d.changed_fields && <> | Fields: {d.changed_fields.join(', ')}}
  • }) } From ba76d50c6879377a451ce2d933521fca572d8674 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 12 Dec 2024 16:23:23 +0100 Subject: [PATCH 117/152] MLR display --- components/Tables/RequestsTable.js | 10 ++++++++++ components/Tables/components/LibraryMLRInfo.js | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 components/Tables/components/LibraryMLRInfo.js diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index 669e988..87eb70e 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -15,6 +15,7 @@ import moment from "moment"; import {PopupForm} from "../Forms/PopupForm"; import _ from 'lodash'; import {AiOutlineLoading} from "react-icons/ai"; +import LibraryMLRInfo from "./components/LibraryMLRInfo"; const ORIGIN = { @@ -178,6 +179,15 @@ const ResearchersTable = ({...props}) => { ) } + + if (record['library_id']) { + return ( +
    + +
    + ) + } + return record['mlr'] } diff --git a/components/Tables/components/LibraryMLRInfo.js b/components/Tables/components/LibraryMLRInfo.js new file mode 100644 index 0000000..6609989 --- /dev/null +++ b/components/Tables/components/LibraryMLRInfo.js @@ -0,0 +1,13 @@ +import {useData} from "../../../utils/hooks/useData"; + +const LibraryMLRInfo = ({kohaID}) => { + const { data, loading } = useData(kohaID ? `/v1/research/requests/library/mlr/${kohaID}` : undefined); + + console.log(data) + + return ( + data ?
    {data}
    : '' + ) +} + +export default LibraryMLRInfo; \ No newline at end of file From 7f71e7a2f518268793667f7a7409575327041bb5 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 13 Dec 2024 11:22:05 +0100 Subject: [PATCH 118/152] Update LibraryMLRInfo.js --- components/Tables/components/LibraryMLRInfo.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/Tables/components/LibraryMLRInfo.js b/components/Tables/components/LibraryMLRInfo.js index 6609989..d4067ad 100644 --- a/components/Tables/components/LibraryMLRInfo.js +++ b/components/Tables/components/LibraryMLRInfo.js @@ -3,8 +3,6 @@ import {useData} from "../../../utils/hooks/useData"; const LibraryMLRInfo = ({kohaID}) => { const { data, loading } = useData(kohaID ? `/v1/research/requests/library/mlr/${kohaID}` : undefined); - console.log(data) - return ( data ?
    {data}
    : '' ) From 86bc7afb98f9508d09044f24dbe2e6f0635239fb Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 13 Dec 2024 11:22:07 +0100 Subject: [PATCH 119/152] Update index.js --- pages/researchers-db/requests/print/index.js | 38 +++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/pages/researchers-db/requests/print/index.js b/pages/researchers-db/requests/print/index.js index 2b233c0..91222a3 100644 --- a/pages/researchers-db/requests/print/index.js +++ b/pages/researchers-db/requests/print/index.js @@ -3,12 +3,11 @@ import React from "react"; import {useData} from "../../../../utils/hooks/useData"; import style from "./PrintStyle.module.scss"; import moment from "moment"; +import LibraryMLRInfo from "../../../../components/Tables/components/LibraryMLRInfo"; export default function RequestsPrint() { const { data, loading, refresh} = useData(`/v1/research/requests/print`, {}); - - const renderRequestsForDay = (date, idx) => { const requestsForDay = data.filter(d => d['request_date'] === date) const requestDay = moment(date).format('YYYY-MM-DD, dddd') @@ -18,7 +17,7 @@ export default function RequestsPrint() { case 'FA': return data['archival_reference_number'] case 'L': - return 'Library' + return data['identifier'] case 'FL': return 'Film Library' } @@ -29,7 +28,36 @@ export default function RequestsPrint() { case 'FA': return data['carrier_type'] case 'L': - return 'Book' + if (data['quantity']) { + return 'Continuing Resource' + } else { + return 'Book' + } + case 'FL': + return 'Film Library Movie' + } + } + + const renderMLR = data => { + switch (data['item_origin']) { + case 'FA': + return data['mlr'] + case 'L': + if (data['quantity']) { + return ( +
    + {data['title']} / {data['quantity']} + +
    + ) + } else { + return ( +
    + {data['title']} + +
    + ) + } case 'FL': return 'Film Library Movie' } @@ -53,7 +81,7 @@ export default function RequestsPrint() { return (
    - + From a07f7bb873d2334bf98d1d882bc68e887bd4dd36 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Jan 2025 09:53:32 +0100 Subject: [PATCH 120/152] Logo Update --- components/Login/Login.module.css | 6 +++--- pages/_app.js | 1 - pages/auth/login.js | 2 +- public/images/archivum_logo.svg | 29 +++++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 public/images/archivum_logo.svg diff --git a/components/Login/Login.module.css b/components/Login/Login.module.css index 0b59b49..56a1c3e 100644 --- a/components/Login/Login.module.css +++ b/components/Login/Login.module.css @@ -28,10 +28,10 @@ .Logo { text-align: center; - margin-top: 10px; - margin-bottom: 30px; + margin-top: 30px; + margin-bottom: 50px; } .Logo img { - width: 150px; + width: 200px; } diff --git a/pages/_app.js b/pages/_app.js index aa2f376..5b00943 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -9,7 +9,6 @@ import {UserContext, UserProvider} from "../utils/context/UserContext"; import {useRouter} from "next/router"; import Index401 from "./index401"; import {allowedGroups} from "../utils/config/allowedGroups"; -import _ from 'lodash'; const themeOptions = { token: { diff --git a/pages/auth/login.js b/pages/auth/login.js index bb56171..d27d57d 100644 --- a/pages/auth/login.js +++ b/pages/auth/login.js @@ -24,7 +24,7 @@ const Login = () => {
    - Logo + Logo
    ClockWork AMS diff --git a/public/images/archivum_logo.svg b/public/images/archivum_logo.svg new file mode 100644 index 0000000..199799f --- /dev/null +++ b/public/images/archivum_logo.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From cfeffbbd300cbaa12c3e4c7293a820cb0e0f919b Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Jan 2025 11:16:56 +0100 Subject: [PATCH 121/152] Update [container].js --- .../entities/create/from-template/[template]/[container].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/finding-aids/entities/create/from-template/[template]/[container].js b/pages/finding-aids/entities/create/from-template/[template]/[container].js index ceede59..4fee6e0 100644 --- a/pages/finding-aids/entities/create/from-template/[template]/[container].js +++ b/pages/finding-aids/entities/create/from-template/[template]/[container].js @@ -37,7 +37,7 @@ export default function FindingAidsCreateFromTemplate() { const generateInitialData = () => { templateData['data']['description_level'] = data['description_level']; - templateData['data']['level'] = data['level']; + // templateData['data']['level'] = data['level']; templateData['data']['container_id'] = data['container_id']; templateData['data']['folder_no'] = data['folder_no']; templateData['data']['uuid'] = data['uuid']; From 5012202a38fd9e5d3ecb03a560becb7a737adb45 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 9 Jan 2025 17:57:23 +0100 Subject: [PATCH 122/152] Restricted Requests menu --- components/Layout/config/config-menu.js | 3 +- components/Tables/RequestsTable.js | 57 +++++--- components/Tables/RestrictedRequestsTable.js | 128 ++++++++++++++++++ components/Tables/Table.module.scss | 1 - components/Tables/TableFilters.js | 3 + .../filters/RestrictedRequestsTableFilter.js | 52 +++++++ pages/_app.js | 10 +- .../researchers-db/restricted-access/index.js | 26 ++++ utils/config/allowedGroups.js | 2 +- 9 files changed, 259 insertions(+), 23 deletions(-) create mode 100644 components/Tables/RestrictedRequestsTable.js create mode 100644 components/Tables/filters/RestrictedRequestsTableFilter.js create mode 100644 pages/researchers-db/restricted-access/index.js diff --git a/components/Layout/config/config-menu.js b/components/Layout/config/config-menu.js index ea22aea..0257806 100644 --- a/components/Layout/config/config-menu.js +++ b/components/Layout/config/config-menu.js @@ -5,7 +5,7 @@ import { DashboardOutlined, ApartmentOutlined, UserOutlined, ProfileOutlined, Fi import { IoSchoolOutline } from "react-icons/io5" import { MdOutlineScanner } from "react-icons/md" import { BsInboxes, BsBoxArrowInLeft } from "react-icons/bs" -import { FaExchangeAlt } from "react-icons/fa" +import { FaExchangeAlt, FaExclamation } from "react-icons/fa" import { HiOutlineLibrary } from "react-icons/hi" import { BiPieChartAlt2 } from "react-icons/bi" import { ImCopy } from "react-icons/im" @@ -59,6 +59,7 @@ const configMenu = [ {name: 'Researcher Visits', icon: , group: ['Research'], link: '/researchers-db/visits'}, {name: 'Researcher Statistics', icon: , group: ['Research'], link: '/researchers-db/stats'}, {name: 'Requests', icon: , group: ['Research'], link: '/researchers-db/requests'}, + {name: 'Restricted Access Man.', icon: , group: ['Restricted Decision Makers'], link: '/researchers-db/restricted-access'}, ]} ]; diff --git a/components/Tables/RequestsTable.js b/components/Tables/RequestsTable.js index 87eb70e..56c3b0c 100644 --- a/components/Tables/RequestsTable.js +++ b/components/Tables/RequestsTable.js @@ -145,23 +145,27 @@ const ResearchersTable = ({...props}) => { return record['status'] !== '1' && record['status'] !== '2' && record['status'] !== '3' } - return ( - - -
    {renderIdentifier(request)}{request['mlr']}{renderMLR(request)} {renderType(request)} {request['researcher']}
    record.id} + dataSource={data ? data.results : []} + columns={columns} + size={'small'} + loading={{ + spinning: loading, + indicator: , + }} + pagination={tableState['pagination']} + onChange={handleTableChange} + /> + + ) +}; + +export default RestrictedRequestsTable; diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index 4681d83..1fcb517 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -142,7 +142,6 @@ .Restricted { display: inline-block; - background-color: #e03c3c; color: #FFF; padding: 0 8px; border-radius: 3px; diff --git a/components/Tables/TableFilters.js b/components/Tables/TableFilters.js index a70560c..963b386 100644 --- a/components/Tables/TableFilters.js +++ b/components/Tables/TableFilters.js @@ -12,6 +12,7 @@ import ResearcherTableFilter from "./filters/ResearchTableFilter"; import ResearchersVisitsTableFilter from "./filters/ResearchersVisitsTableFilter"; import RequestsTableFilter from "./filters/RequestsTableFilter"; import DigitizationFindingAidsTableFilter from "./filters/DigitizationFindingAidsTableFilter"; +import RestrictedRequestsTableFilter from "./filters/RestrictedRequestsTableFilter"; const TableFilters = ({onFilterChange, module, filters, ...props}) => { const renderFilters = () => { @@ -36,6 +37,8 @@ const TableFilters = ({onFilterChange, module, filters, ...props}) => { return case 'requests': return + case 'restricted-requests': + return default: return ; } diff --git a/components/Tables/filters/RestrictedRequestsTableFilter.js b/components/Tables/filters/RestrictedRequestsTableFilter.js new file mode 100644 index 0000000..1d15c92 --- /dev/null +++ b/components/Tables/filters/RestrictedRequestsTableFilter.js @@ -0,0 +1,52 @@ +import React, {useState} from "react"; +import {Form, Col, Row, Select, Button} from "antd"; +import FormRemoteSelect from "../../Forms/components/FormRemoteSelect"; +import FormRadioGroup from "../../Forms/components/FormRadioGroup"; +import FormFilterSearchInput from "./components/FormFilterSearchInput"; +import style from "../TableFilters.module.css"; + +const STATUSES = [ + { value: 'new', label: 'New'}, + { value: 'approved', label: 'Approved'}, + { value: 'rejected', label: 'Rejected'}, + { value: 'lifted', label: 'Lifted'}, +] + +const RestrictedRequestsTableFilter = () => { + return ( + + + + + + + + + + From 91c1b9a17094726ae084fca69365260bee8d3dfc Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 14 Nov 2025 17:22:59 +0100 Subject: [PATCH 134/152] Related Finding Aids in People --- components/Forms/PopupForm.js | 2 +- .../Forms/components/FormDuplications.js | 75 +++++++++++++++++++ .../components/FormDuplications.module.scss | 3 + pages/authority-list/people/index.js | 9 ++- utils/renders/renderFACount.js | 25 +++++++ utils/renders/renderSimilarity.js | 41 ++++++++++ 6 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 components/Forms/components/FormDuplications.js create mode 100644 components/Forms/components/FormDuplications.module.scss create mode 100644 utils/renders/renderFACount.js create mode 100644 utils/renders/renderSimilarity.js diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 1217c43..01b3797 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -61,7 +61,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel case 'languages': return ; case 'people': - return ; + return ; case 'places': return ; case 'subjects': diff --git a/components/Forms/components/FormDuplications.js b/components/Forms/components/FormDuplications.js new file mode 100644 index 0000000..0ad112e --- /dev/null +++ b/components/Forms/components/FormDuplications.js @@ -0,0 +1,75 @@ +import React, {useEffect, useState} from "react"; +import {get} from "../../../utils/api"; +import style from "./FormDuplications.module.scss"; +import {LoadingOutlined} from "@ant-design/icons"; +import {Table} from "antd"; +import {renderURL} from "../../../utils/renders/renderURL"; +import {renderWikidataURL} from "../../../utils/renders/renderWikidataURL"; +import {renderSimilarity} from "../../../utils/renders/renderSimilarity"; + + +const FormDuplications = ({api}) => { + const [loading, setLoading] = useState(true); + const [data, setData] = useState([]); + + const columns = [ + { + title: 'Name', + dataIndex: 'name', + key: 'name', + sorter: false, + }, { + title: 'Similarity', + width: 150, + dataIndex: 'similarity_percent', + key: 'similarity_percent', + sorter: false, + render: renderSimilarity + }, { + title: 'Authority URL', + dataIndex: 'authority_url', + key: 'authority_url', + sorter: false, + render: renderURL + }, { + title: 'Wikidata', + dataIndex: 'wikidata_id', + key: 'wikidata_id', + sorter: false, + render: renderWikidataURL + }, { + title: 'Wikidata', + dataIndex: 'wikidata_id', + key: 'wikidata_id', + sorter: false, + render: renderWikidataURL + }, + ]; + + useEffect(() => { + get(api).then(response => { + setLoading(false); + setData(response.data) + }).catch(error => { + setData(undefined); + setLoading(false); + }) + }, []) + + return ( +
    record.id} + dataSource={data ? data : []} + columns={columns} + size={'small'} + loading={{ + spinning: loading, + indicator: , + }} + /> + ) +} + +export default FormDuplications; \ No newline at end of file diff --git a/components/Forms/components/FormDuplications.module.scss b/components/Forms/components/FormDuplications.module.scss new file mode 100644 index 0000000..5d25a9a --- /dev/null +++ b/components/Forms/components/FormDuplications.module.scss @@ -0,0 +1,3 @@ +.Table { + margin: 16px 0; +} \ No newline at end of file diff --git a/pages/authority-list/people/index.js b/pages/authority-list/people/index.js index e2ee1a3..d83cf8d 100644 --- a/pages/authority-list/people/index.js +++ b/pages/authority-list/people/index.js @@ -6,6 +6,7 @@ import {Card} from "antd"; import PopupTable from "../../../components/Tables/PopupTable"; import {renderURL} from "../../../utils/renders/renderURL"; import {renderWikidataURL} from "../../../utils/renders/renderWikidataURL"; +import {renderFACount} from "../../../utils/renders/renderFACount"; export default function PersonList() { const breadcrumbData = [ @@ -31,7 +32,13 @@ export default function PersonList() { key: 'wikidata_id', sorter: false, render: renderWikidataURL - } + }, { + title: 'Appears in Finding Aids', + key: 'fa_total_count', + dataIndex: 'fa_total_count', + sorter: true, + width: 200 + }, ]; return ( diff --git a/utils/renders/renderFACount.js b/utils/renders/renderFACount.js new file mode 100644 index 0000000..1aa041e --- /dev/null +++ b/utils/renders/renderFACount.js @@ -0,0 +1,25 @@ +import React from "react"; + +export const renderFACount = (text, record, index) => { + if (record['fa_subject_count'] === 0 || record['fa_subject_count'] === 0) { + if (record['fa_subject_count'] === 0) { + return ( +
    +
    {record['fa_associated_count']} (as Associated)
    +
    + ) + } else { + return ( +
    +
    {record['fa_subject_count']} (as Subject)
    +
    + ) + } + } else { + return ( +
    +
    {record['fa_subject_count'] > 0 && `${record['fa_subject_count']} (as Subject) |`} {record['fa_associated_count']} (as Associated)
    +
    + ) + } +}; diff --git a/utils/renders/renderSimilarity.js b/utils/renders/renderSimilarity.js new file mode 100644 index 0000000..2392aaa --- /dev/null +++ b/utils/renders/renderSimilarity.js @@ -0,0 +1,41 @@ +import React from "react"; +import {Badge} from "antd"; + +export const renderSimilarity = (text, record, index) => { +// utils/color.ts + const getScoreColor = (value) => { + const red = "#ba3300"; + const orange = { r: 250, g: 140, b: 22 }; // #fa8c16 + const green = { r: 55, g: 110, b: 24 }; // #376e18 + + if (value <= 30) { + return red; + } + + if (value >= 75) { + return `rgb(${green.r}, ${green.g}, ${green.b})`; + } + + // interpolate only between 31–75 + const ratio = (value - 31) / (75 - 31); + + const r = Math.round(orange.r + (green.r - orange.r) * ratio); + const g = Math.round(orange.g + (green.g - orange.g) * ratio); + const b = Math.round(orange.b + (green.b - orange.b) * ratio); + + return `rgb(${r}, ${g}, ${b})`; + }; + + + return ( + + ); +}; From f08f8ea68fd4695b1909d54e5b08fde2261fc0f7 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 21 Nov 2025 15:46:28 +0100 Subject: [PATCH 135/152] Fixing the entity creation actions on the FindingAidsEntity form. --- components/Forms/PopupForm.js | 4 +- .../components/FormRemoteSelectWithEdit.js | 287 +++++++++++------- utils/hooks/useForm.js | 6 +- 3 files changed, 179 insertions(+), 118 deletions(-) diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 01b3797..84dd8f8 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -31,8 +31,8 @@ import {NationalityForm} from "./fields/NationalityForm"; import AuditLog from "./auditLog/AuditLog"; export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, onClose}) => { - const afterFinish = () => { - onClose(); + const afterFinish = (data) => { + onClose(data); }; const {form, formLoading, errors, onFinish, renderErrors, onValuesChange} = diff --git a/components/Forms/components/FormRemoteSelectWithEdit.js b/components/Forms/components/FormRemoteSelectWithEdit.js index 2c34f18..097103d 100644 --- a/components/Forms/components/FormRemoteSelectWithEdit.js +++ b/components/Forms/components/FormRemoteSelectWithEdit.js @@ -1,122 +1,183 @@ import React, {useEffect, useState} from "react"; -import { EditOutlined, PlusOutlined } from '@ant-design/icons'; -import {Button, Drawer, Input, Select} from 'antd'; +import {EditOutlined, PlusOutlined} from "@ant-design/icons"; +import {Button, Drawer, Input, Select} from "antd"; import _ from "lodash"; import {PopupForm} from "../PopupForm"; import {useData} from "../../../utils/hooks/useData"; const {Option} = Select; -export const FormRemoteSelectWithEdit = ( - { api, fieldName, module, selectAPI, selectAPIParams={}, valueField, labelField, onChange, placeholder, - disabled=false, form, mode='default', ...props }) => { - const [params, setParams] = useState(selectAPIParams); - const [selectData, setSelectData] = useState([]); - const [drawerShown, setDrawerShown] = useState(false); - const [action, setAction] = useState('create'); - const [selectedRecord, setSelectedRecord] = useState({}); - - const {data, loading, refresh} = useData(selectAPI, params); - - useEffect(() => { - data && setSelectData(data) - }, [data]); - - const handleSearch = (value) => { - if (value.length > 2 || value.length === 0) { - setParams(prevParams => ({ - ...prevParams, - search: value - })) - } - }; - - const handleSelect = (value) => { - if (params.hasOwnProperty('search') && params['search'] !== "") { - setParams(prevParams => ({ - ...prevParams, - search: '' - })); - } - onChange(value) - }; - - const handleClear = () => { - onChange(undefined); - }; - - const selectOptions = selectData.map(d => ( - - )); - - const openForm = (action) => { - setAction(action); - setSelectedRecord(action === 'edit' ? props.value : undefined); - setDrawerShown(true); - }; - - const onClose = (id) => { - refresh(); - if (id) { - form.setFieldsValue({[fieldName]: id}) - } - setDrawerShown(false); - }; - - return ( - - - - { - mode !== 'multiple' && - +export const FormRemoteSelectWithEdit = ({ + api, + fieldName, + module, + selectAPI, + selectAPIParams = {}, + valueField, + labelField, + onChange, + placeholder, + disabled = false, + form, + mode = "default", + ...props + }) => { + const [params, setParams] = useState(selectAPIParams); + const [selectData, setSelectData] = useState([]); + const [drawerShown, setDrawerShown] = useState(false); + const [action, setAction] = useState("create"); + const [selectedRecord, setSelectedRecord] = useState(null); + + const {data, loading, refresh} = useData(selectAPI, params); + + // Load initial data + useEffect(() => { + if (data) setSelectData(data); + }, [data]); + + const handleSearch = (value) => { + setParams((prev) => ({ + ...prev, + search: value.length > 2 ? value : "" + })); + }; + + const handleSelect = (value) => { + // Clear search after selecting + if (params.search) { + setParams((p) => ({...p, search: ""})); + } + onChange(value); + }; + + const handleClear = () => onChange(undefined); + + const openForm = (type) => { + setAction(type); + setSelectedRecord(type === "edit" ? props.value : null); + setDrawerShown(true); + }; + + /** + * onClose(record) + * record = newly created or edited record object + */ + const onClose = (record) => { + setDrawerShown(false); + + if (record) { + const newOption = { + [valueField]: record[valueField], + [labelField]: record[labelField], + }; + + // Add or update option optimistically + setSelectData((prev) => + _.uniqBy([newOption, ...prev], valueField) + ); + + if (mode === "multiple") { + // CURRENT values may come from props or the form + const currentValues = + props.value ?? + form.getFieldValue(fieldName) ?? + []; + + const updatedValues = _.uniq([ + ...currentValues, + record[valueField] + ]); + + form.setFieldsValue({[fieldName]: updatedValues}); + onChange && onChange(updatedValues); + } else { + // SINGLE SELECT + form.setFieldsValue({[fieldName]: record[valueField]}); + onChange && onChange(record[valueField]); + } + } + + // Sync with the server in the background + refresh(); + }; + + const getMessageText = () => { + switch (module) { + case 'places': + return 'Place'; + case 'people': + return 'Person'; + case 'corporations': + return 'Corporation'; + case 'keywords': + return 'Keyword'; + default: + return 'The'; } - - - onClose()} - open={drawerShown} - destroyOnClose={true} - > - - - - ) + } + + return ( + <> + + + + {/* EDIT BUTTON */} + {mode !== "multiple" && ( + + )} + + {/* CREATE BUTTON */} + + + + onClose()} + open={drawerShown} + destroyOnClose + > + + + + ); }; diff --git a/utils/hooks/useForm.js b/utils/hooks/useForm.js index fa7d86c..0390294 100644 --- a/utils/hooks/useForm.js +++ b/utils/hooks/useForm.js @@ -25,7 +25,7 @@ export const useForm = (api, formType, messageText, afterFinish, afterValuesChan description: `${messageText} record was updated!`, }); setFormLoading(false); - afterFinish && afterFinish() + afterFinish && afterFinish(response.data) }).catch(error => { handleError(error); }); @@ -38,7 +38,7 @@ export const useForm = (api, formType, messageText, afterFinish, afterValuesChan description: `'${messageText}' record was updated!`, }); setFormLoading(false); - afterFinish && afterFinish() + afterFinish && afterFinish(response.data) }).catch(error => { handleError(error); }); @@ -51,7 +51,7 @@ export const useForm = (api, formType, messageText, afterFinish, afterValuesChan description: `${messageText} record was created!`, }); setFormLoading(false); - afterFinish() + afterFinish && afterFinish(response.data) }).catch(error => { handleError(error); }); From 6658a05914c40136c795268cc3f4ed7b2dca59e4 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 21 Nov 2025 16:23:54 +0100 Subject: [PATCH 136/152] Update DigitizationContainerList.js --- .../Digitization/DigitizationContainerList.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/components/Digitization/DigitizationContainerList.js b/components/Digitization/DigitizationContainerList.js index e60f652..fb0c448 100644 --- a/components/Digitization/DigitizationContainerList.js +++ b/components/Digitization/DigitizationContainerList.js @@ -3,8 +3,13 @@ import {Card} from "antd"; import PopupTable from "../../components/Tables/PopupTable"; import {renderDigitalVersion} from "../../utils/renders/renderDigitalVersion"; import {renderDigitalVersionResearchCloud} from "../../utils/renders/renderDigitalVersionResearchCloud"; +import moment from "moment/moment"; export default function DigitizationContainerList() { + const renderDate = (data) => { + return (moment(data).format('YYYY-MM-DD')) + } + const columns = [ { title: 'Container No.', @@ -18,6 +23,14 @@ export default function DigitizationContainerList() { key: 'barcode', width: 150, sorter: true + }, { + title: 'Date Updated', + dataIndex: 'date_updated', + key: 'date_updated', + width: 150, + className: 'centerColumn', + render: renderDate, + sorter: true }, { title: 'Digital Version', dataIndex: 'digital_version_exists', @@ -42,7 +55,7 @@ export default function DigitizationContainerList() { sorter: true, render: renderDigitalVersion }, { - title: 'Creation Date', + title: 'Creation Date (Digital)', dataIndex: 'digital_version_creation_date', key: 'digital_version_creation_date', className: 'centerColumn', From 2b570ab0c89f7e57582665f1986e02072d017ff8 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 24 Nov 2025 11:08:37 +0100 Subject: [PATCH 137/152] Add link to the containers on the Digitization Log. --- .../Digitization/DigitizationContainerList.js | 15 ++++++++++----- .../DigitizationContainerList.module.scss | 9 +++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 components/Digitization/DigitizationContainerList.module.scss diff --git a/components/Digitization/DigitizationContainerList.js b/components/Digitization/DigitizationContainerList.js index fb0c448..661740f 100644 --- a/components/Digitization/DigitizationContainerList.js +++ b/components/Digitization/DigitizationContainerList.js @@ -1,21 +1,26 @@ import React from 'react' -import {Card} from "antd"; import PopupTable from "../../components/Tables/PopupTable"; import {renderDigitalVersion} from "../../utils/renders/renderDigitalVersion"; import {renderDigitalVersionResearchCloud} from "../../utils/renders/renderDigitalVersionResearchCloud"; import moment from "moment/moment"; +import style from "./DigitizationContainerList.module.scss" export default function DigitizationContainerList() { const renderDate = (data) => { return (moment(data).format('YYYY-MM-DD')) } + const renderContainerNo = (data, record) => { + return {data} + } + const columns = [ { title: 'Container No.', dataIndex: 'container_no', key: 'container_no', sorter: true, + render: renderContainerNo, width: 200 }, { title: 'Barcode', @@ -27,7 +32,7 @@ export default function DigitizationContainerList() { title: 'Date Updated', dataIndex: 'date_updated', key: 'date_updated', - width: 150, + width: 120, className: 'centerColumn', render: renderDate, sorter: true @@ -35,14 +40,14 @@ export default function DigitizationContainerList() { title: 'Digital Version', dataIndex: 'digital_version_exists', key: 'digital_version_exists', - width: 150, + width: 120, className: 'centerColumn', sorter: true, render: renderDigitalVersion }, { title: 'Research Cloud', key: 'digital_version_research_cloud', - width: 150, + width: 120, className: 'centerColumn', sorter: true, render: renderDigitalVersionResearchCloud @@ -50,7 +55,7 @@ export default function DigitizationContainerList() { title: 'Online', dataIndex: 'digital_version_online', key: 'digital_version_online', - width: 150, + width: 120, className: 'centerColumn', sorter: true, render: renderDigitalVersion diff --git a/components/Digitization/DigitizationContainerList.module.scss b/components/Digitization/DigitizationContainerList.module.scss new file mode 100644 index 0000000..2285282 --- /dev/null +++ b/components/Digitization/DigitizationContainerList.module.scss @@ -0,0 +1,9 @@ +.ContainerNo { + text-decoration: none; + color: inherit; + border-bottom: 1px dotted gray; + + &:hover { + color: #000; + } +} \ No newline at end of file From 0446a2a22bb104106429f6aa64ccb7f3b83757d0 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 28 Nov 2025 13:57:48 +0100 Subject: [PATCH 138/152] Update createParams.js --- components/Tables/functions/createParams.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/Tables/functions/createParams.js b/components/Tables/functions/createParams.js index eafb769..ec23d28 100644 --- a/components/Tables/functions/createParams.js +++ b/components/Tables/functions/createParams.js @@ -4,11 +4,16 @@ export const createParams = ({ pagination={}, filters={}, ...sorter}) => { // Sorting const createSortParams = (sorter) => { const {columnKey, order, column} = sorter; - if (columnKey && column) { - if (column.hasOwnProperty('sortKeys')) { - return {ordering: order === 'ascend' ? `${column.sortKeys.join(',')}` : `-${column.sortKeys.join(',')}`} + + if (columnKey) { + if (column) { + if (column.hasOwnProperty('sortKeys')) { + return {ordering: order === 'ascend' ? `${column.sortKeys.join(',')}` : `-${column.sortKeys.join(',')}`} + } else { + return {ordering: order === 'ascend' ? `${columnKey}` : `-${columnKey}`} + } } else { - return {ordering: order === 'ascend' ? `${columnKey}` : `-${columnKey}`} + return {ordering: ''} } } }; From 6a49265868e0922d6f8297744085b4aa0bfdac41 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 28 Nov 2025 13:57:54 +0100 Subject: [PATCH 139/152] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 16e0389..d986fb3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "next start" }, "dependencies": { - "@ant-design/icons": "^4.8.0", + "@ant-design/icons": "5.x", "@ant-design/plots": "^1.2.2", "@handsontable/react": "^12.3.0", "@kunukn/react-collapse": "^2.2.9", @@ -20,7 +20,7 @@ "handsontable": "^12.3.0", "lodash": "^4.17.21", "next": "12.3.4", - "next-auth": "^4.18.4", + "next-auth": "4.18.10", "next-remove-imports": "^1.0.12", "react": "17.0.2", "react-dom": "17.0.2", From ad3fa52dcbd3e9b0c08e9ef28edc529aa2f2bc9a Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 28 Nov 2025 13:58:06 +0100 Subject: [PATCH 140/152] Update yarn.lock --- yarn.lock | 96 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 24 deletions(-) diff --git a/yarn.lock b/yarn.lock index f9ee2fd..cc6a803 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,6 +17,13 @@ dependencies: "@ctrl/tinycolor" "^3.4.0" +"@ant-design/colors@^7.0.0": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@ant-design/colors/-/colors-7.2.1.tgz#3bbc1c6c18550020d1622a0067ff03492318df98" + integrity sha512-lCHDcEzieu4GA3n8ELeZ5VQ8pKQAWcGGLRTQ50aQM2iqPpq2evTxER84jfdPvsPAtEcZ7m44NI45edFMo8oOYQ== + dependencies: + "@ant-design/fast-color" "^2.0.6" + "@ant-design/cssinjs@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@ant-design/cssinjs/-/cssinjs-1.1.1.tgz#4c93a0c13828d2ede00b51f97703c52bb0e1b38c" @@ -30,12 +37,35 @@ rc-util "^5.24.2" stylis "^4.0.13" +"@ant-design/fast-color@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@ant-design/fast-color/-/fast-color-2.0.6.tgz#ab4d4455c1542c9017d367c2fa8ca3e4215d0ba2" + integrity sha512-y2217gk4NqL35giHl72o6Zzqji9O7vHh9YmhUVkPtAOpoTCH4uWxo/pr4VE8t0+ChEPs0qo4eJRC5Q1eXWo3vA== + dependencies: + "@babel/runtime" "^7.24.7" + "@ant-design/icons-svg@^4.2.1": version "4.2.1" resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.2.1.tgz#8630da8eb4471a4aabdaed7d1ff6a97dcb2cf05a" integrity sha512-EB0iwlKDGpG93hW8f85CTJTs4SvMX7tt5ceupvhALp1IF44SeUFOMhKUOYqpsoYWQKAOuTRDMqn75rEaKDp0Xw== -"@ant-design/icons@^4.7.0", "@ant-design/icons@^4.8.0": +"@ant-design/icons-svg@^4.4.0": + version "4.4.2" + resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz#ed2be7fb4d82ac7e1d45a54a5b06d6cecf8be6f6" + integrity sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA== + +"@ant-design/icons@5.x": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-5.6.1.tgz#7290fcdc3d96ff3fca793ed399053cd29ad5dbd3" + integrity sha512-0/xS39c91WjPAZOWsvi1//zjx6kAp4kxWwctR6kuU6p133w8RU0D2dSCvZC19uQyharg/sAvYxGYWl01BbZZfg== + dependencies: + "@ant-design/colors" "^7.0.0" + "@ant-design/icons-svg" "^4.4.0" + "@babel/runtime" "^7.24.8" + classnames "^2.2.6" + rc-util "^5.31.1" + +"@ant-design/icons@^4.7.0": version "4.8.0" resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-4.8.0.tgz#3084e2bb494cac3dad6c0392f77c1efc90ee1fa4" integrity sha512-T89P2jG2vM7OJ0IfGx2+9FC5sQjtTzRSz+mCHTXkFn/ELZc2YpfStmYHmqzq2Jx55J0F7+O6i5/ZKFSVNWCKNg== @@ -404,7 +434,7 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0": version "7.20.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== @@ -418,6 +448,11 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.16.3", "@babel/runtime@^7.24.7", "@babel/runtime@^7.24.8": + version "7.28.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.4.tgz#a70226016fabe25c5783b2f22d3e1c9bc5ca3326" + integrity sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ== + "@babel/template@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315" @@ -580,9 +615,9 @@ integrity sha512-DQ20JEfTBZAgF8QCjYfJhv2/279M6onxFjdG/+5B0Cyj00/EdBxiWb2eGGFgQhrBbNv/lsvzFbbi0Ptf8Vw/bg== "@panva/hkdf@^1.0.1": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.0.2.tgz#bab0f09d09de9fd83628220d496627681bc440d6" - integrity sha512-MSAs9t3Go7GUkMhpKC44T58DJ5KGk2vBo+h1cqQeqlMfdGkxaVB78ZWpv9gYi/g2fa4sopag9gJsNvS8XGgWJA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.2.1.tgz#cb0d111ef700136f4580349ff0226bf25c853f23" + integrity sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw== "@rc-component/mini-decimal@^1.0.1": version "1.0.1" @@ -2033,10 +2068,10 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -jose@^4.10.0, jose@^4.9.3: - version "4.11.1" - resolved "https://registry.yarnpkg.com/jose/-/jose-4.11.1.tgz#8f7443549befe5bddcf4bae664a9cbc1a62da4fa" - integrity sha512-YRv4Tk/Wlug8qicwqFNFVEZSdbROCHRAC6qu/i0dyNKr5JQdoa2pIGoS04lLO/jXQX7Z9omoNewYIVIxqZBd9Q== +jose@^4.15.9, jose@^4.9.3: + version "4.15.9" + resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.9.tgz#9b68eda29e9a0614c042fa29387196c7dd800100" + integrity sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA== js-cookie@^2.2.1: version "2.2.1" @@ -2636,10 +2671,10 @@ nanoid@^3.3.4: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== -next-auth@^4.18.4: - version "4.18.6" - resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.18.6.tgz#c23d02894a09e12d210cfb7041afa43fb1e897a4" - integrity sha512-0TQwbq5X9Jyd1wUVYUoyvHJh4JWXeW9UOcMEl245Er/Y5vsSbyGJHt8M7xjRMzk9mORVMYehoMdERgyiq/jCgA== +next-auth@4.18.10: + version "4.18.10" + resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.18.10.tgz#8ce63a671e990dbf5e03e8df5a34859e817f4880" + integrity sha512-j2JVyH7byZ2eqXlOqNLpOO7gOlAkTzblxLZNeZihKCeIabYFHNdAJgUvVahhnHs3pZ4xaa3ZqGQHgi1uE97L9Q== dependencies: "@babel/runtime" "^7.16.3" "@panva/hkdf" "^1.0.1" @@ -2725,7 +2760,7 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-hash@^2.0.1: +object-hash@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== @@ -2758,10 +2793,10 @@ object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" -oidc-token-hash@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/oidc-token-hash/-/oidc-token-hash-5.0.1.tgz#ae6beec3ec20f0fd885e5400d175191d6e2f10c6" - integrity sha512-EvoOtz6FIEBzE+9q253HsLCVRiK/0doEJ2HCvvqMQb3dHZrP3WlJKYtJ55CRTw4jmYomzH4wkPuCj/I3ZvpKxQ== +oidc-token-hash@^5.0.3: + version "5.2.0" + resolved "https://registry.yarnpkg.com/oidc-token-hash/-/oidc-token-hash-5.2.0.tgz#be8a8885c7e2478d21a674e15afa31f1bcc4a61f" + integrity sha512-6gj2m8cJZ+iSW8bm0FXdGF0YhIQbKrfP4yWTNzxc31U6MOjfEmB1rHvlYvxI1B7t7BCi1F2vYTT6YhtQRG4hxw== once@^1.3.0: version "1.4.0" @@ -2771,14 +2806,14 @@ once@^1.3.0: wrappy "1" openid-client@^5.1.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.3.1.tgz#69a5fa7d2b5ad479032f576852d40b4d4435488a" - integrity sha512-RLfehQiHch9N6tRWNx68cicf3b1WR0x74bJWHRc25uYIbSRwjxYcTFaRnzbbpls5jroLAaB/bFIodTgA5LJMvw== + version "5.7.1" + resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.7.1.tgz#34cace862a3e6472ed7d0a8616ef73b7fb85a9c3" + integrity sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew== dependencies: - jose "^4.10.0" + jose "^4.15.9" lru-cache "^6.0.0" - object-hash "^2.0.1" - oidc-token-hash "^5.0.1" + object-hash "^2.2.0" + oidc-token-hash "^5.0.3" p-limit@^4.0.0: version "4.0.0" @@ -3264,6 +3299,14 @@ rc-util@^5.0.1, rc-util@^5.0.6, rc-util@^5.12.0, rc-util@^5.15.0, rc-util@^5.16. react-is "^16.12.0" shallowequal "^1.1.0" +rc-util@^5.31.1: + version "5.44.4" + resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.44.4.tgz#89ee9037683cca01cd60f1a6bbda761457dd6ba5" + integrity sha512-resueRJzmHG9Q6rI/DfK6Kdv9/Lfls05vzMs1Sk3M2P+3cJa+MakaZyWY8IPfehVuhPJFKrIY1IK4GqbiaiY5w== + dependencies: + "@babel/runtime" "^7.18.3" + react-is "^18.2.0" + rc-virtual-list@^3.2.0, rc-virtual-list@^3.4.8: version "3.4.13" resolved "https://registry.yarnpkg.com/rc-virtual-list/-/rc-virtual-list-3.4.13.tgz#20acc934b263abcf7b7c161f50ef82281b2f7e8d" @@ -3305,6 +3348,11 @@ react-is@^16.12.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-is@^18.2.0: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + react-json-view-lite@^0.9.2: version "0.9.4" resolved "https://registry.yarnpkg.com/react-json-view-lite/-/react-json-view-lite-0.9.4.tgz#a7c6c66c6c8e73e130618b2e9cacf34044060638" From 14df57795050beef706c8798e48472b4670ab502 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 28 Nov 2025 13:58:33 +0100 Subject: [PATCH 141/152] Added Duplication tab to the PersonForm --- components/Forms/PopupForm.js | 2 +- .../Forms/components/FormDuplications.js | 87 ++++++++++++++++--- .../components/FormDuplications.module.scss | 4 + components/Forms/fields/PersonForm.js | 10 ++- 4 files changed, 91 insertions(+), 12 deletions(-) diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 84dd8f8..f877084 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -61,7 +61,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel case 'languages': return ; case 'people': - return ; + return ; case 'places': return ; case 'subjects': diff --git a/components/Forms/components/FormDuplications.js b/components/Forms/components/FormDuplications.js index 0ad112e..24e626a 100644 --- a/components/Forms/components/FormDuplications.js +++ b/components/Forms/components/FormDuplications.js @@ -1,17 +1,80 @@ import React, {useEffect, useState} from "react"; -import {get} from "../../../utils/api"; +import {get, post, remove} from "../../../utils/api"; import style from "./FormDuplications.module.scss"; -import {LoadingOutlined} from "@ant-design/icons"; -import {Table} from "antd"; +import {LoadingOutlined, SaveOutlined, MergeOutlined } from "@ant-design/icons"; +import {Button, Modal, notification, Table, Tooltip} from "antd"; import {renderURL} from "../../../utils/renders/renderURL"; import {renderWikidataURL} from "../../../utils/renders/renderWikidataURL"; import {renderSimilarity} from "../../../utils/renders/renderSimilarity"; +import {deleteAlert} from "../../Tables/functions/deleteAlert"; -const FormDuplications = ({api}) => { +const FormDuplications = ({api, selectedRecord, afterMergeFinish}) => { const [loading, setLoading] = useState(true); const [data, setData] = useState([]); + const onMergeClick = (record) => { + const keep_id = selectedRecord; + const merge_id = record.id; + + const { confirm } = Modal; + + confirm({ + title: 'Are you sure you would merge the Person record into this one?', + okText: 'Yes', + okType: 'danger', + cancelText: 'No', + onOk() { + merge(keep_id, merge_id) + } + }); + } + + const onKeepClick = (record) => { + const keep_id = record.id; + const merge_id = selectedRecord; + + const { confirm } = Modal; + + confirm({ + title: 'Are you sure you would merge (and after that, delete) this record with the selected one?', + okText: 'Yes', + okType: 'danger', + cancelText: 'No', + onOk() { + merge(keep_id, merge_id) + afterMergeFinish() + } + }); + } + + const merge = (keep_id, merge_id) => { + post(`/v1/authority_list/people/merge/`, { + keep_id: keep_id, + merge_id: merge_id} + ).then(response => { + getDuplicationData() + notification.success({ + duration: 3, + message: 'Success!', + description: `Person records were merged, subject and contributor references were updated!`, + }); + }) + } + + const renderActionButtons = (record) => { + return ( + + +
    @@ -60,6 +61,13 @@ export const PersonForm = ({form, readOnly}) => { type={'person'} /> + + + From bb35b8037a73f51b7966cfad1312cbfdbca215cf Mon Sep 17 00:00:00 2001 From: JoshBone Date: Tue, 2 Dec 2025 15:02:21 +0100 Subject: [PATCH 142/152] Add hasMerge parameter --- components/Forms/PopupForm.js | 4 ++-- .../components/FormRemoteSelectWithEdit.js | 1 + components/Forms/fields/PersonForm.js | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index f877084..3f58865 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -30,7 +30,7 @@ import {RequestItemForm} from "./fields/RequestsItemForm"; import {NationalityForm} from "./fields/NationalityForm"; import AuditLog from "./auditLog/AuditLog"; -export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, onClose}) => { +export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, hasMerge=true, onClose}) => { const afterFinish = (data) => { onClose(data); }; @@ -61,7 +61,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel case 'languages': return ; case 'people': - return ; + return ; case 'places': return ; case 'subjects': diff --git a/components/Forms/components/FormRemoteSelectWithEdit.js b/components/Forms/components/FormRemoteSelectWithEdit.js index 097103d..a3e530c 100644 --- a/components/Forms/components/FormRemoteSelectWithEdit.js +++ b/components/Forms/components/FormRemoteSelectWithEdit.js @@ -176,6 +176,7 @@ export const FormRemoteSelectWithEdit = ({ type={action} label={getMessageText()} onClose={onClose} + hasMerge={false} /> diff --git a/components/Forms/fields/PersonForm.js b/components/Forms/fields/PersonForm.js index 10d5402..8556504 100644 --- a/components/Forms/fields/PersonForm.js +++ b/components/Forms/fields/PersonForm.js @@ -6,7 +6,7 @@ import FormDuplications from "../components/FormDuplications"; const { TabPane } = Tabs; -export const PersonForm = ({form, selectedRecord, readOnly, afterMergeFinish}) => { +export const PersonForm = ({form, selectedRecord, readOnly, afterMergeFinish, hasMerge}) => { return ( @@ -61,13 +61,15 @@ export const PersonForm = ({form, selectedRecord, readOnly, afterMergeFinish}) = type={'person'} /> - - - + { selectedRecord && hasMerge && + + + + } From 88c6fe835a10b211759d59e28d1509e85e1854f2 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 14 Jan 2026 14:21:15 +0100 Subject: [PATCH 143/152] Label corrections --- components/Forms/fields/finding_aids/DigitalVersionTab.js | 2 +- components/Forms/fields/finding_aids/Extents.js | 2 +- components/Tables/filters/IsadTableFilter.js | 2 +- utils/renders/renderStatus.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Forms/fields/finding_aids/DigitalVersionTab.js b/components/Forms/fields/finding_aids/DigitalVersionTab.js index f5d4d2a..74e750f 100644 --- a/components/Forms/fields/finding_aids/DigitalVersionTab.js +++ b/components/Forms/fields/finding_aids/DigitalVersionTab.js @@ -58,7 +58,7 @@ const DigitalVersionTab = ({form, initialValues, locale, readOnly}) => { } else { return (
    -
    diff --git a/components/Forms/fields/finding_aids/Extents.js b/components/Forms/fields/finding_aids/Extents.js index 7b6b8c4..fe1bf38 100644 --- a/components/Forms/fields/finding_aids/Extents.js +++ b/components/Forms/fields/finding_aids/Extents.js @@ -5,7 +5,7 @@ import {FormRemoteSelectWithEdit} from "../../components/FormRemoteSelectWithEdi export const Extents = ({form, disabled}) => ( -
    Creators
    +
    Extent
    {(fields, { add, remove }) => { return ( diff --git a/components/Tables/filters/IsadTableFilter.js b/components/Tables/filters/IsadTableFilter.js index 111ce13..5f5eca8 100644 --- a/components/Tables/filters/IsadTableFilter.js +++ b/components/Tables/filters/IsadTableFilter.js @@ -8,7 +8,7 @@ const IsadTableFilter = () => { const statuses = [ { value: 'draft', label: 'draft'}, { value: 'final', label: 'final'}, - { value: 'not exists', label: 'not exists'} + { value: 'not exists', label: 'none'} ]; return ( diff --git a/utils/renders/renderStatus.js b/utils/renders/renderStatus.js index 3940fb3..d517a78 100644 --- a/utils/renders/renderStatus.js +++ b/utils/renders/renderStatus.js @@ -17,7 +17,7 @@ export const renderStatus = (data) => { ); case 'Not exists': return ( - + ); default: break; From c952262ff953d9fb0b4ff8e7f3d0fde063a76453 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 3 Feb 2026 16:47:46 +0100 Subject: [PATCH 144/152] DigitalVersions - Container Level display --- components/Forms/PopupForm.js | 23 +++- components/Forms/fields/ContainerForm.js | 103 ------------------ components/Forms/fields/DigitizationForm.js | 2 - .../fields/{ => containers}/BarcodeForm.js | 0 .../Forms/fields/containers/ContainerForm.js | 47 ++++++++ .../fields/containers/DigitalVersionsTable.js | 87 +++++++++++++++ .../DigitalVersionsTable.module.scss | 15 +++ .../fields/finding_aids/ResearchCloudLink.js | 4 +- components/Tables/ContainerTable.js | 30 ++++- components/Tables/Table.module.scss | 12 ++ 10 files changed, 210 insertions(+), 113 deletions(-) delete mode 100644 components/Forms/fields/ContainerForm.js rename components/Forms/fields/{ => containers}/BarcodeForm.js (100%) create mode 100644 components/Forms/fields/containers/ContainerForm.js create mode 100644 components/Forms/fields/containers/DigitalVersionsTable.js create mode 100644 components/Forms/fields/containers/DigitalVersionsTable.module.scss diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index 3f58865..2384a74 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -1,5 +1,5 @@ import React, {useEffect} from "react"; -import {Form, Row, Col, Button, Input} from 'antd'; +import {Form, Row, Col, Button, Input, Divider} from 'antd'; import style from './Forms.module.css'; import {CarrierTypeForm} from "./fields/CarrierTypeForm"; import {CorporationForm} from "./fields/CorporationForm"; @@ -16,8 +16,8 @@ import {DonorForm} from "./fields/DonorForm"; import {useData} from "../../utils/hooks/useData"; import {fillManyFields} from "../../utils/functions/fillManyFields"; import {IsaarForm} from "./fields/IsaarForm"; -import {BarcodeForm} from "./fields/BarcodeForm"; -import {ContainerForm} from "./fields/ContainerForm"; +import {BarcodeForm} from "./fields/containers/BarcodeForm"; +import {ContainerForm} from "./fields/containers/ContainerForm"; import {ExtentUnitForm} from "./fields/ExtentUnitForm"; import {RoleForm} from "./fields/RoleForm"; import {useForm} from "../../utils/hooks/useForm"; @@ -29,6 +29,7 @@ import {RequestsForm} from "./fields/RequestsForm"; import {RequestItemForm} from "./fields/RequestsItemForm"; import {NationalityForm} from "./fields/NationalityForm"; import AuditLog from "./auditLog/AuditLog"; +import DigitalVersionsTable from "./fields/containers/DigitalVersionsTable"; export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, field, label, hasMerge=true, onClose}) => { const afterFinish = (data) => { @@ -168,6 +169,21 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel } }; + const renderDigitalVersions = () => { + if (data && data.digital_versions && data.digital_versions.length > 0) { + return ( + <> + +

    Digital Versions

    + +
    + + ) + } else { + return null; + } + } + return ( { errors && renderErrors() } @@ -200,6 +216,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel } + { module === 'container' && renderDigitalVersions() } {data && data.hasOwnProperty('date_created') &&
    diff --git a/components/Forms/fields/ContainerForm.js b/components/Forms/fields/ContainerForm.js deleted file mode 100644 index 1890bc6..0000000 --- a/components/Forms/fields/ContainerForm.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, {useEffect} from 'react'; -import {Form, Col, Input, Checkbox, Divider, Switch, Button} from "antd"; -import FormRemoteSelect from "../components/FormRemoteSelect"; -import ResearchCloudLink from "./finding_aids/ResearchCloudLink"; -import {FormFormattedText} from "../components/FormFormattedText"; - -export const ContainerForm = ({form, readOnly}) => { - const digitalVersionExists = Form.useWatch('digital_version_exists', form); - const digitalVersionResearchCloud = Form.useWatch('digital_version_research_cloud', form) - const digitalVersionResearchCloudPath = Form.useWatch('digital_version_research_cloud_path', form) - - useEffect(() => { - if (!digitalVersionExists) { - form.setFieldValue("digital_version_research_cloud", false) - form.setFieldValue("digital_version_online", false) - } - }, [digitalVersionExists]) - - const getDisabled = () => { - if (readOnly) { - return true - } else { - return !digitalVersionExists - } - } - - - - return ( - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - digitalVersionResearchCloud && - - - - - - - - - - - } - - - - - - - ) -}; - diff --git a/components/Forms/fields/DigitizationForm.js b/components/Forms/fields/DigitizationForm.js index 6e44137..3a46046 100644 --- a/components/Forms/fields/DigitizationForm.js +++ b/components/Forms/fields/DigitizationForm.js @@ -5,8 +5,6 @@ import {Form, Col} from "antd"; import 'react-json-view-lite/dist/index.css'; const JsonViewer = ({value}) => { - console.log(value); - return ( value ? { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) +}; + diff --git a/components/Forms/fields/containers/DigitalVersionsTable.js b/components/Forms/fields/containers/DigitalVersionsTable.js new file mode 100644 index 0000000..003d8d7 --- /dev/null +++ b/components/Forms/fields/containers/DigitalVersionsTable.js @@ -0,0 +1,87 @@ +import {Badge, Button, Table} from "antd"; +import ResearchCloudLink from "../finding_aids/ResearchCloudLink"; +import style from "./DigitalVersionsTable.module.scss"; + +const DigitalVersionsTable = ({digitalVersions}) => { + const renderLevel = (text, record) => { + switch (text) { + case 'A': + return 'Access Copy'; + case 'M': + return 'Master'; + } + } + + const renderAvailability = (text, record) => { + switch (record['level']) { + case 'A': + if (record['available_research_cloud']) { + return ( +
    + +
    + ) + } + + if (record['available_online']) { + return ( +
    + +
    + ) + } + + return ( +
    + +
    + ) + case 'M': + const physical_copies = record['physical_copies']; + + return ( +
    + { physical_copies.map((physical_copy, index) => ( +
    {physical_copy['storage_unit']} [{physical_copy['storage_unit_label']}]
    + ))} +
    + ) + + + } + } + + const columns = [ + { + title: 'Level', + dataIndex: 'level', + key: 'level', + render: renderLevel, + sorter: true, + }, { + title: 'Filename', + dataIndex: 'filename', + key: 'filename', + sorter: false, + }, { + title: 'Available', + dataIndex: 'available', + key: 'available', + render: renderAvailability, + sorter: false, + } + ] + + return ( +
    record.id} + dataSource={digitalVersions} + columns={columns} + size={'small'} + pagination={false} + /> + ) +} + +export default DigitalVersionsTable; \ No newline at end of file diff --git a/components/Forms/fields/containers/DigitalVersionsTable.module.scss b/components/Forms/fields/containers/DigitalVersionsTable.module.scss new file mode 100644 index 0000000..43ccc84 --- /dev/null +++ b/components/Forms/fields/containers/DigitalVersionsTable.module.scss @@ -0,0 +1,15 @@ +.Availability { + text-align: center; +} + +.MasterStorage { + color: #666; + border-radius: 3px; + font-size: 0.9em; + text-align: center; + user-select: none; + + span { + padding: 0 4px; + } +} \ No newline at end of file diff --git a/components/Forms/fields/finding_aids/ResearchCloudLink.js b/components/Forms/fields/finding_aids/ResearchCloudLink.js index 69824e3..4268cf7 100644 --- a/components/Forms/fields/finding_aids/ResearchCloudLink.js +++ b/components/Forms/fields/finding_aids/ResearchCloudLink.js @@ -19,13 +19,13 @@ const ResearchCloudLink = ({path, buttonText='Open', isBadge=false}) => { if (isBadge) { return ( - + ) } else { return ( - + ) } diff --git a/components/Tables/ContainerTable.js b/components/Tables/ContainerTable.js index 138bd15..2e6e042 100644 --- a/components/Tables/ContainerTable.js +++ b/components/Tables/ContainerTable.js @@ -1,4 +1,4 @@ -import {Button, Card, Col, Drawer, Modal, Row, Table, Tooltip} from "antd"; +import {Badge, Button, Card, Col, Drawer, Modal, Row, Table, Tooltip} from "antd"; import React, {useState, useEffect} from "react"; import {ArrowUpOutlined, ArrowDownOutlined, EditOutlined, DeleteOutlined, LoadingOutlined, BarcodeOutlined, CloseOutlined, TableOutlined, CaretRightOutlined, PrinterOutlined, CaretUpOutlined, CaretDownOutlined} from "@ant-design/icons"; @@ -138,6 +138,25 @@ const ContainerTable = ({seriesID, seriesTitle}) => { }; + const renderDigitalVersions = (value, record) => { + const masters = record['digital_versions_masters'] + const access_copies = record['digital_versions_access_copies'] + + if (masters > 0 || access_copies > 0) { + return ( +
    + { masters === 1 && `Master: 1`} + { masters > 1 && `Masters: ${masters}`} + { access_copies > 0 && masters > 0 && | } + { access_copies === 1 && `Access Copy: 1`} + { access_copies > 1 && `Access Copies: ${access_copies}`} +
    + ) + } else { + return '' + } + } + const columns = [ { title: 'Container No.', @@ -154,7 +173,13 @@ const ContainerTable = ({seriesID, seriesTitle}) => { title: 'Carrier Type', dataIndex: 'carrier_type', key: 'carrier_type', - width: 300 + width: 200 + }, { + title: 'Digital Copies', + dataIndex: 'container-digital-versions', + key: 'container-digital-versions', + render: renderDigitalVersions, + width: 180 }, { key: 'actions', title: 'Actions', @@ -345,7 +370,6 @@ const ContainerTable = ({seriesID, seriesTitle}) => { selectedRecord={selectedRecord} module={formType} type={action} - label={formType === 'container' ? 'Container' : 'Barcode'} onClose={onClose} /> diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index 5521f58..fddff3b 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -2,6 +2,18 @@ margin-bottom: 0; } +.DigitalBadge { + color: #666; + border-radius: 3px; + font-size: 0.8em; + text-align: center; + user-select: none; + + span { + padding: 0 4px; + } +} + .ActionColumn { text-align: center; } From da14c5a4083ef56568a4d6ae5be72c29d7a82c21 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 13 Feb 2026 22:38:14 +0100 Subject: [PATCH 145/152] Reorganize researcher form. --- components/Forms/fields/ResearcherForm.js | 44 +++++++++---------- components/Tables/ResearchersTable.js | 5 --- .../Tables/filters/ResearchTableFilter.js | 14 +----- 3 files changed, 22 insertions(+), 41 deletions(-) diff --git a/components/Forms/fields/ResearcherForm.js b/components/Forms/fields/ResearcherForm.js index d1d8c31..9071e64 100644 --- a/components/Forms/fields/ResearcherForm.js +++ b/components/Forms/fields/ResearcherForm.js @@ -6,6 +6,8 @@ import FormRadioGroup from "../components/FormRadioGroup"; import style from "../Forms.module.css"; const OCCUPATION = [ + { id: 'ceu_student', occupation: 'CEU Student'}, + { id: 'ceu_faculty', occupation: 'CEU Faculty'}, { id: 'ceu', occupation: 'CEU'}, { id: 'other', occupation: 'Other'}, ]; @@ -49,42 +51,36 @@ export const ResearcherForm = ({form, readOnly}) => { - - + + - + - + - + - + - - - - - - { options={OCCUPATION_TYPE} valueField={'value'} labelField={'label'} - disabled={readOnly} + disabled={true} /> - + - + { dataIndex: 'country', key: 'country__country', sorter: true, - }, { - title: 'Citizenship', - dataIndex: 'citizenship', - key: 'citizenship__nationality', - sorter: true, }, { title: 'Created', dataIndex: 'date_created', diff --git a/components/Tables/filters/ResearchTableFilter.js b/components/Tables/filters/ResearchTableFilter.js index 7c19a7f..66236cd 100644 --- a/components/Tables/filters/ResearchTableFilter.js +++ b/components/Tables/filters/ResearchTableFilter.js @@ -17,7 +17,7 @@ const ResearcherTableFilter = () => { return ( - + { className={style.Search}/> - + { /> - - - - -
    onDrawerClose()} open={drawerShown} @@ -344,7 +392,7 @@ const FindingAidsTable = ({containerID, containerListRefresh, templateData, reco api={'/v1/finding_aids/'} preCreateAPI={action === 'create' ? `/v1/finding_aids/pre_create/${containerID}` : null} selectedRecord={selectedRecord} - module={'finding-aids-quick-edit'} + module={formType} type={action} label={'Finding Aids Record'} onClose={onDrawerClose} diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index fddff3b..44304ce 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -8,10 +8,15 @@ font-size: 0.8em; text-align: center; user-select: none; - + cursor: pointer; + span { padding: 0 4px; } + + &.Empty { + cursor: inherit; + } } .ActionColumn { From 58c4b3cd02c847947a24d1af2018c024a16d648a Mon Sep 17 00:00:00 2001 From: JoshBone Date: Fri, 20 Feb 2026 14:03:07 +0100 Subject: [PATCH 147/152] Correcting the catalog link button --- components/Forms/PopupForm.js | 2 +- .../fields/containers/DigitalVersionsTable.js | 5 ++-- .../Forms/fields/finding_aids/CatalogLink.js | 24 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 components/Forms/fields/finding_aids/CatalogLink.js diff --git a/components/Forms/PopupForm.js b/components/Forms/PopupForm.js index f5f3acc..c77a31a 100644 --- a/components/Forms/PopupForm.js +++ b/components/Forms/PopupForm.js @@ -175,7 +175,7 @@ export const PopupForm = ({api, preCreateAPI, selectedRecord, module, type, fiel if (data && data.digital_versions && data.digital_versions.length > 0) { return ( <> - + ) } else { diff --git a/components/Forms/fields/containers/DigitalVersionsTable.js b/components/Forms/fields/containers/DigitalVersionsTable.js index 76d3968..2c921c0 100644 --- a/components/Forms/fields/containers/DigitalVersionsTable.js +++ b/components/Forms/fields/containers/DigitalVersionsTable.js @@ -1,8 +1,9 @@ import {Button, Table} from "antd"; import ResearchCloudLink from "../finding_aids/ResearchCloudLink"; import style from "./DigitalVersionsTable.module.scss"; +import CatalogLink from "../finding_aids/CatalogLink"; -const DigitalVersionsTable = ({digitalVersions}) => { +const DigitalVersionsTable = ({digitalVersions, catalogID}) => { const renderLevel = (text, record) => { switch (text) { case 'A': @@ -26,7 +27,7 @@ const DigitalVersionsTable = ({digitalVersions}) => { if (record['available_online']) { return (
    - +
    ) } diff --git a/components/Forms/fields/finding_aids/CatalogLink.js b/components/Forms/fields/finding_aids/CatalogLink.js new file mode 100644 index 0000000..15fa06d --- /dev/null +++ b/components/Forms/fields/finding_aids/CatalogLink.js @@ -0,0 +1,24 @@ +import {Badge, Button} from "antd"; + +const CatalogLink = ({catalogID, buttonText='Open', isBadge=false}) => { + const getLink = () => { + return encodeURI(`https://catalog.archivum.org/catalog/${catalogID}`); + } + + if (isBadge) { + return ( + + + + ) + } else { + return ( + + + + ) + } + +} + +export default CatalogLink; \ No newline at end of file From d19ff2959aa3c3ac1d5b8fd89fca3d77859a0b21 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 23 Feb 2026 10:59:40 +0100 Subject: [PATCH 148/152] Update FindingAidsEntityForm.js --- .../Forms/fields/FindingAidsEntityForm.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/components/Forms/fields/FindingAidsEntityForm.js b/components/Forms/fields/FindingAidsEntityForm.js index 9d375e6..e2f58b6 100644 --- a/components/Forms/fields/FindingAidsEntityForm.js +++ b/components/Forms/fields/FindingAidsEntityForm.js @@ -787,21 +787,6 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, onActi } ] - const getItems = () => { - const digitalVersion = { - key: 'digital_version', - label: 'Digital Version', - forceRender: true, - children: - } - - if (!isTemplate) { - items.push(digitalVersion) - } - - return items - } - return (
    @@ -812,7 +797,7 @@ export const FindingAidsEntityForm = ({form, locale, type, initialValues, onActi } - + ) From 95d7b69c286071bb2e4d8f654e8f31a8ead9870e Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 23 Feb 2026 13:12:12 +0100 Subject: [PATCH 149/152] Update FormDatePicker.js --- components/Forms/components/FormDatePicker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/Forms/components/FormDatePicker.js b/components/Forms/components/FormDatePicker.js index 0f1dbe0..7d89a8d 100644 --- a/components/Forms/components/FormDatePicker.js +++ b/components/Forms/components/FormDatePicker.js @@ -5,9 +5,12 @@ import dayjs from "dayjs"; const FormDatePicker = ({ format, disabled=false, value, onChange, ...props }) => { - const handleChange = (dateObj, dateString) => { - onChange(dateString) + if (dateString === '') { + onChange(null) + } else { + onChange(dateString) + } } return ( From b78cd4c567f44ece8f1aee3fd590fd4d87cec75d Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 2 Mar 2026 12:29:09 +0100 Subject: [PATCH 150/152] Update Researcher form --- components/Tables/ResearchersTable.js | 48 +++++++++++---------------- components/Tables/Table.module.scss | 15 +++++++++ 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/components/Tables/ResearchersTable.js b/components/Tables/ResearchersTable.js index 0321016..f0ba823 100644 --- a/components/Tables/ResearchersTable.js +++ b/components/Tables/ResearchersTable.js @@ -5,7 +5,7 @@ import { EditOutlined, EyeOutlined, LoadingOutlined, - PlusOutlined + PlusOutlined, UndoOutlined } from "@ant-design/icons"; import TableFilters from "./TableFilters"; import style from './Table.module.scss'; @@ -112,38 +112,29 @@ const ResearchersTable = ({...props}) => { }); }; - const renderResearcherApprovedStatus = (record) => { - switch (record.approved) { - case true: + const renderResearcherStatus = (record) => { + switch (record.status) { + case 'new': return ( -
    onAction('disapprove', record.id)} className={style.ResearcherStatusButton}> - -
    - ); - case false: - return ( -
    onAction('approve', record.id)} className={style.ResearcherStatusButton}> - -
    +
    onAction('activate', record.id)} className={style.ResearcherStatusButton}> + +
    ); - default: - break; - } - }; - - - const renderResearcherActiveStatus = (record) => { - switch (record.active) { - case true: + case 'approved': return ( -
    onAction('deactivate', record.id)} className={style.ResearcherStatusButton}> - +
    onAction('suspend', record.id)} className={style.ResearcherStatusButton}> +
    ); - case false: + case 'suspended': return ( -
    onAction('activate', record.id)} className={style.ResearcherStatusButton}> - +
    + + +
    onAction('reactivate', record.id)}> +
    +
    ); default: @@ -154,8 +145,7 @@ const ResearchersTable = ({...props}) => { const renderStatus = (record) => { return (
    - {renderResearcherApprovedStatus(record)} - {renderResearcherActiveStatus(record)} + {renderResearcherStatus(record)}
    ) } diff --git a/components/Tables/Table.module.scss b/components/Tables/Table.module.scss index 44304ce..d89702e 100644 --- a/components/Tables/Table.module.scss +++ b/components/Tables/Table.module.scss @@ -130,6 +130,21 @@ .ResearcherStatusButton { cursor: pointer; } + + .ResearcherStatusWithUndoButton { + display: flex; + gap: 5px; + justify-content: center; + align-items: center; + + .UndoButton { + height: 20px; + border-radius: 3px; + display: flex; + justify-content: center; + align-items: center; + } + } } .BadgeWithUndoButton { From c571081c4cfb8e8882b59627288d5a80d8540fb4 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 2 Mar 2026 13:25:08 +0100 Subject: [PATCH 151/152] Update ResearchTableFilter.js --- .../Tables/filters/ResearchTableFilter.js | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/components/Tables/filters/ResearchTableFilter.js b/components/Tables/filters/ResearchTableFilter.js index 66236cd..4b98955 100644 --- a/components/Tables/filters/ResearchTableFilter.js +++ b/components/Tables/filters/ResearchTableFilter.js @@ -10,9 +10,10 @@ const ResearcherTableFilter = () => { { value: false, label: 'Not Active'}, ]; - const approved = [ - { value: true, label: 'Approved'}, - { value: false, label: 'Not Approved'}, + const status = [ + { value: 'new', label: 'New'}, + { value: 'approved', label: 'Approved'}, + { value: 'suspended', label: 'Suspended'} ]; return ( @@ -26,7 +27,7 @@ const ResearcherTableFilter = () => { className={style.Search}/> -
    + { /> - - + + From 0ab95cc35358caf968476d23b7479e04b65f43d8 Mon Sep 17 00:00:00 2001 From: JoshBone Date: Thu, 12 Mar 2026 16:47:06 +0100 Subject: [PATCH 152/152] Container digital versions --- .../Digitization/DigitizationContainerList.js | 43 +++++++------------ components/Forms/fields/DigitizationForm.js | 2 +- .../fields/finding_aids/ResearchCloudLink.js | 2 +- components/Tables/PopupTable.js | 1 - .../Tables/filters/DigitizationTableFilter.js | 15 ++++--- .../renderDigitalVersionResearchCloud.js | 5 +-- utils/renders/renderLevel.js | 18 ++++++++ 7 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 utils/renders/renderLevel.js diff --git a/components/Digitization/DigitizationContainerList.js b/components/Digitization/DigitizationContainerList.js index 661740f..836df55 100644 --- a/components/Digitization/DigitizationContainerList.js +++ b/components/Digitization/DigitizationContainerList.js @@ -2,14 +2,10 @@ import React from 'react' import PopupTable from "../../components/Tables/PopupTable"; import {renderDigitalVersion} from "../../utils/renders/renderDigitalVersion"; import {renderDigitalVersionResearchCloud} from "../../utils/renders/renderDigitalVersionResearchCloud"; -import moment from "moment/moment"; +import {renderLevel} from "../../utils/renders/renderLevel" import style from "./DigitizationContainerList.module.scss" export default function DigitizationContainerList() { - const renderDate = (data) => { - return (moment(data).format('YYYY-MM-DD')) - } - const renderContainerNo = (data, record) => { return {data} } @@ -20,52 +16,43 @@ export default function DigitizationContainerList() { dataIndex: 'container_no', key: 'container_no', sorter: true, + width: 200, render: renderContainerNo, - width: 200 }, { title: 'Barcode', dataIndex: 'barcode', key: 'barcode', - width: 150, - sorter: true - }, { - title: 'Date Updated', - dataIndex: 'date_updated', - key: 'date_updated', - width: 120, - className: 'centerColumn', - render: renderDate, + width: 140, sorter: true - }, { - title: 'Digital Version', - dataIndex: 'digital_version_exists', - key: 'digital_version_exists', - width: 120, - className: 'centerColumn', - sorter: true, - render: renderDigitalVersion }, { title: 'Research Cloud', - key: 'digital_version_research_cloud', + key: 'available_research_cloud', width: 120, className: 'centerColumn', sorter: true, render: renderDigitalVersionResearchCloud }, { title: 'Online', - dataIndex: 'digital_version_online', - key: 'digital_version_online', + dataIndex: 'available_online', + key: 'available_online', width: 120, className: 'centerColumn', sorter: true, render: renderDigitalVersion }, { title: 'Creation Date (Digital)', - dataIndex: 'digital_version_creation_date', - key: 'digital_version_creation_date', + dataIndex: 'creation_date', + key: 'creation_date', className: 'centerColumn', width: 150, sorter: true + }, { + title: 'Level', + dataIndex: 'level', + key: 'level', + className: 'centerColumn', + width: 80, + render: renderLevel }, { title: 'Duration', dataIndex: 'duration', diff --git a/components/Forms/fields/DigitizationForm.js b/components/Forms/fields/DigitizationForm.js index 3a46046..925792b 100644 --- a/components/Forms/fields/DigitizationForm.js +++ b/components/Forms/fields/DigitizationForm.js @@ -19,7 +19,7 @@ export const DigitizationForm = ({readOnly}) => { return ( - + diff --git a/components/Forms/fields/finding_aids/ResearchCloudLink.js b/components/Forms/fields/finding_aids/ResearchCloudLink.js index 4268cf7..fd3e41d 100644 --- a/components/Forms/fields/finding_aids/ResearchCloudLink.js +++ b/components/Forms/fields/finding_aids/ResearchCloudLink.js @@ -19,7 +19,7 @@ const ResearchCloudLink = ({path, buttonText='Open', isBadge=false}) => { if (isBadge) { return ( - + ) } else { diff --git a/components/Tables/PopupTable.js b/components/Tables/PopupTable.js index 1f1116f..5f6e03e 100644 --- a/components/Tables/PopupTable.js +++ b/components/Tables/PopupTable.js @@ -6,7 +6,6 @@ import style from './Table.module.scss'; import {remove} from "../../utils/api"; import _ from 'lodash'; import {PopupForm} from "../Forms/PopupForm"; -import {useData} from "../../utils/hooks/useData"; import {useTable} from "../../utils/hooks/useTable"; import {deleteAlert} from "./functions/deleteAlert"; diff --git a/components/Tables/filters/DigitizationTableFilter.js b/components/Tables/filters/DigitizationTableFilter.js index 4e8d469..026e758 100644 --- a/components/Tables/filters/DigitizationTableFilter.js +++ b/components/Tables/filters/DigitizationTableFilter.js @@ -10,6 +10,11 @@ const DigitizationTableFilter = () => { { value: 'no', label: 'No'}, ]; + const level = [ + { value: 'A', label: 'Access'}, + { value: 'M', label: 'Master'}, + ] + return ( @@ -33,16 +38,16 @@ const DigitizationTableFilter = () => { - + { - +