From b71fc8ccf9a1dc3bbbc67f6e38d8d20bf86effd5 Mon Sep 17 00:00:00 2001 From: xuemeigan Date: Wed, 5 May 2021 14:00:17 -0400 Subject: [PATCH 01/31] Support-22557-WCAG-issue-Object-store-metadata-bulk-edit-page - Fix Form elements must have labels (3) - Fix Elements must have sufficient color contrast (2) - Fix All page content must be contained by landmarks (1) --- .../lib/bulk-data-editor/BulkDataEditor.tsx | 4 +++ .../formik-connected/ResourceSelectField.tsx | 9 +++++++ .../lib/formik-connected/SelectField.tsx | 10 ++++++- .../pages/object-store/metadata/edit.tsx | 26 +++++++++---------- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx index dbc66b3e48..7280f925bf 100644 --- a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx +++ b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx @@ -129,6 +129,10 @@ export function BulkDataEditor({ .handsontableEditor.autocompleteEditor, .handsontableEditor.autocompleteEditor .ht_master .wtHolder { min-height: 138px; } + /* Fix the place holder color contrast */ + .htPlaceholder.htAutocomplete { + color: rgb(51,51,51); + } `} {validationAlertJsx}
( onChange?.(resource); } + // Fix the place holder text ...Select has not enough contrast ratio to the background issue + const customStyles = { + placeholder: (provided, _) => ({ + ...provided, + color: "rgb(51,51,51)" + }) + }; + return ( ); }} diff --git a/packages/common-ui/lib/formik-connected/SelectField.tsx b/packages/common-ui/lib/formik-connected/SelectField.tsx index 984e89b0e1..f61964f5fd 100644 --- a/packages/common-ui/lib/formik-connected/SelectField.tsx +++ b/packages/common-ui/lib/formik-connected/SelectField.tsx @@ -30,6 +30,14 @@ export function SelectField(props: SelectFieldProps) { ...labelWrapperProps } = props; + // Fix the place holder text ...Select has not enough contrast ratio to the background issue + const customStyles = { + placeholder: (provided, _) => ({ + ...provided, + color: "rgb(51,51,51)" + }) + }; + return ( {({ setValue, value }) => { @@ -58,7 +66,7 @@ export function SelectField(props: SelectFieldProps) { isMulti={isMulti} options={options} onChange={onChangeInternal} - styles={styles} + styles={{ ...styles, ...customStyles }} value={selectedOption} /> ); diff --git a/packages/dina-ui/pages/object-store/metadata/edit.tsx b/packages/dina-ui/pages/object-store/metadata/edit.tsx index 1e2b31fea7..ee14f5bc30 100644 --- a/packages/dina-ui/pages/object-store/metadata/edit.tsx +++ b/packages/dina-ui/pages/object-store/metadata/edit.tsx @@ -28,20 +28,20 @@ export default function EditMetadatasPage() {
); } + +export interface RolesPerGroupEditorProps { + initialRolesPerGroup: Record; +} + +export function RolesPerGroupEditor({ + initialRolesPerGroup +}: RolesPerGroupEditorProps) { + const { groupNames: myGroupNames } = useAccount(); + + const editableRoles = ["staff", "student"]; + + return ( + + ); +} From 8da95f6c703624d29ecbec49287dfd0d61777f21 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Wed, 5 May 2021 20:40:56 +0000 Subject: [PATCH 03/31] Feedback 22551 -Updated the form submit to correctly remove groups. --- .../dina-ui/page-tests/dina-user/__test__/edit.test.tsx | 1 + packages/dina-ui/pages/dina-user/edit.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx b/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx index 4ad83f02c8..2b08f9f361 100644 --- a/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx +++ b/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx @@ -58,6 +58,7 @@ describe("User edit page", () => { { rolesPerGroup: { aafc: ["staff"], + cnc: [], "test-group": ["role1", "role2"] } } diff --git a/packages/dina-ui/pages/dina-user/edit.tsx b/packages/dina-ui/pages/dina-user/edit.tsx index 78578dcf78..914ee5cb72 100644 --- a/packages/dina-ui/pages/dina-user/edit.tsx +++ b/packages/dina-ui/pages/dina-user/edit.tsx @@ -88,6 +88,14 @@ export function DinaUserForm({ if (submittedValues.rolesPerGroup) { updatedUser.rolesPerGroup = submittedValues.rolesPerGroup; + + // Groups are removed by setting an empty roles array, not by removing the array: + const groupsToRemove = keys(initialValues.rolesPerGroup).filter( + groupName => !keys(submittedValues.rolesPerGroup).includes(groupName) + ); + for (const groupToRemove of groupsToRemove) { + updatedUser.rolesPerGroup[groupToRemove] = []; + } } await save( From e5421379022ea973d401bf4df43e5606f31959b5 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Thu, 6 May 2021 17:30:47 +0000 Subject: [PATCH 04/31] Feedback 22568 -Added component type dropdown to managed attribute form. --- packages/dina-ui/intl/dina-ui-en.ts | 2 + .../collection/managed-attribute/edit.tsx | 21 ++++- .../collection/managed-attribute/list.tsx | 91 +++++++++++-------- .../resources/ManagedAttribute.ts | 20 +++- 4 files changed, 92 insertions(+), 42 deletions(-) diff --git a/packages/dina-ui/intl/dina-ui-en.ts b/packages/dina-ui/intl/dina-ui-en.ts index c156869665..82db57c43e 100644 --- a/packages/dina-ui/intl/dina-ui-en.ts +++ b/packages/dina-ui/intl/dina-ui-en.ts @@ -171,6 +171,7 @@ export const DINAUI_MESSAGES_ENGLISH = { field_familyNames_tooltip: "Family name(s) including compound family names", field_givenNames_tooltip: "First and all middle names", field_license: "License", + field_managedAttributeComponent: "Target Data Component Type", field_managedAttributeCreatedOn: "Created On", field_managedAttributeCreatedBy: "Created By", field_managedAttributeMandatoryFieldsError: @@ -221,6 +222,7 @@ export const DINAUI_MESSAGES_ENGLISH = { managedAttributeEditTitle: "Edit Managed Attribute", managedAttributeListTitle: "Managed Attributes", managedAttributeValueLabel: "Value", + materialSample: "Material Sample", metadataAttributesTemplateSave: "Save This Attributes Template", metadataBucketNameLabel: "Bucket Name", metadataBuiltInAttributesLabel: "Built-in Attributes", diff --git a/packages/dina-ui/pages/collection/managed-attribute/edit.tsx b/packages/dina-ui/pages/collection/managed-attribute/edit.tsx index ac303fbfd0..b9c4212642 100644 --- a/packages/dina-ui/pages/collection/managed-attribute/edit.tsx +++ b/packages/dina-ui/pages/collection/managed-attribute/edit.tsx @@ -20,7 +20,10 @@ import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; import { ManagedAttribute, ManagedAttributeType, - MANAGED_ATTRIBUTE_TYPE_OPTIONS + COLLECTION_MODULE_TYPES, + MANAGED_ATTRIBUTE_TYPE_OPTIONS, + CollectionModuleType, + COLLECTION_MODULE_TYPE_LABELS } from "../../../types/collection-api/resources/ManagedAttribute"; interface ManagedAttributeFormFields extends ManagedAttribute { @@ -109,12 +112,18 @@ function ManagedAttributeForm({ ({ labelKey, value }) => ({ label: formatMessage(labelKey), value }) ); + const ATTRIBUTE_COMPONENT_OPTIONS: { + label: string; + value: CollectionModuleType; + }[] = COLLECTION_MODULE_TYPES.map(dataType => ({ + label: formatMessage(COLLECTION_MODULE_TYPE_LABELS[dataType] as any), + value: dataType + })); + const onSubmit: DinaFormOnSubmit = async ({ api: { save }, submittedValues: { acceptedValuesAsLines, ...submittedManagedAttribute } }) => { - submittedManagedAttribute.managedAttributeComponent = "COLLECTING_EVENT"; - // Convert user-suplied string to string array: submittedManagedAttribute.acceptedValues = (acceptedValuesAsLines || "") // Split by line breaks: @@ -162,6 +171,12 @@ function ManagedAttributeForm({
+
+ +
[] = [ - { - Cell: ({ original: { id, name } }) => ( - - {name} - - ), - Header: "Name", - accessor: "name" - }, - "createdBy", - { - Cell: ({ original: { acceptedValues, managedAttributeType } }) => { - const labelKey: - | keyof typeof DINAUI_MESSAGES_ENGLISH - | undefined = acceptedValues?.length - ? "field_managedAttributeType_picklist_label" - : MANAGED_ATTRIBUTE_TYPE_OPTIONS.find( - option => option.value === managedAttributeType - )?.labelKey; +const ATTRIBUTES_FILTER_ATTRIBUTES = ["name"]; + +export default function ManagedAttributesListPage() { + const { formatMessage } = useDinaIntl(); - return
{labelKey && }
; + const ATTRIBUTES_LIST_COLUMNS: ColumnDefinition< + ManagedAttribute + >[] = [ + { + Cell: ({ original: { id, name } }) => ( + + {name} + + ), + Header: "Name", + accessor: "name" + }, + "createdBy", + { + Cell: ({ original }) => { + const ma: ManagedAttribute = original; + return ( +
+ {formatMessage( + COLLECTION_MODULE_TYPE_LABELS[ma.managedAttributeComponent] as any + )} +
+ ); + }, + accessor: "managedAttributeComponent" }, - accessor: "managedAttributeType", - // The API sorts alphabetically by key, not displayed intl-ized value, - // so the displayed order wouldn't make sense. - sortable: false - }, - { - Cell: ({ original: { acceptedValues } }) => ( -
{acceptedValues?.map(val => `"${val}"`)?.join(", ")}
- ), - accessor: "acceptedValues" - } -]; + { + Cell: ({ original: { acceptedValues, managedAttributeType } }) => { + const labelKey: + | keyof typeof DINAUI_MESSAGES_ENGLISH + | undefined = acceptedValues?.length + ? "field_managedAttributeType_picklist_label" + : MANAGED_ATTRIBUTE_TYPE_OPTIONS.find( + option => option.value === managedAttributeType + )?.labelKey; -const ATTRIBUTES_FILTER_ATTRIBUTES = ["name"]; + return
{labelKey && }
; + }, + accessor: "managedAttributeType", + // The API sorts alphabetically by key, not displayed intl-ized value, + // so the displayed order wouldn't make sense. + sortable: false + }, + { + Cell: ({ original: { acceptedValues } }) => ( +
{acceptedValues?.map(val => `"${val}"`)?.join(", ")}
+ ), + accessor: "acceptedValues" + } + ]; -export default function ManagedAttributesListPage() { return (
diff --git a/packages/dina-ui/types/collection-api/resources/ManagedAttribute.ts b/packages/dina-ui/types/collection-api/resources/ManagedAttribute.ts index f4101d06ff..0485d6f02f 100644 --- a/packages/dina-ui/types/collection-api/resources/ManagedAttribute.ts +++ b/packages/dina-ui/types/collection-api/resources/ManagedAttribute.ts @@ -1,11 +1,11 @@ import { KitsuResource } from "kitsu"; import { DINAUI_MESSAGES_ENGLISH } from "../../../intl/dina-ui-en"; -export interface ManagedAttributeAttributes { +export interface ManagedAttributeAttributes { type: string; name: string; managedAttributeType: string; - managedAttributeComponent: string; + managedAttributeComponent: TComponent; acceptedValues?: string[] | null; createdBy?: string; createdOn?: string; @@ -13,6 +13,19 @@ export interface ManagedAttributeAttributes { export type ManagedAttributeType = "INTEGER" | "STRING" | "PICKLIST"; +export const COLLECTION_MODULE_TYPES = [ + "COLLECTING_EVENT", + "MATERIAL_SAMPLE" +] as const; +export type CollectionModuleType = typeof COLLECTION_MODULE_TYPES[number]; +export const COLLECTION_MODULE_TYPE_LABELS: Record< + CollectionModuleType, + string +> = { + COLLECTING_EVENT: "collectingEvent", + MATERIAL_SAMPLE: "materialSample" +}; + export const MANAGED_ATTRIBUTE_TYPE_OPTIONS: { labelKey: keyof typeof DINAUI_MESSAGES_ENGLISH; value: ManagedAttributeType; @@ -31,4 +44,5 @@ export const MANAGED_ATTRIBUTE_TYPE_OPTIONS: { } ]; -export type ManagedAttribute = KitsuResource & ManagedAttributeAttributes; +export type ManagedAttribute = KitsuResource & + ManagedAttributeAttributes; From b71cf277c8127cede3a679d47de42dd294bdfacb Mon Sep 17 00:00:00 2001 From: xuemeigan Date: Fri, 7 May 2021 15:14:49 -0400 Subject: [PATCH 05/31] Support-22557-WCAG-issue-Object-store-metadata-bulk-edit-page -Ensure that scrollable region has keyboard access --- .../lib/bulk-data-editor/BulkDataEditor.tsx | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx index 7280f925bf..00dec7570f 100644 --- a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx +++ b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx @@ -3,6 +3,7 @@ import { FormikContextType, useFormikContext } from "formik"; import { GridSettings } from "handsontable"; import { cloneDeep, isEmpty, isEqual, zipWith } from "lodash"; import dynamic from "next/dynamic"; +import { useLayoutEffect } from "react"; import { Component, useEffect, useState } from "react"; import { PartialDeep } from "type-fest"; import { FormikButton } from "../formik-connected/FormikButton"; @@ -75,7 +76,6 @@ export function BulkDataEditor({ const newWorkingData = cloneDeep(loadedData); await applyCustomDefaultValues?.(newWorkingData); setWorkingTableData(newWorkingData); - setLoading(false); }); @@ -84,6 +84,22 @@ export function BulkDataEditor({ loadDataInternal({}, formik); }, [lastSave]); + useLayoutEffect(() => { + makeHotTableContenHolderFocusable(); + }, []); + + const makeHotTableContenHolderFocusable = () => { + // Fix Ensure that scrollable region has keyboard access (making the scrollable region focusable) + const htHolder = tableWrapperRef.current?.querySelector( + ".ht_master .wtHolder" + ); + + if (htHolder) { + htHolder.style.overflowY = "auto"; + htHolder.tabIndex = 0; + } + }; + // Show initial data loading errors here: const loadingFailed = (!workingTableData || !initialTableData) && formik.status; @@ -132,13 +148,17 @@ export function BulkDataEditor({ /* Fix the place holder color contrast */ .htPlaceholder.htAutocomplete { color: rgb(51,51,51); - } + } `} {validationAlertJsx}
Date: Fri, 7 May 2021 16:28:10 -0400 Subject: [PATCH 06/31] Support-22557-WCAG-issue-Object-store-metadata-bulk-edit-page -Ensure that scrollable region has keyboard access --- .../lib/bulk-data-editor/BulkDataEditor.tsx | 26 +++++++------------ .../bulk-data-editor/useHeaderWidthFix.tsx | 12 +++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx index 00dec7570f..a39064a78a 100644 --- a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx +++ b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx @@ -84,22 +84,6 @@ export function BulkDataEditor({ loadDataInternal({}, formik); }, [lastSave]); - useLayoutEffect(() => { - makeHotTableContenHolderFocusable(); - }, []); - - const makeHotTableContenHolderFocusable = () => { - // Fix Ensure that scrollable region has keyboard access (making the scrollable region focusable) - const htHolder = tableWrapperRef.current?.querySelector( - ".ht_master .wtHolder" - ); - - if (htHolder) { - htHolder.style.overflowY = "auto"; - htHolder.tabIndex = 0; - } - }; - // Show initial data loading errors here: const loadingFailed = (!workingTableData || !initialTableData) && formik.status; @@ -110,6 +94,16 @@ export function BulkDataEditor({ // Show loading state here: if (loading || !workingTableData || !initialTableData) { return ; + } else { + // console.log("tableWrapperRef.current " + tableWrapperRef.current?.innerHTML) ; + // const htHolder = tableWrapperRef.current?.querySelector( + // ".ht_master .wtHolder" + // ); + // console.log("htHolder " + JSON.stringify(htHolder)) ; + // if (htHolder) { + // htHolder.style.overflowY = "auto"; + // htHolder.tabIndex = 0; + // } } const onSubmitInternal: OnFormikSubmit = async ( diff --git a/packages/common-ui/lib/bulk-data-editor/useHeaderWidthFix.tsx b/packages/common-ui/lib/bulk-data-editor/useHeaderWidthFix.tsx index de4c3041be..7a6c8906bd 100644 --- a/packages/common-ui/lib/bulk-data-editor/useHeaderWidthFix.tsx +++ b/packages/common-ui/lib/bulk-data-editor/useHeaderWidthFix.tsx @@ -17,6 +17,16 @@ export function useHeaderWidthFix({ columns }: HeaderWidthFixParams) { setImmediate(() => { const wrapper = tableWrapperRef.current; + const makeHotTableContenHolderFocusable = () => { + // Fix Ensure that scrollable region has keyboard access (making the scrollable region focusable) + const htHolder = wrapper?.querySelector( + ".ht_master .wtHolder" + ); + if (htHolder) { + htHolder.style.overflowY = "auto"; + htHolder.tabIndex = 0; + } + }; if (wrapper) { const header = wrapper.querySelector( ".ht_clone_top .wtHider" @@ -29,6 +39,8 @@ export function useHeaderWidthFix({ columns }: HeaderWidthFixParams) { const requiredHeaderWidth = `${htCore.clientWidth}px`; header.style.width = requiredHeaderWidth; } + + makeHotTableContenHolderFocusable(); } }); }, []); From d23e561b86f927d04ee4dda9ca29a57d1dbe2559 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Mon, 10 May 2021 14:40:56 +0000 Subject: [PATCH 07/31] Feedback 22551 Updated form submit code to remove the json patching workaround. --- .../page-tests/dina-user/__test__/edit.test.tsx | 14 +++++++++++++- packages/dina-ui/pages/dina-user/edit.tsx | 8 -------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx b/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx index 2b08f9f361..b6c19de989 100644 --- a/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx +++ b/packages/dina-ui/page-tests/dina-user/__test__/edit.test.tsx @@ -2,6 +2,18 @@ import { DinaForm } from "common-ui"; import { RolesPerGroupEditor } from "../../../pages/dina-user/edit"; import { mountWithAppContext } from "../../../test-util/mock-app-context"; +const mockGet = jest.fn(async path => { + if (path === "user-api/group") { + return { data: [] }; + } +}); + +const apiContext = { + apiClient: { + get: mockGet + } +}; + describe("User edit page", () => { it("Lets you edit the Roles per Group.", async () => { const mockSubmit = jest.fn(); @@ -21,6 +33,7 @@ describe("User edit page", () => { , { + apiContext, accountContext: { groupNames: ["cnc", "aafc", "test-group"] } @@ -58,7 +71,6 @@ describe("User edit page", () => { { rolesPerGroup: { aafc: ["staff"], - cnc: [], "test-group": ["role1", "role2"] } } diff --git a/packages/dina-ui/pages/dina-user/edit.tsx b/packages/dina-ui/pages/dina-user/edit.tsx index 914ee5cb72..78578dcf78 100644 --- a/packages/dina-ui/pages/dina-user/edit.tsx +++ b/packages/dina-ui/pages/dina-user/edit.tsx @@ -88,14 +88,6 @@ export function DinaUserForm({ if (submittedValues.rolesPerGroup) { updatedUser.rolesPerGroup = submittedValues.rolesPerGroup; - - // Groups are removed by setting an empty roles array, not by removing the array: - const groupsToRemove = keys(initialValues.rolesPerGroup).filter( - groupName => !keys(submittedValues.rolesPerGroup).includes(groupName) - ); - for (const groupToRemove of groupsToRemove) { - updatedUser.rolesPerGroup[groupToRemove] = []; - } } await save( From cdefd05d8678e64da6b85466bc6fac6002406f90 Mon Sep 17 00:00:00 2001 From: Shemy Date: Mon, 10 May 2021 11:08:27 -0400 Subject: [PATCH 08/31] Support-22557-WCAG-issue-Object-store-metadata-bulk-edit-page - Fix handsontable text area sometimes has scrollable area needs focus issue - Fix need to review issue (critical): handsontable readonly cell has insufficient color contrast - Fix need to review issue: handson table autocomplete cell arrow insufficient color contrast --- .../common-ui/lib/bulk-data-editor/BulkDataEditor.tsx | 10 +++++++++- .../lib/bulk-data-editor/useHeaderWidthFix.tsx | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx index a39064a78a..fd01ba90b9 100644 --- a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx +++ b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx @@ -142,7 +142,15 @@ export function BulkDataEditor({ /* Fix the place holder color contrast */ .htPlaceholder.htAutocomplete { color: rgb(51,51,51); - } + } + /* Fix need to review issue (critical): .htDimmed:nth-child(2) need sufficient color contrast */ + .handsontable .htDimmed { + color: rgb(108,117,125); + } + /* Fix need to review issue : ..htAutocompleteArrow need sufficient color contrast */ + .htAutocomplete .htAutocompleteArrow { + color: rgb(108,117,125); + } `} {validationAlertJsx}
( + ".handsontableInputHolder .handsontableInput" + ); + if (textArea) { + textArea.style.height = "auto"; + textArea.tabIndex = 0; + } }; if (wrapper) { const header = wrapper.querySelector( From 9c0c1db5ab3785776b20b7a975f92fe5fb618ae8 Mon Sep 17 00:00:00 2001 From: Shemy Date: Mon, 10 May 2021 12:20:33 -0400 Subject: [PATCH 09/31] - Code cleanup --- .../common-ui/lib/bulk-data-editor/BulkDataEditor.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx index fd01ba90b9..c7462c314d 100644 --- a/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx +++ b/packages/common-ui/lib/bulk-data-editor/BulkDataEditor.tsx @@ -3,7 +3,6 @@ import { FormikContextType, useFormikContext } from "formik"; import { GridSettings } from "handsontable"; import { cloneDeep, isEmpty, isEqual, zipWith } from "lodash"; import dynamic from "next/dynamic"; -import { useLayoutEffect } from "react"; import { Component, useEffect, useState } from "react"; import { PartialDeep } from "type-fest"; import { FormikButton } from "../formik-connected/FormikButton"; @@ -94,16 +93,6 @@ export function BulkDataEditor({ // Show loading state here: if (loading || !workingTableData || !initialTableData) { return ; - } else { - // console.log("tableWrapperRef.current " + tableWrapperRef.current?.innerHTML) ; - // const htHolder = tableWrapperRef.current?.querySelector( - // ".ht_master .wtHolder" - // ); - // console.log("htHolder " + JSON.stringify(htHolder)) ; - // if (htHolder) { - // htHolder.style.overflowY = "auto"; - // htHolder.tabIndex = 0; - // } } const onSubmitInternal: OnFormikSubmit = async ( From 4cbbe05fb64d80d252658eab53ce462a96f4510c Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Mon, 10 May 2021 16:26:08 +0000 Subject: [PATCH 10/31] Feedback 22593 Fixed outdated parts of the docs. --- docs/docker_build.adoc | 6 +++- docs/intl.adoc | 28 ++++++++--------- docs/resource_select_field.adoc | 2 +- docs/useQuery_hook_function.adoc | 20 ++++++++++++ docs/write_operations.adoc | 52 +++++++++++++------------------- docs/yarn_package_scripts.adoc | 20 ++++-------- 6 files changed, 67 insertions(+), 61 deletions(-) diff --git a/docs/docker_build.adoc b/docs/docker_build.adoc index f26d77d699..6f78b5804e 100644 --- a/docs/docker_build.adoc +++ b/docs/docker_build.adoc @@ -1,9 +1,11 @@ = Building the app Docker images -From the top-level directory, run the docker build: +From the top-level directory, run the yarn build and then the docker build: [source,bash] ---- +yarn +yarn workspace dina-ui build docker build -f Dockerfile -t dina-ui:tag . ---- @@ -12,5 +14,7 @@ Docker environment variables required to run: dina-ui: * OBJECTSTORE_API_ADDRESS: The back-end API URL and port. e.g. objectstore-api:8080 +* USER_API_ADDRESS: The back-end API URL and port. e.g. user-api:8080 +* COLLECTION_API_ADDRESS: The back-end API URL and port. e.g. collection-api:8080 * AGENT_API_ADDRESS: The back-end API URL and port. e.g. agent-api:8080 * SEQDB_API_ADDRESS: The back-end API URL and port. e.g. seqdb-api:8080 diff --git a/docs/intl.adoc b/docs/intl.adoc index b966ece55a..1073b8afec 100644 --- a/docs/intl.adoc +++ b/docs/intl.adoc @@ -16,11 +16,11 @@ You should instead reference a message key: [source,tsx] ---- -import { SeqDBMessage } from "../../intl/seqdb-intl.ts"" +import { DinaMessage } from "../../intl/dina-intl.ts"" ... -

+

---- == formatMessage function @@ -29,10 +29,10 @@ You can also use the "formatMessage" function if you want to reference a message [source,tsx] ---- -import { useSeqdbIntl } from "../../seqdb-intl.ts"" +import { useDinaIntl } from "../../dina-intl.ts"" function MyComponent() { - const { formatMessage } = useSeqdbIntl(); + const { formatMessage } = useDinaIntl(); useEffect(() => { alert(formatMessage("greeting")); @@ -46,31 +46,31 @@ function MyComponent() { == Defining messages -The actual text for these messages needs to be defined in a messages file, like seqdb-en.ts. Each UI app -( seqdb-ui, dina-ui, etc. ) should have its own messages files. common-ui has its own messages files -for shared messages used by multiple apps. +The actual text for these messages needs to be defined in a messages file, like dina-en.ts. Each UI app +( dina-ui is the only UI app at the moment ) should have its own messages files. common-ui has its +own messages files for shared messages used by multiple apps. -seqdb-en.ts: +dina-en.ts: [source,tsx] ---- -export const SEQDB_MESSAGES_ENGLISH = { +export const DINA_MESSAGES_ENGLISH = { ... greeting: "Hello!" ... } ---- -Type-checking is enabled so the message ID passed into "SeqDBMessage" or "formatMessage" MUST be a key +Type-checking is enabled so the message ID passed into "DinaMessage" or "formatMessage" MUST be a key in at least the English messages file. To add a French (or other language) translation for a message, the English version of the message must already be defined. The UI uses the English translation as a fallback if the message has no translation for the user's locale. -Example from seqdb-fr.ts: +Example from dina-fr.ts: [source,tsx] ---- -export const SEQDB_MESSAGES_FRENCH: Partial = { +export const DINA_MESSAGES_FRENCH: Partial = { ... greeting: "Bonjour!", // If the key exists in the english messages file, Typescript allows it. otherKey: "C'est un autre message." // If "otherKey" isn't a key in the English messages, this should show an error in your IDE. @@ -89,7 +89,7 @@ Example: [source,tsx] ---- -export const SEQDB_MESSAGES_ENGLISH = { +export const DINA_MESSAGES_ENGLISH = { ... field_name: "Name", "field_group.groupName": "Group Name", @@ -99,7 +99,7 @@ export const SEQDB_MESSAGES_ENGLISH = { [source,tsx] ---- -export const SEQDB_MESSAGES_FRENCH: Partial = { +export const DINA_MESSAGES_FRENCH: Partial = { ... field_name: "Nom", "field_group.groupName": "Nom de Groupe" diff --git a/docs/resource_select_field.adoc b/docs/resource_select_field.adoc index bf6abff6e9..f01106a354 100644 --- a/docs/resource_select_field.adoc +++ b/docs/resource_select_field.adoc @@ -6,7 +6,7 @@ Example usage for selecting a Group from a list: [source,tsx] ---- import { DinaForm, ResourceSelectField } from "common-ui"; -import { Group } from "../types/seqdb-api/resources/Group"; +import { Group } from "../types/user-api/resources/Group"; /** * This page shows a dropdown for selecting a Group. You can type the name of a Group you're diff --git a/docs/useQuery_hook_function.adoc b/docs/useQuery_hook_function.adoc index 9893652334..8ae584a840 100644 --- a/docs/useQuery_hook_function.adoc +++ b/docs/useQuery_hook_function.adoc @@ -46,3 +46,23 @@ function ExampleComponent() { } } ---- + +Using the "withResponse" helper function to render generic loading and error components with minimal code, +instead of writing if/else blocks for each state: +[source,tsx] +---- +import { useQuery, withResponse } from "../components"; +import { PcrPrimer } from "../types/seqdb-api/resources/PcrPrimer"; + +function ExampleComponent() { + const primerQuery = useQuery({ path: "pcrPrimer" }); + + return withResponse(primerQuery, ({ data: primers }) => ( +
+ {primers.map(primer => ( + + ))} +
+ )); +} +---- diff --git a/docs/write_operations.adoc b/docs/write_operations.adoc index 8d8af4a6e5..590f1d10d1 100644 --- a/docs/write_operations.adoc +++ b/docs/write_operations.adoc @@ -1,52 +1,42 @@ = Performing write operations -This application uses React's context API to pass down a "doOperations" function which allows -you to perform write operations against the back-end API. doOperations accepts an array of -operations to perform, so you can submit multiple resource operations in a single transaction. +This application uses React's hooks and context API to provide a "save" function which allows +you to perform write operations against the back-end API. "save" accepts an array of +operations to perform, so you can submit multiple resource operations in a single transaction +in a single HTTP request. -If one operation fails, the entire transaction is cancelled, and doOperations throws a string, -which is an aggregation of all of the error messages. This function relies on the back-end to -support JSONAPI's jsonpatch extension. +If one operation fails, the entire transaction is cancelled, and "save" throws an Error, +which provides an aggregation message of all of the error messages. This function relies on the back-end to +support JSONAPI's jsonpatch extension (implemented by crnk-operations). -Here is a simple example of a component that uses the doOperations function from the context to +Here is a simple example of a component that uses the "save" function from the context to provide a button that creates a new Region with a random name and symbol: [source,tsx] ---- import React from "react"; -import { - ApiClientContext, - ApiClientContextI -} from "../components/api-client/ApiClientContext"; +import { useApiClient } from "common-ui"; -export class NewRegionButton extends React.Component { - public static contextType = ApiClientContext; - public context!: ApiClientContextI; +export funcion NewRegionButton() { + const { save } = useApiClient(); - public render() { - return ; - } - - private createRegion = async () => { - const { doOperations } = this.context; - - await doOperations([ - { - op: "POST", - path: "seqdb-api/region", - value: { - attributes: { + async function createRegion() { + await save( + [ + { + resource: { name: `new-region-${Math.random()}`, seq: "", symbol: `${Math.random()}`, type: "PRIMER" }, - id: -1000, - relationships: {}, type: "region" } - } - ]); + ], + { apiBaseUrl: "/seqdb-api" } + ); }; + + return ; } ---- diff --git a/docs/yarn_package_scripts.adoc b/docs/yarn_package_scripts.adoc index eefca15c06..e475edd678 100644 --- a/docs/yarn_package_scripts.adoc +++ b/docs/yarn_package_scripts.adoc @@ -28,25 +28,17 @@ Generates the production build. === `yarn dev` -Runs the UI application at localhost:8000 in dev mode using https://github.com/zeit/next.js[Next.js]. -If you edit and save a source file, the running application will reload itself. - -This command also sets up an HTTP proxy that redirects requests for localhost:8000/api/* endpoints to -localhost:8080/api/. This lets developers test the app locally with a working backend API. Note that -you must have https://github.com/AAFC-BICoE/seqdb-api[seqdb-api] running at localhost:8080 for the UI -to connect to the API, and you must log into the API by browsing to localhost:8080 and logging in so -the UI can authenticate with the API. +Runs the UI application at localhost:3000 in dev mode using https://github.com/zeit/next.js[Next.js]. +When you save a file, you can refresh the page to see your changes without restarting the app. +Note that this does not let the UI connect to the backend because there is no HTTP proxy set up. See +"https://github.com/poffm/dina-dev" for the full dev mode with a proxy. === `yarn next` Runs the UI application at localhost:3000 in dev mode using https://github.com/zeit/next.js[Next.js]. +When you save a file, you can refresh the page to see your changes without restarting the app. Note that this does not let the UI connect to the backend because there is no HTTP proxy set up. See -the "yarn dev" section for the full dev mode with a proxy. - -=== `yarn start` - -Runs the application in production mode. Requires a build first, which you can generate using -`yarn build`. +"https://github.com/poffm/dina-dev" for the full dev mode with a proxy. === `yarn test` From 857d10e7ca9985e9bd63c3128a3d1c7e849fc097 Mon Sep 17 00:00:00 2001 From: Shemy Date: Mon, 10 May 2021 14:00:16 -0400 Subject: [PATCH 11/31] Support 22584 Add preparation type view - Add preparation type to resource type file - Add list, edit and view preparation type pages - Link to nav and index on home page --- .../dina-ui/components/button-bar/nav/nav.tsx | 5 + packages/dina-ui/intl/dina-ui-en.ts | 4 + .../collection/preparation-type/edit.tsx | 115 ++++++++++++++++++ .../collection/preparation-type/list.tsx | 45 +++++++ .../collection/preparation-type/view.tsx | 81 ++++++++++++ packages/dina-ui/pages/index.tsx | 6 + .../resources/PreparationType.ts | 10 ++ 7 files changed, 266 insertions(+) create mode 100644 packages/dina-ui/pages/collection/preparation-type/edit.tsx create mode 100644 packages/dina-ui/pages/collection/preparation-type/list.tsx create mode 100644 packages/dina-ui/pages/collection/preparation-type/view.tsx create mode 100644 packages/dina-ui/types/collection-api/resources/PreparationType.ts diff --git a/packages/dina-ui/components/button-bar/nav/nav.tsx b/packages/dina-ui/components/button-bar/nav/nav.tsx index bc19020332..bade36291d 100644 --- a/packages/dina-ui/components/button-bar/nav/nav.tsx +++ b/packages/dina-ui/components/button-bar/nav/nav.tsx @@ -262,6 +262,11 @@ function NavCollectionDropdown() {
+ + + + + diff --git a/packages/dina-ui/intl/dina-ui-en.ts b/packages/dina-ui/intl/dina-ui-en.ts index 292b5b83f9..ad8a4e5ea2 100644 --- a/packages/dina-ui/intl/dina-ui-en.ts +++ b/packages/dina-ui/intl/dina-ui-en.ts @@ -19,6 +19,7 @@ export const DINAUI_MESSAGES_ENGLISH = { addPersonTitle: "Add Person", addPersonButtonText: "Add Person", addPersonPopupTooltip: "Add Person without leaving the page", + addPreparationTypeTitle: "Add Preparation Type", addRule: "Add Rule", addRuleSet: "Add Rule Set", agentsSectionTitle: "Agents", @@ -279,6 +280,9 @@ export const DINAUI_MESSAGES_ENGLISH = { personViewTitle: "Person", preparation: "Preparation", preparationData: "Preparation Data", + preparationTypeListTitle: "Preparation Type", + preparationTypeNameLabel: "Preparation Type Name", + preparationTypeViewTitle: "View Preparation Type", primary: "Primary", primaryButton_tooltip: "Make this assertion the primary data point when exported. Only one assertion can be primary", diff --git a/packages/dina-ui/pages/collection/preparation-type/edit.tsx b/packages/dina-ui/pages/collection/preparation-type/edit.tsx new file mode 100644 index 0000000000..ac1ca999f6 --- /dev/null +++ b/packages/dina-ui/pages/collection/preparation-type/edit.tsx @@ -0,0 +1,115 @@ +import { + ApiClientContext, + ButtonBar, + BackButton, + DinaForm, + DinaFormOnSubmit, + SubmitButton, + TextField, + LoadingSpinner, + Query +} from "common-ui"; +import { NextRouter, useRouter } from "next/router"; +import { PreparationType } from "../../../types/collection-api/resources/PreparationType"; +import { useContext } from "react"; +import { Head, Nav, GroupSelectField } from "../../../components"; +import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; + +interface PreparationTypeFormProps { + fetchedPrepType?: PreparationType; + router: NextRouter; +} + +export default function PreparationTypeEditPage() { + const router = useRouter(); + const { + query: { id } + } = router; + const { formatMessage } = useDinaIntl(); + return ( +
+ +
+ ); +} + +function PreparationTypeForm({ + fetchedPrepType, + router +}: PreparationTypeFormProps) { + const { save } = useContext(ApiClientContext); + const { id } = router.query; + const initialValues = fetchedPrepType || { type: "preparation-type" }; + const { formatMessage } = useDinaIntl(); + + const onSubmit: DinaFormOnSubmit = async ({ submittedValues }) => { + await save( + [ + { + resource: submittedValues, + type: "preparation-type" + } + ], + { + apiBaseUrl: "/collection-api" + } + ); + await router.push(`/collection/preparation-type/list`); + }; + + return ( + + + + + +
+
+ +
+
+ +
+
+
+ ); +} diff --git a/packages/dina-ui/pages/collection/preparation-type/list.tsx b/packages/dina-ui/pages/collection/preparation-type/list.tsx new file mode 100644 index 0000000000..7346ec519a --- /dev/null +++ b/packages/dina-ui/pages/collection/preparation-type/list.tsx @@ -0,0 +1,45 @@ +import { ButtonBar, CreateButton, ListPageLayout, dateCell } from "common-ui"; +import Link from "next/link"; +import { Footer, Head, Nav } from "../../../components"; +import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; + +const PREPARATION_TYPE_FILTER_ATTRIBUTES = ["createdBy"]; +const PREPARATION_TYPE_TABLE_COLUMNS = [ + { + Cell: ({ original: { id, name } }) => ( + {name} + ), + accessor: "name", + sortable: false + }, + "createdBy", + dateCell("createdOn") +]; + +export default function preparationTypeListPage() { + const { formatMessage } = useDinaIntl(); + + return ( +
+ +
+ ); +} diff --git a/packages/dina-ui/pages/collection/preparation-type/view.tsx b/packages/dina-ui/pages/collection/preparation-type/view.tsx new file mode 100644 index 0000000000..6209cc718e --- /dev/null +++ b/packages/dina-ui/pages/collection/preparation-type/view.tsx @@ -0,0 +1,81 @@ +import { + BackButton, + ButtonBar, + DinaForm, + FieldView, + useQuery, + withResponse, + EditButton, + DeleteButton +} from "common-ui"; +import { WithRouterProps } from "next/dist/client/with-router"; +import { withRouter } from "next/router"; +import { PreparationType } from "packages/dina-ui/types/collection-api/resources/PreparationType"; +import { Footer, Head, Nav, GroupSelectField } from "../../../components"; +import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; + +export function PreparationTypeDetailsPage({ router }: WithRouterProps) { + const { id } = router.query; + const { formatMessage } = useDinaIntl(); + + const prepTypeQuery = useQuery({ + path: `collection-api/preparation-type/${id}` + }); + + return ( +
+ +
+ ); +} + +export default withRouter(PreparationTypeDetailsPage); diff --git a/packages/dina-ui/pages/index.tsx b/packages/dina-ui/pages/index.tsx index 7b5c9d5e93..a7d0844b96 100644 --- a/packages/dina-ui/pages/index.tsx +++ b/packages/dina-ui/pages/index.tsx @@ -166,6 +166,12 @@ const Home: React.FunctionComponent = () => (
+ + + + + +
  • diff --git a/packages/dina-ui/types/collection-api/resources/PreparationType.ts b/packages/dina-ui/types/collection-api/resources/PreparationType.ts new file mode 100644 index 0000000000..efdf4ce899 --- /dev/null +++ b/packages/dina-ui/types/collection-api/resources/PreparationType.ts @@ -0,0 +1,10 @@ +import { KitsuResource } from "kitsu"; + +export interface PreparationTypeAttributes { + uuid: string; + name: string; + createdBy?: string; + createdOn?: string; +} + +export type PreparationType = KitsuResource & PreparationTypeAttributes; From 06823e7c00c1967c7996e6154b7bcf8c91ae03be Mon Sep 17 00:00:00 2001 From: Shemy Date: Mon, 10 May 2021 14:41:41 -0400 Subject: [PATCH 12/31] Support 22584 Add preparation type view - Add tests --- .../preparation-type/__test__/edit.test.tsx | 133 ++++++++++++++++++ .../preparation-type/__test__/view.test.tsx | 55 ++++++++ 2 files changed, 188 insertions(+) create mode 100644 packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx create mode 100644 packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx diff --git a/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx b/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx new file mode 100644 index 0000000000..3ab74c987b --- /dev/null +++ b/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx @@ -0,0 +1,133 @@ +import { OperationsResponse } from "common-ui"; +import PreparationTypeEditPage from "../../../../pages/collection/preparation-type/edit"; +import { mountWithAppContext } from "../../../../test-util/mock-app-context"; +import { PreparationType } from "../../../../types/collection-api/resources/PreparationType"; + +// Mock out the Link component, which normally fails when used outside of a Next app. +jest.mock("next/link", () => ({ children }) =>
    {children}
    ); + +jest.mock("next/router", () => ({ + useRouter: () => ({ + push: mockPush, + query: mockQuery + }) +})); + +/** Mock next.js' router "push" function for navigating pages. */ +const mockPush = jest.fn(); + +/** The mock URL query string params. */ +let mockQuery: any = {}; + +/** Mock Kitsu "get" method. */ +const mockGet = jest.fn(async model => { + // The get request will return the existing preparation-type. + if (model === "collection-api/preparation-type/1") { + return { data: TEST_PREPARATION_TYPE }; + } +}); + +// Mock API requests: +const mockPatch = jest.fn(); +const apiContext: any = { + apiClient: { get: mockGet, axios: { patch: mockPatch } } +}; + +describe("preparation-type edit page", () => { + beforeEach(() => { + jest.clearAllMocks(); + mockQuery = {}; + }); + it("Provides a form to add a preparation-type.", async () => { + mockPatch.mockReturnValueOnce({ + data: [ + { + data: { + id: "1", + type: "preparation-type" + }, + status: 201 + } + ] as OperationsResponse + }); + + mockQuery = {}; + + const wrapper = mountWithAppContext(, { + apiContext + }); + + wrapper.find(".preparationTypeName input").simulate("change", { + target: { + name: "name", + value: "updated Name" + } + }); + // Submit the form. + wrapper.find("form").simulate("submit"); + await new Promise(setImmediate); + + expect(mockPatch).lastCalledWith( + "/collection-api/operations", + [ + { + op: "POST", + path: "preparation-type", + value: { + attributes: {name: "updated Name"}, + id: "00000000-0000-0000-0000-000000000000", + type: "preparation-type" + } + } + ], + expect.anything() + ); + + // The user should be redirected to the new preparation-type's details page. + expect(mockPush).lastCalledWith("/collection/preparation-type/list"); + }); + + it("Renders an error after form submit without specifying madatory field.", async done => { + // The patch request will return an error. + mockPatch.mockImplementationOnce(() => ({ + data: [ + { + errors: [ + { + detail: "Name is mandatory", + status: "422", + title: "Constraint violation" + } + ], + status: 422 + } + ] as OperationsResponse + })); + + mockQuery = {}; + + const wrapper = mountWithAppContext(, { + apiContext + }); + + wrapper.find("form").simulate("submit"); + + setImmediate(() => { + wrapper.update(); + expect(wrapper.find(".alert.alert-danger").text()).toEqual( + "Constraint violation: Name is mandatory" + ); + expect(mockPush).toBeCalledTimes(0); + done(); + }); + }); +}); + +/** Test preparation-type with all fields defined. */ + +const TEST_PREPARATION_TYPE: PreparationType = { + uuid: "617a27e2-8145-4077-a4a5-65af3de416d7", + id: "1", + name: "test preparation type", + type: "preparation-type" +}; diff --git a/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx b/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx new file mode 100644 index 0000000000..bf9ca1679f --- /dev/null +++ b/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx @@ -0,0 +1,55 @@ +import { PreparationTypeDetailsPage } from "../../../../pages/collection/preparation-type/view"; +import { mountWithAppContext } from "../../../../test-util/mock-app-context"; +import { PreparationType } from "../../../../types/collection-api/resources/PreparationType"; + +/** Test preparation-type with all fields defined. */ +const TEST_PREPARATION_TYPE: PreparationType = { + uuid: "617a27e2-8145-4077-a4a5-65af3de416d7", + id: "1", + name: "test preparation type", + type: "preparation-type" +}; + +/** Mock Kitsu "get" method. */ +const mockGet = jest.fn(async model => { + // The get request will return the existing preparation-type. + if (model === "collection-api/preparation-type/100") { + return { data: TEST_PREPARATION_TYPE }; + } +}); + +// Mock out the Link component, which normally fails when used outside of a Next app. +jest.mock("next/link", () => () =>
    ); + +// Mock API requests: +const apiContext = { + apiClient: { get: mockGet } +}; + +describe("PreparationType details page", () => { + it("Renders initially with a loading spinner.", () => { + const wrapper = mountWithAppContext( + , + { apiContext } + ); + + expect(wrapper.find(".spinner-border").exists()).toEqual(true); + }); + + it("Render the PreparationType details", async () => { + const wrapper = mountWithAppContext( + , + { apiContext } + ); + + // Wait for the page to load. + await new Promise(setImmediate); + wrapper.update(); + + expect(wrapper.find(".spinner-border").exists()).toEqual(false); + + expect(wrapper.find(".name-field .field-view").text()).toEqual( + "test preparation type" + ); + }); +}); From 90513fb0912047cae813d3499945c58c6da8c689 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Mon, 10 May 2021 19:25:32 +0000 Subject: [PATCH 13/31] Feedback 22596 -Updated dependencies with vulnerabilities + related peer dependencies. -Removed some dependencies not in use anymore. --- package.json | 15 +- packages/common-ui/package.json | 18 +- packages/dina-ui/jest.config.js | 3 +- packages/dina-ui/package.json | 1 - yarn.lock | 417 +++++--------------------------- 5 files changed, 73 insertions(+), 381 deletions(-) diff --git a/package.json b/package.json index ce3078d112..113dcdbf8d 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "@babel/runtime-corejs2": "^7.10.4", "@phenomnomnominal/tsquery": "^4.1.1", "@types/enzyme": "^3.10.8", - "@types/enzyme-to-json": "^1.5.4", - "@types/jest": "^26.0.20", + "@types/jest": "^26.0.23", "@types/node": "^14.0.14", "@types/react-test-renderer": "^16.0.3", "@wojtekmaj/enzyme-adapter-react-17": "^0.4.1", @@ -26,26 +25,30 @@ "babel-jest": "^26.6.3", "babel-plugin-react-require": "^3.1.3", "enzyme": "^3.11.0", - "enzyme-to-json": "^3.6.1", - "husky": "^3.0.9", + "husky": "^6.0.0", "identity-obj-proxy": "^3.0.0", "jest": "^26.6.3", + "jsonapi-typescript": "^0.1.3", "lint-staged": "^10.2.11", "npm-run-all": "^4.1.5", "pa11y-ci": "^2.3.0", "prettier": "^2.0.5", "react-test-renderer": "^16.8.6", - "ts-jest": "^26.4.4", + "ts-jest": "^26.5.6", "ts-node": "^9.0.0", "tslint": "^6.1.2", "tslint-config-prettier": "^1.18.0", "tslint-plugin-prettier": "^2.3.0", "tslint-react": "^5.0.0", - "typescript": "^4.1.3", + "typescript": "^4.2.4", "xlsx": "^0.16.7" }, "resolutions": { "**/kitsu/axios": "^0.21.1", + "**/lodash": "^4.17.21", + "**/react-file-viewer/**/three": "^0.125.0", + "**/react-file-viewer/**/underscore": "^1.13.1", + "**/react-file-viewer/**/lodash": "^4.17.21", "**/type-fest": "^1.0.2" }, "husky": { diff --git a/packages/common-ui/package.json b/packages/common-ui/package.json index 72bd995bdb..31887087ed 100644 --- a/packages/common-ui/package.json +++ b/packages/common-ui/package.json @@ -13,9 +13,6 @@ "@molgenis/rsql": "0.1.2", "@react-keycloak/nextjs": "^2.0.0-beta.6", "@rehooks/local-storage": "^2.4.0", - "@testing-library/dom": "^7.29.4", - "@testing-library/jest-dom": "^5.11.9", - "@testing-library/user-event": "^12.7.1", "axios-extensions": "^3.1.3", "core-js": "^3.6.5", "custom-event": "^1.0.1", @@ -25,15 +22,15 @@ "keycloak-js": "^10.0.2", "kitsu": "7.0.4", "kitsu-core": "7.0.4", - "lodash": "^4.17.19", + "lodash": "^4.17.21", "lru-cache": "^6.0.0", "next": "^10.0.5", "node-localstorage": "^2.1.6", "rc-tooltip": "^5.0.1", - "react": "^17.0.1", + "react": "^17.0.2", "react-autosuggest": "^10.1.0", "react-datepicker": "^3.0.0", - "react-dom": "^17.0.1", + "react-dom": "^17.0.2", "react-error-boundary": "^3.1.0", "react-hooks-async": "^3.10.1", "react-intl": "^5.0.2", @@ -48,16 +45,15 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@types/lodash": "^4.14.119", - "@types/react": "^16.9.41", + "@types/lodash": "^4.14.168", + "@types/react": "^17.0.5", "@types/react-autosuggest": "^10.0.1", "@types/react-datepicker": "^3.0.2", - "@types/react-dom": "^16.9.8", + "@types/react-dom": "^17.0.3", "@types/react-modal": "^3.10.6", "@types/react-select": "^3.0.14", "@types/react-table": "^6.7.2", - "@types/styled-jsx": "^2.2.7", - "jsonapi-typescript": "^0.1.3" + "@types/styled-jsx": "^2.2.7" }, "lint-staged": { "*.{ts,tsx}": [ diff --git a/packages/dina-ui/jest.config.js b/packages/dina-ui/jest.config.js index 588208e3dc..66506e8f26 100644 --- a/packages/dina-ui/jest.config.js +++ b/packages/dina-ui/jest.config.js @@ -20,6 +20,5 @@ module.exports = { "^.+\\.tsx?$": "babel-jest", }, // Transform our local common-ui package - transformIgnorePatterns: [`/node_modules/(?!common-ui)`], - snapshotSerializers: ["enzyme-to-json/serializer"], + transformIgnorePatterns: [`/node_modules/(?!common-ui)`] }; diff --git a/packages/dina-ui/package.json b/packages/dina-ui/package.json index 5fe2a85eff..ebbb5256b3 100644 --- a/packages/dina-ui/package.json +++ b/packages/dina-ui/package.json @@ -31,7 +31,6 @@ "react-tabs": "^3.0.0" }, "devDependencies": { - "@testing-library/react": "^10.4.4", "@types/bytes": "^3.1.0" }, "lint-staged": { diff --git a/yarn.lock b/yarn.lock index 2f7bce32fc..5fcc2313e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -270,14 +270,6 @@ core-js "^2.6.5" regenerator-runtime "^0.13.4" -"@babel/runtime-corejs3@^7.10.2": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.13.10.tgz#14c3f4c85de22ba88e8e86685d13e8861a82fe86" - integrity sha512-x/XYVQ1h684pp1mJwOV4CyvqZXqbc8CMsMGUnAbuc82ZCdv1U63w5RSUzgDSXQHG5Rps/kiksH6g2D5BuaKyXg== - dependencies: - core-js-pure "^3.0.0" - regenerator-runtime "^0.13.4" - "@babel/runtime@7.12.5": version "7.12.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" @@ -292,14 +284,14 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.0": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.1", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.0": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.2.0", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.2.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.13.tgz#0a21452352b02542db0ffb928ac2d3ca7cb6d66d" integrity sha512-8+3UMPBrjFa/6TtKi/7sehPKqfAm4g6K+YQjyyFOLUTxzOngcRZTlAVY8sc2CORJYqdHQY8gRPHmn+qo15rCBw== @@ -692,16 +684,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.5.0.tgz#4d6a4793f7b9599fc3680877b856a97dbccf2a9d" - integrity sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - "@jest/types@^26.1.0": version "26.1.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.1.0.tgz#f8afaaaeeb23b5cad49dd1f7779689941dcb6057" @@ -822,54 +804,6 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@testing-library/dom@^7.22.3", "@testing-library/dom@^7.29.4": - version "7.30.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.30.0.tgz#53697851f7708a1448cc30b74a2ea056dd709cd6" - integrity sha512-v4GzWtltaiDE0yRikLlcLAfEiiK8+ptu6OuuIebm9GdC2XlZTNDPGEfM2UkEtnH7hr9TRq2sivT5EA9P1Oy7bw== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^4.2.2" - chalk "^4.1.0" - dom-accessibility-api "^0.5.4" - lz-string "^1.4.4" - pretty-format "^26.6.2" - -"@testing-library/jest-dom@^5.11.9": - version "5.11.9" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.11.9.tgz#e6b3cd687021f89f261bd53cbe367041fbd3e975" - integrity sha512-Mn2gnA9d1wStlAIT2NU8J15LNob0YFBVjs2aEQ3j8rsfRQo+lAs7/ui1i2TGaJjapLmuNPLTsrm+nPjmZDwpcQ== - dependencies: - "@babel/runtime" "^7.9.2" - "@types/testing-library__jest-dom" "^5.9.1" - aria-query "^4.2.2" - chalk "^3.0.0" - css "^3.0.0" - css.escape "^1.5.1" - lodash "^4.17.15" - redent "^3.0.0" - -"@testing-library/react@^10.4.4": - version "10.4.9" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-10.4.9.tgz#9faa29c6a1a217bf8bbb96a28bd29d7a847ca150" - integrity sha512-pHZKkqUy0tmiD81afs8xfiuseXfU/N7rAX3iKjeZYje86t9VaB0LrxYVa+OOsvkrveX5jCK3IjajVn2MbePvqA== - dependencies: - "@babel/runtime" "^7.10.3" - "@testing-library/dom" "^7.22.3" - -"@testing-library/user-event@^12.7.1": - version "12.8.3" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-12.8.3.tgz#1aa3ed4b9f79340a1e1836bc7f57c501e838704a" - integrity sha512-IR0iWbFkgd56Bu5ZI/ej8yQwrkCv8Qydx6RzwbKz9faXazR/+5tvYKsZQgyXJiwgpcva127YO6JcWy7YlCfofQ== - dependencies: - "@babel/runtime" "^7.12.5" - -"@types/aria-query@^4.2.0": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.1.tgz#78b5433344e2f92e8b306c06a5622c50c245bf6b" - integrity sha512-S6oPal772qJZHoRZLFc/XoZW2gFvwXusYUmXPXkgxJLuEk2vOt7jc4Yo6z/vtI0EBkbPBVrJJ0B+prLIKiWqHg== - "@types/asap@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/asap/-/asap-2.0.0.tgz#d529e9608c83499a62ae08c871c5e62271aa2963" @@ -927,28 +861,6 @@ dependencies: "@types/node" "*" -"@types/cheerio@^0.22.22": - version "0.22.23" - resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.23.tgz#74bcfee9c5ee53f619711dca953a89fe5cfa4eb4" - integrity sha512-QfHLujVMlGqcS/ePSf3Oe5hK3H8wi/yN2JYuxSB1U10VvW1fO3K8C+mURQesFYS1Hn7lspOsTT75SKq/XtydQg== - dependencies: - "@types/node" "*" - -"@types/enzyme-to-json@^1.5.4": - version "1.5.4" - resolved "https://registry.yarnpkg.com/@types/enzyme-to-json/-/enzyme-to-json-1.5.4.tgz#17104deebdd52305adafa5b17c8423511d4390eb" - integrity sha512-fVVzq0fYyzv+P/elB0HtTIpltNXK8Fs4LxGpTdQQ6cQMPNbVm3aZQkCYalBfZip2hTo8kNLtGTH8phP+Pi2FOw== - dependencies: - "@types/enzyme" "*" - -"@types/enzyme@*": - version "3.10.5" - resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.5.tgz#fe7eeba3550369eed20e7fb565bfb74eec44f1f0" - integrity sha512-R+phe509UuUYy9Tk0YlSbipRpfVtIzb/9BHn5pTEtjJTF5LXvUjrIQcZvNyANNEyFrd2YGs196PniNT1fgvOQA== - dependencies: - "@types/cheerio" "*" - "@types/react" "*" - "@types/enzyme@^3.10.8": version "3.10.8" resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.8.tgz#ad7ac9d3af3de6fd0673773123fafbc63db50d42" @@ -1004,23 +916,15 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@*", "@types/jest@^26.0.20": - version "26.0.20" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" - integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== +"@types/jest@^26.0.23": + version "26.0.23" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7" + integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" -"@types/jest@26.x": - version "26.0.14" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.14.tgz#078695f8f65cb55c5a98450d65083b2b73e5a3f3" - integrity sha512-Hz5q8Vu0D288x3iWXePSn53W7hAjP0H7EQ6QvDO9c7t46mR0lNOLlfuwQ+JkVxuhygHzlzPX+0jKdA3ZgSh+Vg== - dependencies: - jest-diff "^25.2.1" - pretty-format "^25.2.1" - -"@types/lodash@^4.14.119": +"@types/lodash@^4.14.168": version "4.14.168" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008" integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q== @@ -1071,20 +975,13 @@ date-fns "^2.0.1" popper.js "^1.14.1" -"@types/react-dom@*": +"@types/react-dom@*", "@types/react-dom@^17.0.3": version "17.0.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.3.tgz#7fdf37b8af9d6d40127137865bb3fff8871d7ee1" integrity sha512-4NnJbCeWE+8YBzupn/YrJxZ8VnjcJq5iR1laqQ1vkpQgBiA7bwk0Rp24fxsdNinzJY2U+HHS4dJJDPdoMjdJ7w== dependencies: "@types/react" "*" -"@types/react-dom@^16.9.8": - version "16.9.12" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.12.tgz#55cd6b17e73922edb9545e5355a0016c1734e6f4" - integrity sha512-i7NPZZpPte3jtVOoW+eLB7G/jsX5OM6GqQnH+lC0nq0rqwlK0x8WcMEvYDgFWqWhWMlTltTimzdMax6wYfZssA== - dependencies: - "@types/react" "^16" - "@types/react-modal@^3.10.6": version "3.12.0" resolved "https://registry.yarnpkg.com/@types/react-modal/-/react-modal-3.12.0.tgz#91fa86a76fd7fc57e36d2cf9b76efe5735a855a1" @@ -1131,7 +1028,7 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^16", "@types/react@^16.9.41": +"@types/react@^16": version "16.14.5" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.5.tgz#2c39b5cadefaf4829818f9219e5e093325979f4d" integrity sha512-YRRv9DNZhaVTVRh9Wmmit7Y0UFhEVqXqCSw3uazRWMxa2x85hWQZ5BN24i7GXZbaclaLXEcodEeIHsjBA8eAMw== @@ -1140,6 +1037,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17.0.5": + version "17.0.5" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.5.tgz#3d887570c4489011f75a3fc8f965bf87d09a1bea" + integrity sha512-bj4biDB9ZJmGAYTWSKJly6bMr4BLUiBrx9ujiJEoP9XIDY9CTaPGxE5QWN/1WjpPLzYF7/jRNnV2nNxNe970sw== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/scheduler@*": version "0.16.1" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" @@ -1162,13 +1068,6 @@ dependencies: "@types/react" "*" -"@types/testing-library__jest-dom@^5.9.1": - version "5.9.5" - resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.9.5.tgz#5bf25c91ad2d7b38f264b12275e5c92a66d849b0" - integrity sha512-ggn3ws+yRbOHog9GxnXiEZ/35Mow6YtPZpd7Z5mKDeZS/o7zx3yAle0ov/wjhVB5QT4N2Dt+GNoGCdqkBGCajQ== - dependencies: - "@types/jest" "*" - "@types/yargs-parser@*": version "20.2.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" @@ -1359,14 +1258,6 @@ argparse@^1.0.7, argparse@~1.0.3: dependencies: sprintf-js "~1.0.2" -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -1929,25 +1820,6 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2014,15 +1886,7 @@ chalk@4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== @@ -2287,9 +2151,6 @@ commander@~2.17.1: "@molgenis/rsql" "0.1.2" "@react-keycloak/nextjs" "^2.0.0-beta.6" "@rehooks/local-storage" "^2.4.0" - "@testing-library/dom" "^7.29.4" - "@testing-library/jest-dom" "^5.11.9" - "@testing-library/user-event" "^12.7.1" axios-extensions "^3.1.3" core-js "^3.6.5" custom-event "^1.0.1" @@ -2299,15 +2160,15 @@ commander@~2.17.1: keycloak-js "^10.0.2" kitsu "7.0.4" kitsu-core "7.0.4" - lodash "^4.17.19" + lodash "^4.17.21" lru-cache "^6.0.0" next "^10.0.5" node-localstorage "^2.1.6" rc-tooltip "^5.0.1" - react "^17.0.1" + react "^17.0.2" react-autosuggest "^10.1.0" react-datepicker "^3.0.0" - react-dom "^17.0.1" + react-dom "^17.0.2" react-error-boundary "^3.1.0" react-hooks-async "^3.10.1" react-intl "^5.0.2" @@ -2373,11 +2234,6 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-pure@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.9.1.tgz#677b322267172bd490e4464696f790cbc355bec5" - integrity sha512-laz3Zx0avrw9a4QEIdmIblnVuJz8W51leY9iLThatCsFawWxC3sE4guASC78JbCin+DkwMpCdp1AVAuzL/GN7A== - core-js@^2.6.5: version "2.6.12" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" @@ -2393,16 +2249,6 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" @@ -2534,20 +2380,11 @@ css-what@^4.0.0: resolved "https://registry.yarnpkg.com/css-what/-/css-what-4.0.0.tgz#35e73761cab2eeb3d3661126b23d7aa0e8432233" integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== -css.escape@1.5.1, css.escape@^1.5.1: +css.escape@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s= -css@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" - integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== - dependencies: - inherits "^2.0.4" - source-map "^0.6.1" - source-map-resolve "^0.6.0" - cssnano-preset-simple@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-1.2.2.tgz#c631bf79ffec7fdfc4069e2f2da3ca67d99d8413" @@ -2764,11 +2601,6 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== -diff-sequences@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" - integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== - diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -2804,11 +2636,6 @@ dnd-core-cjs@^9.5.1: invariant "^2.2.4" redux "^4.0.4" -dom-accessibility-api@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz#b06d059cdd4a4ad9a79275f9d414a5c126241166" - integrity sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ== - dom-align@^1.7.0: version "1.12.0" resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.0.tgz#56fb7156df0b91099830364d2d48f88963f5a29c" @@ -3019,15 +2846,6 @@ enzyme-shallow-equal@^1.0.4: has "^1.0.3" object-is "^1.1.2" -enzyme-to-json@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.6.1.tgz#d60740950bc7ca6384dfe6fe405494ec5df996bc" - integrity sha512-15tXuONeq5ORoZjV/bUo2gbtZrN2IH+Z6DvL35QmZyKHgbY1ahn6wcnLd9Xv9OjiwbAXiiP8MRZwbZrCv1wYNg== - dependencies: - "@types/cheerio" "^0.22.22" - lodash "^4.17.15" - react-is "^16.12.0" - enzyme@^3.11.0: version "3.11.0" resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.11.0.tgz#71d680c580fe9349f6f5ac6c775bc3e6b7a79c28" @@ -3063,7 +2881,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: +es-abstract@^1.17.0-next.1, es-abstract@^1.17.5, es-abstract@^1.18.0-next.2: version "1.18.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== @@ -3456,9 +3274,9 @@ find-up@^4.0.0, find-up@^4.1.0: path-exists "^4.0.0" follow-redirects@^1.10.0: - version "1.13.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" - integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA== + version "1.14.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" + integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== for-in@^1.0.2: version "1.0.2" @@ -3598,11 +3416,6 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stdin@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" - integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== - get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -3925,22 +3738,10 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -husky@^3.0.9: - version "3.1.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.1.0.tgz#5faad520ab860582ed94f0c1a77f0f04c90b57c0" - integrity sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ== - dependencies: - chalk "^2.4.2" - ci-info "^2.0.0" - cosmiconfig "^5.2.1" - execa "^1.0.0" - get-stdin "^7.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" - please-upgrade-node "^3.2.0" - read-pkg "^5.2.0" - run-node "^1.0.0" - slash "^3.0.0" +husky@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" + integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== iconv-lite@0.4.24: version "0.4.24" @@ -3961,14 +3762,6 @@ ieee754@^1.1.4: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - import-fresh@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -4168,11 +3961,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - is-docker@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" @@ -4447,16 +4235,6 @@ jest-config@^26.6.3: micromatch "^4.0.2" pretty-format "^26.6.2" -jest-diff@^25.2.1: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" - integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== - dependencies: - chalk "^3.0.0" - diff-sequences "^25.2.6" - jest-get-type "^25.2.6" - pretty-format "^25.5.0" - jest-diff@^26.0.0, jest-diff@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" @@ -4515,11 +4293,6 @@ jest-environment-node@^26.6.2: jest-mock "^26.6.2" jest-util "^26.6.2" -jest-get-type@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" - integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== - jest-get-type@^26.3.0: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" @@ -5125,27 +4898,12 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^3.5.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" - integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= - -lodash@^4.15.0, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - -lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.19, lodash@~4.17.20: +lodash@4.x, lodash@^3.5.0, lodash@^4.15.0, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@~4.17.20: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5202,11 +4960,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lz-string@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" - integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= - make-dir@^3.0.0, make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -5338,11 +5091,6 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -5810,11 +5558,6 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -opencollective-postinstall@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - option@~0.2.1: version "0.2.4" resolved "https://registry.yarnpkg.com/option/-/option-0.2.4.tgz#fd475cdf98dcabb3cb397a3ba5284feb45edbfe4" @@ -6225,16 +5968,6 @@ prettier@^2.0.5: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== -pretty-format@^25.2.1, pretty-format@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" - integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== - dependencies: - "@jest/types" "^25.5.0" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^16.12.0" - pretty-format@^26.0.0, pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" @@ -6516,7 +6249,7 @@ react-dnd-html5-backend-cjs@^9.4.0: dependencies: dnd-core-cjs "^9.5.1" -react-dom@^17.0.1: +react-dom@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== @@ -6749,7 +6482,7 @@ react-visibility-sensor@^5.0.2: dependencies: prop-types "^15.7.2" -react@^17.0.1: +react@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== @@ -6814,14 +6547,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - redux@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f" @@ -6935,11 +6660,6 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -7026,11 +6746,6 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== -run-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" - integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== - rxjs@^6.5.5: version "6.6.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.0.tgz#af2901eedf02e3a83ffa7f886240ff9018bbec84" @@ -7298,14 +7013,6 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - source-map-support@^0.5.17, source-map-support@^0.5.6: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -7502,12 +7209,13 @@ string-width@^4.1.0, string-width@^4.2.0: strip-ansi "^6.0.0" string.prototype.padend@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.0.tgz#dc08f57a8010dc5c153550318f67e13adbb72ac3" - integrity sha512-3aIv8Ffdp8EZj8iLwREGpQaUZiPyrWrpzMBHvkiSW/bK/EGve9np07Vwy7IJ5waydpGXzQZu/F8Oze2/IWkBaA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz#6858ca4f35c5268ebd5e8615e1327d55f59ee311" + integrity sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ== dependencies: + call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" + es-abstract "^1.18.0-next.2" string.prototype.trim@^1.2.1: version "1.2.1" @@ -7607,13 +7315,6 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - styled-jsx@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-3.3.2.tgz#2474601a26670a6049fb4d3f94bd91695b3ce018" @@ -7713,10 +7414,10 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -three@0.85.2: - version "0.85.2" - resolved "https://registry.yarnpkg.com/three/-/three-0.85.2.tgz#8936f89c3668f7bf12f9b085ddf5dd409916ea27" - integrity sha1-iTb4nDZo978S+bCF3fXdQJkW6ic= +three@0.85.2, three@^0.125.0: + version "0.125.2" + resolved "https://registry.yarnpkg.com/three/-/three-0.125.2.tgz#dcba12749a2eb41522e15212b919cd3fbf729b12" + integrity sha512-7rIRO23jVKWcAPFdW/HREU2NZMGWPBZ4XwEMt0Ak0jwLUKVJhcKM55eCBWyGZq/KiQbeo1IeuAoo/9l2dzhTXA== throat@^5.0.0: version "5.0.0" @@ -7836,18 +7537,17 @@ tryer@^1.0.0: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== -ts-jest@^26.4.4: - version "26.4.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.4.tgz#61f13fb21ab400853c532270e52cc0ed7e502c49" - integrity sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg== +ts-jest@^26.5.6: + version "26.5.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" + integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== dependencies: - "@types/jest" "26.x" bs-logger "0.x" buffer-from "1.x" fast-json-stable-stringify "2.x" jest-util "^26.1.0" json5 "2.x" - lodash.memoize "4.x" + lodash "4.x" make-error "1.x" mkdirp "1.x" semver "7.x" @@ -7990,10 +7690,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" - integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== +typescript@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== unbox-primitive@^1.0.0: version "1.0.0" @@ -8005,15 +7705,10 @@ unbox-primitive@^1.0.0: has-symbols "^1.0.0" which-boxed-primitive "^1.0.1" -underscore@~1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" - integrity sha1-YaajIBBiKvoHljvzJSA88SI51gQ= - -underscore@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" - integrity sha1-izixDKze9jM3uLJOT/htRa6lKag= +underscore@^1.13.1, underscore@~1.4.4, underscore@~1.6.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1" + integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g== union-value@^1.0.0: version "1.0.1" From 84774f07eaae39982bfa762acf30e7b3f43e51ec Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Mon, 10 May 2021 19:32:22 +0000 Subject: [PATCH 14/31] Feedback 22596 Updated husky config for v6. --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 8 ++------ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..368e6c0d95 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn workspaces run lint-staged diff --git a/package.json b/package.json index 113dcdbf8d..7eb3bf45e1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint": "yarn workspaces run lint", "lint:fix": "yarn workspaces run lint:fix", "test": "yarn workspaces run test", - "test:coverage": "yarn workspaces run test:coverage" + "test:coverage": "yarn workspaces run test:coverage", + "prepare": "husky install" }, "devDependencies": { "@babel/runtime-corejs2": "^7.10.4", @@ -50,10 +51,5 @@ "**/react-file-viewer/**/underscore": "^1.13.1", "**/react-file-viewer/**/lodash": "^4.17.21", "**/type-fest": "^1.0.2" - }, - "husky": { - "hooks": { - "pre-commit": "yarn workspaces run lint-staged" - } } } From 812d1d945929219015ef0ea17450ae336fed2a5c Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Mon, 10 May 2021 20:21:33 +0000 Subject: [PATCH 15/31] 22584 -Fixed the list item style on the home page. -Made the name column sortable. --- .../pages/collection/preparation-type/list.tsx | 3 +-- packages/dina-ui/pages/index.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/dina-ui/pages/collection/preparation-type/list.tsx b/packages/dina-ui/pages/collection/preparation-type/list.tsx index 7346ec519a..06ed6f1b05 100644 --- a/packages/dina-ui/pages/collection/preparation-type/list.tsx +++ b/packages/dina-ui/pages/collection/preparation-type/list.tsx @@ -9,8 +9,7 @@ const PREPARATION_TYPE_TABLE_COLUMNS = [ Cell: ({ original: { id, name } }) => ( {name} ), - accessor: "name", - sortable: false + accessor: "name" }, "createdBy", dateCell("createdOn") diff --git a/packages/dina-ui/pages/index.tsx b/packages/dina-ui/pages/index.tsx index a7d0844b96..3b7dc60f94 100644 --- a/packages/dina-ui/pages/index.tsx +++ b/packages/dina-ui/pages/index.tsx @@ -166,11 +166,13 @@ const Home: React.FunctionComponent = () => (
  • - - - - - +
  • + + + + + +
  • From bc489c54bdebff743aa7f832a26ee600990a228f Mon Sep 17 00:00:00 2001 From: Shemy Date: Tue, 11 May 2021 09:34:02 -0400 Subject: [PATCH 16/31] Support 22585 Add Habitat field to collecting event view - Add the field to resource type file - Add the field to verbatim label section --- .../dina-ui/components/collection/CollectingEventFormLayout.tsx | 1 + .../dina-ui/types/collection-api/resources/CollectingEvent.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx index 15431dece4..f4c07bf285 100644 --- a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx +++ b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx @@ -469,6 +469,7 @@ export function CollectingEventFormLayout({
  • + name="dwcVerbatimSRS" configQuery={() => ({ diff --git a/packages/dina-ui/types/collection-api/resources/CollectingEvent.ts b/packages/dina-ui/types/collection-api/resources/CollectingEvent.ts index 4ce79ef488..fd48fc9e78 100644 --- a/packages/dina-ui/types/collection-api/resources/CollectingEvent.ts +++ b/packages/dina-ui/types/collection-api/resources/CollectingEvent.ts @@ -40,6 +40,8 @@ export interface CollectingEventAttributes { geographicPlaceNameSourceDetail?: GeographicPlaceNameSourceDetail; geographicPlaceNameSource?: GeographicPlaceNameSource; srcAdminLevels?: SourceAdministrativeLevel[]; + + habitat?: string; } export enum GeographicPlaceNameSource { From 90cd4b5199d9f5a9d6c96540f77d48af93778a45 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Tue, 11 May 2021 14:46:04 +0000 Subject: [PATCH 17/31] Fixed material sample list's "name" column to show the correct value. --- packages/dina-ui/pages/collection/material-sample/list.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/dina-ui/pages/collection/material-sample/list.tsx b/packages/dina-ui/pages/collection/material-sample/list.tsx index 8b024af490..23bca2e140 100644 --- a/packages/dina-ui/pages/collection/material-sample/list.tsx +++ b/packages/dina-ui/pages/collection/material-sample/list.tsx @@ -22,13 +22,12 @@ const MATERIAL_SAMPLE_FILTER_ATTRIBUTES: FilterAttribute[] = [ const MATERIAL_SAMPLE_TABLE_COLUMNS: ColumnDefinition[] = [ { - Cell: ({ original: { id, name } }) => ( + Cell: ({ original: { id, materialSampleName } }) => ( - {name || id} + {materialSampleName || id} ), - accessor: "name", - sortable: false + accessor: "materialSampleName" }, "dwcCatalogNumber", "createdBy", From 1f7cd19d6c9fedc240385e22dd795b48106228af Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Tue, 11 May 2021 15:08:03 +0000 Subject: [PATCH 18/31] Feedback 22602 Changed the switch/label direction in the Data Components section. --- .../pages/collection/material-sample/edit.tsx | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/packages/dina-ui/pages/collection/material-sample/edit.tsx b/packages/dina-ui/pages/collection/material-sample/edit.tsx index aaddb01003..48f52e4852 100644 --- a/packages/dina-ui/pages/collection/material-sample/edit.tsx +++ b/packages/dina-ui/pages/collection/material-sample/edit.tsx @@ -291,33 +291,27 @@ export function MaterialSampleForm({
    }>
    -
    From b18d19d4a75eb4d4253d0d163a93a3eb00a87d27 Mon Sep 17 00:00:00 2001 From: Shemy Date: Tue, 11 May 2021 11:53:16 -0400 Subject: [PATCH 19/31] Support 22599 MaterialSample doesnt display all current geographic place data - Add the parsing geographic place data to srcSdminLevels into material sample view page - Lint format fix --- .../preparation-type/__test__/edit.test.tsx | 6 ++-- .../preparation-type/__test__/view.test.tsx | 2 +- .../pages/collection/material-sample/view.tsx | 29 ++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx b/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx index 3ab74c987b..09b68ab291 100644 --- a/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx +++ b/packages/dina-ui/page-tests/collection/preparation-type/__test__/edit.test.tsx @@ -44,7 +44,7 @@ describe("preparation-type edit page", () => { { data: { id: "1", - type: "preparation-type" + type: "preparation-type" }, status: 201 } @@ -74,7 +74,7 @@ describe("preparation-type edit page", () => { op: "POST", path: "preparation-type", value: { - attributes: {name: "updated Name"}, + attributes: { name: "updated Name" }, id: "00000000-0000-0000-0000-000000000000", type: "preparation-type" } @@ -126,7 +126,7 @@ describe("preparation-type edit page", () => { /** Test preparation-type with all fields defined. */ const TEST_PREPARATION_TYPE: PreparationType = { - uuid: "617a27e2-8145-4077-a4a5-65af3de416d7", + uuid: "617a27e2-8145-4077-a4a5-65af3de416d7", id: "1", name: "test preparation type", type: "preparation-type" diff --git a/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx b/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx index bf9ca1679f..7ef722cb59 100644 --- a/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx +++ b/packages/dina-ui/page-tests/collection/preparation-type/__test__/view.test.tsx @@ -47,7 +47,7 @@ describe("PreparationType details page", () => { wrapper.update(); expect(wrapper.find(".spinner-border").exists()).toEqual(false); - + expect(wrapper.find(".name-field .field-view").text()).toEqual( "test preparation type" ); diff --git a/packages/dina-ui/pages/collection/material-sample/view.tsx b/packages/dina-ui/pages/collection/material-sample/view.tsx index 6b3921a7df..3eb3de1e92 100644 --- a/packages/dina-ui/pages/collection/material-sample/view.tsx +++ b/packages/dina-ui/pages/collection/material-sample/view.tsx @@ -17,7 +17,10 @@ import { CollectingEventFormLayout } from "../../../components/collection/Collec import { useCollectingEventQuery } from "../../../components/collection/useCollectingEvent"; import { AttachmentReadOnlySection } from "../../../components/object-store/attachment-list/AttachmentReadOnlySection"; import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; -import { MaterialSample } from "../../../types/collection-api"; +import { + MaterialSample, + SourceAdministrativeLevel +} from "../../../types/collection-api"; import { CatalogueInfoFormLayout, MaterialSampleFormLayout } from "./edit"; export function MaterialSampleViewPage({ router }: WithRouterProps) { @@ -36,6 +39,30 @@ export function MaterialSampleViewPage({ router }: WithRouterProps) { const collectingEvent = colEventQuery.response?.data; + // Parse geogrphicPlaceNameDouceDetail place names to srcAdminLevels + // for display/editing purposes + + let srcAdminLevels: SourceAdministrativeLevel[] = []; + if (collectingEvent?.geographicPlaceNameSourceDetail?.customGeographicPlace) { + const customPlaceNameAsInSrcAdmnLevel: SourceAdministrativeLevel = {}; + customPlaceNameAsInSrcAdmnLevel.name = + collectingEvent.geographicPlaceNameSourceDetail.customGeographicPlace; + srcAdminLevels.push(customPlaceNameAsInSrcAdmnLevel); + } + if (collectingEvent?.geographicPlaceNameSourceDetail?.selectedGeographicPlace) + srcAdminLevels.push( + collectingEvent.geographicPlaceNameSourceDetail?.selectedGeographicPlace + ); + if (collectingEvent?.geographicPlaceNameSourceDetail?.higherGeographicPlaces) + srcAdminLevels = srcAdminLevels.concat( + collectingEvent.geographicPlaceNameSourceDetail?.higherGeographicPlaces + ); + + srcAdminLevels?.map( + admn => (admn.name += admn.placeType ? " [ " + admn.placeType + " ] " : "") + ); + if (collectingEvent) collectingEvent.srcAdminLevels = srcAdminLevels; + const buttonBar = ( Date: Tue, 11 May 2021 16:51:39 +0000 Subject: [PATCH 20/31] Feedback 22600 -Removed makeThisThePrimaryIdentifier button from the material sample form. --- packages/dina-ui/intl/dina-ui-en.ts | 1 - .../pages/collection/material-sample/edit.tsx | 31 ------------------- 2 files changed, 32 deletions(-) diff --git a/packages/dina-ui/intl/dina-ui-en.ts b/packages/dina-ui/intl/dina-ui-en.ts index ad8a4e5ea2..c3466037bf 100644 --- a/packages/dina-ui/intl/dina-ui-en.ts +++ b/packages/dina-ui/intl/dina-ui-en.ts @@ -228,7 +228,6 @@ export const DINAUI_MESSAGES_ENGLISH = { latLongAutoSetterButton: "Convert to Decimal Lat/Long", locationLabel: "Location", literalGeoreferencedByLabel: "Georeferenced By", - makeThisThePrimaryIdentifier: "Make this the Primary Identifier", makePrimary: "Make Primary", managedAttributeEditTitle: "Edit Managed Attribute", managedAttributeListTitle: "Managed Attributes", diff --git a/packages/dina-ui/pages/collection/material-sample/edit.tsx b/packages/dina-ui/pages/collection/material-sample/edit.tsx index aaddb01003..74877336eb 100644 --- a/packages/dina-ui/pages/collection/material-sample/edit.tsx +++ b/packages/dina-ui/pages/collection/material-sample/edit.tsx @@ -415,15 +415,6 @@ export interface CatalogueInfoFormLayoutProps { export function CatalogueInfoFormLayout({ className }: CatalogueInfoFormLayoutProps) { - const { readOnly } = useDinaFormContext(); - - function setNameToCatalogNumber( - values: InputResource, - form: FormikContextType - ) { - form.setFieldValue("materialSampleName", values.dwcCatalogNumber); - } - return (
    }>
    @@ -441,28 +432,6 @@ export function CatalogueInfoFormLayout({
    }> - {!readOnly && ( - - {({ - form: { - values: { dwcCatalogNumber, materialSampleName } - } - }) => - !dwcCatalogNumber || - dwcCatalogNumber === materialSampleName ? null : ( - ({ - style: { width: "20rem" } - })} - > - - - ) - } - - )}
    From 3331cdc8f5da4908df483c00bef8ce925f2bc79f Mon Sep 17 00:00:00 2001 From: Shemy Date: Tue, 11 May 2021 14:36:32 -0400 Subject: [PATCH 21/31] Support-22557-WCAG-issue-Object-store-metadata-bulk-edit-page - Remove placeholder color contrast fix for ResourceSelectField and SelectField --- .../lib/formik-connected/ResourceSelectField.tsx | 9 --------- packages/common-ui/lib/formik-connected/SelectField.tsx | 9 --------- 2 files changed, 18 deletions(-) diff --git a/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx b/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx index bcd9d703a6..8666291d7b 100644 --- a/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx +++ b/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx @@ -28,20 +28,11 @@ export function ResourceSelectField( onChange?.(resource); } - // Fix the place holder text ...Select has not enough contrast ratio to the background issue - const customStyles = { - placeholder: (provided, _) => ({ - ...provided, - color: "rgb(51,51,51)" - }) - }; - return ( ); }} diff --git a/packages/common-ui/lib/formik-connected/SelectField.tsx b/packages/common-ui/lib/formik-connected/SelectField.tsx index f61964f5fd..4d65667f02 100644 --- a/packages/common-ui/lib/formik-connected/SelectField.tsx +++ b/packages/common-ui/lib/formik-connected/SelectField.tsx @@ -30,14 +30,6 @@ export function SelectField(props: SelectFieldProps) { ...labelWrapperProps } = props; - // Fix the place holder text ...Select has not enough contrast ratio to the background issue - const customStyles = { - placeholder: (provided, _) => ({ - ...provided, - color: "rgb(51,51,51)" - }) - }; - return ( {({ setValue, value }) => { @@ -66,7 +58,6 @@ export function SelectField(props: SelectFieldProps) { isMulti={isMulti} options={options} onChange={onChangeInternal} - styles={{ ...styles, ...customStyles }} value={selectedOption} /> ); From 251640d1b5cb1320623dbc215f0932005265a9fb Mon Sep 17 00:00:00 2001 From: Shemy Date: Wed, 12 May 2021 08:29:16 -0400 Subject: [PATCH 22/31] Support 22625 make a new fieldset group for habitat - Add the new fieldset group - Fix the duplicate message entries that failed in dev branch ci --- .../components/collection/CollectingEventFormLayout.tsx | 7 +++++++ packages/dina-ui/intl/dina-ui-en.ts | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx index f4c07bf285..22fa9fd299 100644 --- a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx +++ b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx @@ -770,6 +770,13 @@ export function CollectingEventFormLayout({
    +
    }> +
    +
    + +
    +
    +
    diff --git a/packages/dina-ui/intl/dina-ui-en.ts b/packages/dina-ui/intl/dina-ui-en.ts index adb8d6689e..126da01d4a 100644 --- a/packages/dina-ui/intl/dina-ui-en.ts +++ b/packages/dina-ui/intl/dina-ui-en.ts @@ -34,7 +34,6 @@ export const DINAUI_MESSAGES_ENGLISH = { attributeLabel: "Attribute", cancelButtonText: "Cancel", cataloguedObjectListTitle: "Catalogued Objects", - changedProperties: "Changes", catalogueInfo: "Catalogue Info", cataloguedObjectViewTitle: "View Catalogued Object", changedProperties: "Changes", @@ -185,7 +184,6 @@ export const DINAUI_MESSAGES_ENGLISH = { field_givenNames_tooltip: "First and all middle names", field_license: "License", field_managedAttributeComponent: "Target Data Component Type", - field_managedAttributeCreatedOn: "Created On", field_managedAttributeCreatedBy: "Created By", field_managedAttributeCreatedOn: "Created On", field_managedAttributeMandatoryFieldsError: @@ -227,6 +225,7 @@ export const DINAUI_MESSAGES_ENGLISH = { latitudeValidationError: "Invalid latitude: {latitude}, \nValid latitude range is between -90 to 90 for degree, and 0 to 60 for minute and second", literalGeoreferencedByLabel: "Georeferenced By", + locationDescriptionLegend: "Location Description", locationLabel: "Location", longitudeValidationError: "Invalid longitude: {longtitude}, \nValid longitude is between -180 to 180 for degree, and 0 to 60 for minute and second", @@ -281,7 +280,6 @@ export const DINAUI_MESSAGES_ENGLISH = { originalFile: "Original File", personListTitle: "Persons", personViewTitle: "Person", - placeNameLabel: "Place Name", preparation: "Preparation", preparationData: "Preparation Data", preparationTypeListTitle: "Preparation Type", @@ -292,7 +290,6 @@ export const DINAUI_MESSAGES_ENGLISH = { "Make this assertion the primary data point when exported. Only one assertion can be primary", removeAssertionLabel: "Remove this GeoReference", removeGroup: "Remove Group", - placeNameLabel: "Place Name", removeComponentData: "Remove {component} data", removeThisPlaceLabel: " Remove this Place", resetMetadataEditorAttributesButtonText: "Reset to initial attributes layout", @@ -311,7 +308,6 @@ export const DINAUI_MESSAGES_ENGLISH = { showing: "Showing", startEventDateTimeLabel: "Start Event DateTime (YYYY-MM-DDTHH:MM:SS.MMM)", stateProvinceLabel: "State/Province", - thumbnailNotAvailableText: "No thumbnail available", thumbnail: "Thumbnail", thumbnailNotAvailableText: "No thumbnail available", to: "To", From 26e9b48d1b62188811237b7e271b16510d34b83e Mon Sep 17 00:00:00 2001 From: Shemy Date: Wed, 12 May 2021 09:12:09 -0400 Subject: [PATCH 23/31] Support 22625 make a new fieldset group for habitat -Remove the old habitat field --- .../dina-ui/components/collection/CollectingEventFormLayout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx index 22fa9fd299..60e90204cc 100644 --- a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx +++ b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx @@ -469,7 +469,6 @@ export function CollectingEventFormLayout({
    - name="dwcVerbatimSRS" configQuery={() => ({ From 8a084d95e1c446be46ac185c9ca3ad2c6cc2d2c2 Mon Sep 17 00:00:00 2001 From: Shemy Date: Wed, 12 May 2021 09:59:12 -0400 Subject: [PATCH 24/31] Support 22603 improved location search results - Attach category info to search result display name --- .../dina-ui/components/collection/GeographySearchBox.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/dina-ui/components/collection/GeographySearchBox.tsx b/packages/dina-ui/components/collection/GeographySearchBox.tsx index 7b7f8fbd82..1f321f75e1 100644 --- a/packages/dina-ui/components/collection/GeographySearchBox.tsx +++ b/packages/dina-ui/components/collection/GeographySearchBox.tsx @@ -220,11 +220,17 @@ export function GeographySearchBox({ .searchResult { font-size:13pt; font-family:verdana,sans-serif; } + .searchResultCategory { + font-size:13pt; font-family:verdana,sans-serif; color: grey; + } `}
    -
    +
    {place.display_name}
    +
    + {`[category: ${place.category}]`} +
    From 0bdd877ac64391cbf585d146ff386af06f70d8a7 Mon Sep 17 00:00:00 2001 From: Shemy Date: Wed, 12 May 2021 10:27:08 -0400 Subject: [PATCH 25/31] Support 22603 improved location search results - Consolidate common place names parsing code into useCollectingEventQuery --- .../collection/useCollectingEvent.tsx | 79 ++++++++++++------- .../collection/collecting-event/view.tsx | 24 ------ .../pages/collection/material-sample/view.tsx | 25 ------ 3 files changed, 51 insertions(+), 77 deletions(-) diff --git a/packages/dina-ui/components/collection/useCollectingEvent.tsx b/packages/dina-ui/components/collection/useCollectingEvent.tsx index ff2adb134c..9f855412eb 100644 --- a/packages/dina-ui/components/collection/useCollectingEvent.tsx +++ b/packages/dina-ui/components/collection/useCollectingEvent.tsx @@ -75,6 +75,29 @@ export function useCollectingEventQuery(id?: string | null) { data.geoReferenceAssertions, "createdOn" ); + // Parse place names into srcAdminLevels + let srcAdminLevels: SourceAdministrativeLevel[] = []; + + if (data?.geographicPlaceNameSourceDetail?.customGeographicPlace) { + const customPlaceNameAsInSrcAdmnLevel: SourceAdministrativeLevel = {}; + customPlaceNameAsInSrcAdmnLevel.name = + data.geographicPlaceNameSourceDetail.customGeographicPlace; + srcAdminLevels.push(customPlaceNameAsInSrcAdmnLevel); + } + if (data.geographicPlaceNameSourceDetail?.selectedGeographicPlace) + srcAdminLevels.push( + data.geographicPlaceNameSourceDetail?.selectedGeographicPlace + ); + if (data.geographicPlaceNameSourceDetail?.higherGeographicPlaces) + srcAdminLevels = srcAdminLevels.concat( + data.geographicPlaceNameSourceDetail?.higherGeographicPlaces + ); + + srcAdminLevels?.map( + admn => + (admn.name += admn.placeType ? " [ " + admn.placeType + " ] " : "") + ); + data.srcAdminLevels = srcAdminLevels; } } ); @@ -97,35 +120,35 @@ export function useCollectingEventSave( DEFAULT_VERBATIM_SRS_KEY ); - let srcAdminLevels: SourceAdministrativeLevel[] = []; + // let srcAdminLevels: SourceAdministrativeLevel[] = []; - // can either have one of customGeographicPlace or selectedGeographicPlace - if ( - fetchedCollectingEvent?.geographicPlaceNameSourceDetail - ?.customGeographicPlace - ) { - const customPlaceNameAsInSrcAdmnLevel: SourceAdministrativeLevel = {}; - customPlaceNameAsInSrcAdmnLevel.name = - fetchedCollectingEvent?.geographicPlaceNameSourceDetail.customGeographicPlace; - srcAdminLevels.push(customPlaceNameAsInSrcAdmnLevel); - } + // // can either have one of customGeographicPlace or selectedGeographicPlace + // if ( + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail + // ?.customGeographicPlace + // ) { + // const customPlaceNameAsInSrcAdmnLevel: SourceAdministrativeLevel = {}; + // customPlaceNameAsInSrcAdmnLevel.name = + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail.customGeographicPlace; + // srcAdminLevels.push(customPlaceNameAsInSrcAdmnLevel); + // } - if ( - fetchedCollectingEvent?.geographicPlaceNameSourceDetail - ?.selectedGeographicPlace - ) - srcAdminLevels.push( - fetchedCollectingEvent?.geographicPlaceNameSourceDetail - ?.selectedGeographicPlace - ); - if ( - fetchedCollectingEvent?.geographicPlaceNameSourceDetail - ?.higherGeographicPlaces - ) - srcAdminLevels = srcAdminLevels.concat( - fetchedCollectingEvent?.geographicPlaceNameSourceDetail - ?.higherGeographicPlaces - ); + // if ( + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail + // ?.selectedGeographicPlace + // ) + // srcAdminLevels.push( + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail + // ?.selectedGeographicPlace + // ); + // if ( + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail + // ?.higherGeographicPlaces + // ) + // srcAdminLevels = srcAdminLevels.concat( + // fetchedCollectingEvent?.geographicPlaceNameSourceDetail + // ?.higherGeographicPlaces + // ); const collectingEventInitialValues = fetchedCollectingEvent ? { ...fetchedCollectingEvent, @@ -134,7 +157,7 @@ export function useCollectingEventSave( "", geoReferenceAssertions: fetchedCollectingEvent.geoReferenceAssertions ?? [], - srcAdminLevels + srcAdminLevels: fetchedCollectingEvent.srcAdminLevels } : { type: "collecting-event", diff --git a/packages/dina-ui/pages/collection/collecting-event/view.tsx b/packages/dina-ui/pages/collection/collecting-event/view.tsx index 97fa9aa4a8..4df8a868d7 100644 --- a/packages/dina-ui/pages/collection/collecting-event/view.tsx +++ b/packages/dina-ui/pages/collection/collecting-event/view.tsx @@ -49,36 +49,12 @@ export function CollectingEventDetailsPage({ router }: WithRouterProps) { ); - let srcAdminLevels: SourceAdministrativeLevel[] = []; - return (
    -
    -
    }> -
    -
    +
    +
    }> -
    +
    - +
    From cfc2913b05e40e23420ee987bb8c525d9dd72e74 Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Wed, 12 May 2021 17:42:20 +0000 Subject: [PATCH 28/31] Feedback 22631 -Added preparation type field to the material sample form. -Moved read-only array renfering into ResourceSelectField component. --- .../lib/formik-connected/FieldView.tsx | 20 +------- .../lib/formik-connected/FieldWrapper.tsx | 10 +--- .../formik-connected/ResourceSelectField.tsx | 48 +++++++++++++++-- .../__tests__/ResourceSelectField.test.tsx | 51 +++++++++++++++++++ .../collection/CollectingEventFormLayout.tsx | 2 +- .../collection/GeoReferenceAssertionRow.tsx | 2 +- packages/dina-ui/intl/dina-ui-en.ts | 21 ++++---- .../material-sample/__tests__/edit.test.tsx | 43 ++++++---------- .../pages/collection/material-sample/edit.tsx | 42 ++++++++------- .../pages/collection/material-sample/view.tsx | 2 +- 10 files changed, 150 insertions(+), 91 deletions(-) diff --git a/packages/common-ui/lib/formik-connected/FieldView.tsx b/packages/common-ui/lib/formik-connected/FieldView.tsx index 98ae714542..255513b202 100644 --- a/packages/common-ui/lib/formik-connected/FieldView.tsx +++ b/packages/common-ui/lib/formik-connected/FieldView.tsx @@ -12,14 +12,9 @@ export function FieldView(props: LabelWrapperParams) { export interface ReadOnlyValueProps { value: any; link?: string; - arrayItemLink?: string; } -export function ReadOnlyValue({ - value, - link, - arrayItemLink -}: ReadOnlyValueProps) { +export function ReadOnlyValue({ value, link }: ReadOnlyValueProps) { return (
    - {arrayItemLink ? ( - <> - - {displayString} - - {idx <= value.length - 2 && , } - - ) : idx <= value.length - 2 ? ( - displayString + ", " - ) : ( - displayString - )} + {idx <= value.length - 2 ? displayString + ", " : displayString} ); }) diff --git a/packages/common-ui/lib/formik-connected/FieldWrapper.tsx b/packages/common-ui/lib/formik-connected/FieldWrapper.tsx index 895d6a3b61..c823d52581 100644 --- a/packages/common-ui/lib/formik-connected/FieldWrapper.tsx +++ b/packages/common-ui/lib/formik-connected/FieldWrapper.tsx @@ -23,9 +23,6 @@ export interface LabelWrapperParams { /** Link href to render for a single string value. */ link?: string; - /** Link href to render on each array item. */ - arrayItemLink?: string; - /** Custom element to render when the form is in read-only mode. */ readOnlyRender?: (value: any) => ReactNode; @@ -61,7 +58,6 @@ export function FieldWrapper({ label, children, customName, - arrayItemLink, link, readOnlyRender, removeFormGroupClass, @@ -101,11 +97,7 @@ export function FieldWrapper({ if (readOnly || !children) { return ( readOnlyRender?.(value) ?? ( - + ) ); } else if (typeof children === "function") { diff --git a/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx b/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx index 8666291d7b..2d02f7045b 100644 --- a/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx +++ b/packages/common-ui/lib/formik-connected/ResourceSelectField.tsx @@ -4,24 +4,62 @@ import { ResourceSelectProps } from "../resource-select/ResourceSelect"; import { FieldWrapper, LabelWrapperParams } from "./FieldWrapper"; +import { castArray } from "lodash"; +import { Fragment } from "react"; +import Link from "next/link"; + +/** The value could be one element or an array. */ +export type SingleOrArray = T | T[]; export interface ResourceSelectFieldProps extends Omit, "value">, LabelWrapperParams { - onChange?: ( - value?: PersistedResource | PersistedResource[] - ) => void; + onChange?: (value?: SingleOrArray>) => void; isDisabled?: boolean; + + /** Link that is shown in read-only mode. */ + readOnlyLink?: string; } /** Formik-connected Dropdown select input for selecting a resource from the API. */ export function ResourceSelectField( resourceSelectFieldProps: ResourceSelectFieldProps ) { - const { name, onChange, ...resourceSelectProps } = resourceSelectFieldProps; + const { + name, + onChange, + readOnlyLink, + ...resourceSelectProps + } = resourceSelectFieldProps; return ( - + | null> + ) => { + const values = castArray(value); + return ( +
    + {values.map((resource, index) => { + const valueText = resource + ? resourceSelectProps.optionLabel(resource) + : ""; + return ( + + {readOnlyLink && resource ? ( + {valueText} + ) : ( + valueText + )} + {index === values.length - 1 ? "" : ", "} + + ); + })} +
    + ); + }} + > {({ setValue, value }) => { function onChangeInternal(resource) { setValue(resource); diff --git a/packages/common-ui/lib/formik-connected/__tests__/ResourceSelectField.test.tsx b/packages/common-ui/lib/formik-connected/__tests__/ResourceSelectField.test.tsx index 5601613c32..be38966062 100644 --- a/packages/common-ui/lib/formik-connected/__tests__/ResourceSelectField.test.tsx +++ b/packages/common-ui/lib/formik-connected/__tests__/ResourceSelectField.test.tsx @@ -141,4 +141,55 @@ describe("ResourceSelectField component", () => { type: "group" }); }); + + it("Renders the read-only view.", async () => { + const wrapper = mountWithAppContext( + + + name="singleGroup" + model="group" + filter={groupName => ({ groupName })} + optionLabel={group => group.groupName} + readOnlyLink="/group/view?id=" + /> + + name="multipleGroups" + model="group" + filter={groupName => ({ groupName })} + optionLabel={group => group.groupName} + isMulti={true} + readOnlyLink="/group/view?id=" + /> + , + { apiContext } + ); + + expect(wrapper.find(".singleGroup-field .read-only-view").text()).toEqual( + "Group 1" + ); + // Renders the link: + expect( + wrapper.find(".singleGroup-field .read-only-view a").prop("href") + ).toEqual("/group/view?id=1"); + + // Joins the names with commas: + expect( + wrapper.find(".multipleGroups-field .read-only-view").text() + ).toEqual("Group 2, Group 3"); + // Renders each link: + expect( + wrapper + .find(".multipleGroups-field .read-only-view a") + .map(node => node.prop("href")) + ).toEqual(["/group/view?id=2", "/group/view?id=3"]); + }); }); diff --git a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx index db2a221811..1295e90731 100644 --- a/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx +++ b/packages/dina-ui/components/collection/CollectingEventFormLayout.tsx @@ -353,7 +353,7 @@ export function CollectingEventFormLayout({ /> name="collectors" - arrayItemLink="/person/view?id=" + readOnlyLink="/person/view?id=" filter={filterBy(["displayName"])} model="agent-api/person" optionLabel={person => person.displayName} diff --git a/packages/dina-ui/components/collection/GeoReferenceAssertionRow.tsx b/packages/dina-ui/components/collection/GeoReferenceAssertionRow.tsx index a991c0fb36..9f473d384c 100644 --- a/packages/dina-ui/components/collection/GeoReferenceAssertionRow.tsx +++ b/packages/dina-ui/components/collection/GeoReferenceAssertionRow.tsx @@ -213,7 +213,7 @@ export function GeoReferenceAssertionRow({ /> name={commonRoot + "georeferencedBy"} - arrayItemLink="/person/view?id=" + readOnlyLink="/person/view?id=" label={formatMessage("georeferencedByLabel")} filter={filterBy(["displayName"])} model="agent-api/person" diff --git a/packages/dina-ui/intl/dina-ui-en.ts b/packages/dina-ui/intl/dina-ui-en.ts index 126da01d4a..41df6081b2 100644 --- a/packages/dina-ui/intl/dina-ui-en.ts +++ b/packages/dina-ui/intl/dina-ui-en.ts @@ -20,7 +20,7 @@ export const DINAUI_MESSAGES_ENGLISH = { addPersonButtonText: "Add Person", addPersonPopupTooltip: "Add Person without leaving the page", addPersonTitle: "Add Person", - addPreparationTypeTitle: "Add Preparation Type", + addPreparationTypeTitle: "Add Preparation Method", addRule: "Add Rule", addRuleSet: "Add Rule Set", agentsSectionTitle: "Agents", @@ -33,16 +33,16 @@ export const DINAUI_MESSAGES_ENGLISH = { attachments: "Attachments", attributeLabel: "Attribute", cancelButtonText: "Cancel", - cataloguedObjectListTitle: "Catalogued Objects", catalogueInfo: "Catalogue Info", + cataloguedObjectListTitle: "Catalogued Objects", cataloguedObjectViewTitle: "View Catalogued Object", changedProperties: "Changes", closePreviewButtonText: "Close Preview", collectingAgentsLegend: "Collecting Agents", collectingDateLegend: "Collecting Date", collectingEvent: "Collecting Event", - collectingEventDetailsPageLink: "Collecting Event Details Page", collectingEventAttachments: "Collecting Event Attachments", + collectingEventDetailsPageLink: "Collecting Event Details Page", collectingEventListTitle: "Collecting Event", collectingEventManagedAttributes: "Collecting Event Managed Attributes", collectingEventViewTitle: "View Collecting Event", @@ -53,8 +53,8 @@ export const DINAUI_MESSAGES_ENGLISH = { collectorGroupListTitle: "Collector Group", collectorGroupNameLabel: "Collector Group Name", collectorGroupViewTitle: "View Collector Group", - configureDefaultValues: "Configure default values", components: "Components", + configureDefaultValues: "Configure default values", coordinateUncertaintyInMeters: "Coordinate Uncertainty In Meters", countryLabel: "Country", customPlaceName: "Custom Place Name", @@ -119,9 +119,9 @@ export const DINAUI_MESSAGES_ENGLISH = { "End event datetime format must be a subset of : YYYY-MM-DDTHH:MM:SS.MMM, if datetime is present, 'T' is mandatory", field_collectingEvent_startDateTimeError: "Start event datetime format must be a subset of: YYYY-MM-DDTHH:MM:SS.MMM, if datetime is present, 'T' is mandatory", - field_collectors: "Collectors", field_collectorGroup_agentsError: "At lease one agent should be specified for the group", + field_collectors: "Collectors", field_createdBy: "Created By", field_createdDate: "Created Date", field_createdOn: "Created On", @@ -196,6 +196,7 @@ export const DINAUI_MESSAGES_ENGLISH = { field_organizationMandatoryFieldsError: "At least one orgnization name is required", field_originalFilename: "Original Filename", + field_preparationType: "Preparation Method", field_publiclyReleasable: "Publicly releasable", field_publiclyReleasable_tooltip: "Indicates if the object could be released publicly on a web page or open data portals.", @@ -262,9 +263,9 @@ export const DINAUI_MESSAGES_ENGLISH = { metadataRightsDetailsLabel: "Rights", metadataTagsLabel: "Tags", metadataUploadDetailsLabel: "Upload Details", - noManagedAttributeValues: "No Managed Attribute values.", noFileToDisplay: "No file to display", noGroups: "No Groups", + noManagedAttributeValues: "No Managed Attribute values.", noResultsFound: "No results found.", objectListTitle: "Stored Objects", objectStoreDataUnavailable: "Object Store data unavailable", @@ -282,15 +283,15 @@ export const DINAUI_MESSAGES_ENGLISH = { personViewTitle: "Person", preparation: "Preparation", preparationData: "Preparation Data", - preparationTypeListTitle: "Preparation Type", - preparationTypeNameLabel: "Preparation Type Name", - preparationTypeViewTitle: "View Preparation Type", + preparationTypeListTitle: "Preparation Method", + preparationTypeNameLabel: "Preparation Method Name", + preparationTypeViewTitle: "View Preparation Method", primary: "Primary", primaryButton_tooltip: "Make this assertion the primary data point when exported. Only one assertion can be primary", removeAssertionLabel: "Remove this GeoReference", - removeGroup: "Remove Group", removeComponentData: "Remove {component} data", + removeGroup: "Remove Group", removeThisPlaceLabel: " Remove this Place", resetMetadataEditorAttributesButtonText: "Reset to initial attributes layout", revisionsButtonText: "Revisions", diff --git a/packages/dina-ui/page-tests/collection/material-sample/__tests__/edit.test.tsx b/packages/dina-ui/page-tests/collection/material-sample/__tests__/edit.test.tsx index 7f30d1fb6b..91d4c94323 100644 --- a/packages/dina-ui/page-tests/collection/material-sample/__tests__/edit.test.tsx +++ b/packages/dina-ui/page-tests/collection/material-sample/__tests__/edit.test.tsx @@ -49,33 +49,22 @@ const TEST_COORDINATES: CoordinateSystem = { }; const mockGet = jest.fn(async path => { - if (path === "user-api/group") { - return { data: [] }; - } - if (path === "collection-api/collecting-event") { - // Populate the collecting-event linker table: - return { data: [testCollectionEvent()] }; - } - if ( - path === "collection-api/collecting-event/1?include=collectors,attachment" - ) { - // Populate the linker table: - return { data: testCollectionEvent() }; - } - if (path === "agent-api/person") { - return { data: [] }; - } - if (path === "collection-api/srs") { - return { data: [TEST_SRS] }; - } - if (path === "collection-api/coordinate-system") { - return { data: [TEST_COORDINATES] }; - } - if (path === "collection-api/managed-attribute") { - return { data: [] }; - } - if (path === "objectstore-api/metadata") { - return { data: [] }; + switch (path) { + case "collection-api/collecting-event": + return { data: [testCollectionEvent()] }; + case "collection-api/collecting-event/1?include=collectors,attachment": + // Populate the linker table: + return { data: testCollectionEvent() }; + case "collection-api/srs": + return { data: [TEST_SRS] }; + case "collection-api/coordinate-system": + return { data: [TEST_COORDINATES] }; + case "collection-api/preparation-type": + case "collection-api/managed-attribute": + case "user-api/group": + case "agent-api/person": + case "objectstore-api/metadata": + return { data: [] }; } }); diff --git a/packages/dina-ui/pages/collection/material-sample/edit.tsx b/packages/dina-ui/pages/collection/material-sample/edit.tsx index 6bb4f1edba..cb2d12e416 100644 --- a/packages/dina-ui/pages/collection/material-sample/edit.tsx +++ b/packages/dina-ui/pages/collection/material-sample/edit.tsx @@ -4,9 +4,12 @@ import { ButtonBar, DateField, DinaForm, + DinaFormSection, DinaFormSubmitParams, FieldSet, + filterBy, FormikButton, + ResourceSelectField, SubmitButton, TextField, useAccount, @@ -40,6 +43,7 @@ import { import { useAttachmentsModal } from "../../../components/object-store"; import { DinaMessage, useDinaIntl } from "../../../intl/dina-ui-intl"; import { MaterialSample } from "../../../types/collection-api"; +import { PreparationType } from "../../../types/collection-api/resources/PreparationType"; import { Metadata } from "../../../types/objectstore-api"; export default function MaterialSampleEditPage() { @@ -53,7 +57,7 @@ export default function MaterialSampleEditPage() { const materialSampleQuery = useQuery( { path: `collection-api/material-sample/${id}`, - include: "collectingEvent,attachment" + include: "collectingEvent,attachment,preparationType" }, { disabled: !id, @@ -387,16 +391,10 @@ export function MaterialSampleForm({ /** Fields layout re-useable between view and edit pages. */ export function MaterialSampleFormLayout() { return ( -
    -
    - -
    -
    - +
    +
    + +
    ); @@ -413,14 +411,20 @@ export function CatalogueInfoFormLayout({
    }>
    -
    } - horizontal={true} - readOnly={true} // Disabled until back-end supports these fields. - > - - - +
    } horizontal={true}> + + name="preparationType" + filter={filterBy(["name"])} + model="collection-api/preparation-type" + optionLabel={it => it.name} + readOnlyLink="/collection/preparation-type/view?id=" + /> + + + +
    diff --git a/packages/dina-ui/pages/collection/material-sample/view.tsx b/packages/dina-ui/pages/collection/material-sample/view.tsx index 3eb3de1e92..3209fc75a8 100644 --- a/packages/dina-ui/pages/collection/material-sample/view.tsx +++ b/packages/dina-ui/pages/collection/material-sample/view.tsx @@ -30,7 +30,7 @@ export function MaterialSampleViewPage({ router }: WithRouterProps) { const materialSampleQuery = useQuery({ path: `collection-api/material-sample/${id}`, - include: "collectingEvent,attachment" + include: "collectingEvent,attachment,preparationType" }); const colEventQuery = useCollectingEventQuery( From ad8b8ba00321c689895c8922b00f826f569eeb8b Mon Sep 17 00:00:00 2001 From: Shemy Date: Wed, 12 May 2021 14:30:24 -0400 Subject: [PATCH 29/31] Support 22633 WCAG issue objectstore metadata single record edit page - Fix Image must have alternate text - Fix Element must have label - Fix Elements must have sufficient color contrast --- .../lib/formik-connected/SelectField.tsx | 8 ++++++++ .../lib/resource-select/ResourceSelect.tsx | 10 +++++++++- .../object-store/file-view/FileView.tsx | 2 +- .../ManagedAttributesEditor.tsx | 18 ++++++++++-------- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/common-ui/lib/formik-connected/SelectField.tsx b/packages/common-ui/lib/formik-connected/SelectField.tsx index 4d65667f02..da0fcda95c 100644 --- a/packages/common-ui/lib/formik-connected/SelectField.tsx +++ b/packages/common-ui/lib/formik-connected/SelectField.tsx @@ -30,6 +30,13 @@ export function SelectField(props: SelectFieldProps) { ...labelWrapperProps } = props; + const customStyle = { + placeholder: (provided, _) => ({ + ...provided, + color: "rgb(87,120,94)" + }) + }; + return ( {({ setValue, value }) => { @@ -59,6 +66,7 @@ export function SelectField(props: SelectFieldProps) { options={options} onChange={onChangeInternal} value={selectedOption} + styles={customStyle} /> ); }} diff --git a/packages/common-ui/lib/resource-select/ResourceSelect.tsx b/packages/common-ui/lib/resource-select/ResourceSelect.tsx index caa846286c..a3ad29dbe3 100644 --- a/packages/common-ui/lib/resource-select/ResourceSelect.tsx +++ b/packages/common-ui/lib/resource-select/ResourceSelect.tsx @@ -203,6 +203,13 @@ export function ResourceSelect({ }; } + const customStyle = { + placeholder: (provided, _) => ({ + ...provided, + color: "rgb(87,120,94)" + }) + }; + return ( ({ placeholder={formatMessage({ id: "typeHereToSearch" })} styles={{ multiValueLabel: base => ({ ...base, cursor: "move" }), - ...styles + ...styles, + ...customStyle }} value={selectValue} // react-sortable-hoc config: diff --git a/packages/dina-ui/components/object-store/file-view/FileView.tsx b/packages/dina-ui/components/object-store/file-view/FileView.tsx index dfdfa7a63c..1c8b051239 100644 --- a/packages/dina-ui/components/object-store/file-view/FileView.tsx +++ b/packages/dina-ui/components/object-store/file-view/FileView.tsx @@ -70,7 +70,7 @@ export function FileView({ > {isImage ? ( {imgAlt} diff --git a/packages/dina-ui/components/object-store/managed-attributes/ManagedAttributesEditor.tsx b/packages/dina-ui/components/object-store/managed-attributes/ManagedAttributesEditor.tsx index 368381995a..b13a441098 100644 --- a/packages/dina-ui/components/object-store/managed-attributes/ManagedAttributesEditor.tsx +++ b/packages/dina-ui/components/object-store/managed-attributes/ManagedAttributesEditor.tsx @@ -71,12 +71,10 @@ export function ManagedAttributesEditor({ return (
    -
    - +
    +
    -
    +
    From 9ac8bdf72d91a5a7a15cd80c74ec3f6e28ef77de Mon Sep 17 00:00:00 2001 From: Mat Poff Date: Wed, 12 May 2021 21:17:12 +0000 Subject: [PATCH 30/31] Feedback 22631 -Fixed the "hasCatalogueInfo" check to correctly show the catalog info section when there is a linked preparationType. --- packages/dina-ui/pages/collection/material-sample/edit.tsx | 3 ++- packages/dina-ui/pages/collection/material-sample/view.tsx | 4 +++- .../dina-ui/types/collection-api/resources/MaterialSample.ts | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/dina-ui/pages/collection/material-sample/edit.tsx b/packages/dina-ui/pages/collection/material-sample/edit.tsx index cb2d12e416..a6e64be0a8 100644 --- a/packages/dina-ui/pages/collection/material-sample/edit.tsx +++ b/packages/dina-ui/pages/collection/material-sample/edit.tsx @@ -127,7 +127,8 @@ export function MaterialSampleForm({ !!materialSample?.collectingEvent ); - const hasCatalogueInfo = !!materialSample?.dwcCatalogNumber; + const hasCatalogueInfo = + !!materialSample?.dwcCatalogNumber || !!materialSample?.preparationType; const [enableCatalogueInfo, setEnableCatalogueInfo] = useState( hasCatalogueInfo ); diff --git a/packages/dina-ui/pages/collection/material-sample/view.tsx b/packages/dina-ui/pages/collection/material-sample/view.tsx index 3209fc75a8..acdcb90134 100644 --- a/packages/dina-ui/pages/collection/material-sample/view.tsx +++ b/packages/dina-ui/pages/collection/material-sample/view.tsx @@ -90,7 +90,9 @@ export function MaterialSampleViewPage({ router }: WithRouterProps) {