diff --git a/apps/dataset-browser/src/app/[locale]/dataset-card.tsx b/apps/dataset-browser/src/app/[locale]/dataset-card.tsx index 214611fba..548b854c5 100644 --- a/apps/dataset-browser/src/app/[locale]/dataset-card.tsx +++ b/apps/dataset-browser/src/app/[locale]/dataset-card.tsx @@ -1,7 +1,7 @@ import {Link} from '@/navigation'; import {useTranslations} from 'next-intl'; import {Dataset} from '@colonial-collections/api'; -import {Badge} from '@colonial-collections/ui'; +import {Badge, BadgeIcon} from '@colonial-collections/ui'; import {BuildingLibraryIcon} from '@heroicons/react/24/solid'; import {DocumentCheckIcon} from '@heroicons/react/24/outline'; import BooleanMeasurement from '@/components/boolean-measurement'; @@ -59,11 +59,11 @@ export default function DatasetCard({dataset}: {dataset: Dataset}) {
- + {dataset.publisher?.name} - + {dataset.license?.name}
diff --git a/apps/researcher/e2e/object-list.test.ts b/apps/researcher/e2e/object-list.test.ts index 58400f17b..6fdf41173 100644 --- a/apps/researcher/e2e/object-list.test.ts +++ b/apps/researcher/e2e/object-list.test.ts @@ -126,7 +126,7 @@ test.describe('Object list page logged in', () => { await gotoSignedIn(objectUrl); await page.getByTestId('popover-menu-button').hover(); await page.getByTestId(`object-list-${listId}`).click(); - await expect(page.getByTestId('notification')).toHaveCount(3); + await expect(page.getByTestId('notification')).toHaveCount(1); await page.goto(`/en/communities/${community.slug}/${listId}`); await expect(page.getByTestId('object-card')).toHaveCount(1); }); diff --git a/apps/researcher/e2e/object.test.ts b/apps/researcher/e2e/object.test.ts index 9b663800e..687f51bd6 100644 --- a/apps/researcher/e2e/object.test.ts +++ b/apps/researcher/e2e/object.test.ts @@ -94,7 +94,7 @@ test.describe('Object details page logged in', () => { .getByTestId('enrichment-form') .locator('button[type="submit"]') .click(); - await expect(page.getByTestId('notification')).toHaveCount(3, { + await expect(page.getByTestId('notification')).toHaveCount(1, { timeout: 30000, }); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx index a1ef947d1..1a12183c7 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx @@ -212,7 +212,7 @@ export default function AddProvenanceForm({ }); addNotification({ - id: 'add-user-enrichment-success', + id: 'provenance.added.success', message: t('successfullyAdded'), type: 'success', }); @@ -411,7 +411,6 @@ export default function AddProvenanceForm({ diff --git a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/data-table.tsx b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/data-table.tsx index a774dc724..9821683a3 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/data-table.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/data-table.tsx @@ -80,10 +80,10 @@ function ProvenanceEventRow({ return (
-
+
{dateRange}
-
+
{provenanceEvents.map(event => (
-
+
{metadata.map( ({prop, translationKey}) => event[prop] && ( @@ -147,7 +147,7 @@ function ProvenanceEventRow({ )}
-
+
-

+

{t('title')}

@@ -107,7 +111,7 @@ async function AddProvenanceSlideOut({objectId}: {objectId: string}) { return ( <> - + {images.length > 1 && ( - + {images.map(image => (

)} -
+
{t('type')}
{watch('type') && (
- - - {t('noticeInformationTitle')} - - {t('noticeInformationSubTitle')} +

+ + + {t('noticeInformationTitle')} + +

+

{tNotices( localContextsNoticeEnrichmentTypeMapping[ watch('type')! as LocalContextsNoticeEnrichmentType - ].labelTranslationKey + ].informationTranslationKey )}

+

+ {t('noticeTextTitle')} +

+ +
+ {tNotices( + localContextsNoticeEnrichmentTypeMapping[ + watch('type')! as LocalContextsNoticeEnrichmentType + ].labelTranslationKey + )} +
+ Logo local context +
+
)} diff --git a/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/mapping.ts b/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/mapping.ts index 30c0a6c2c..832dc06f2 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/mapping.ts +++ b/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/mapping.ts @@ -10,41 +10,49 @@ export const localContextsNoticeEnrichmentTypeMapping = { [LocalContextsNoticeEnrichmentType.Authorization]: { titleTranslationKey: 'authorization', labelTranslationKey: 'authorizationLabel', + informationTranslationKey: 'authorizationInformation', imageSrc: '/images/local-contexts-notices/authorization.png', }, [LocalContextsNoticeEnrichmentType.Belonging]: { titleTranslationKey: 'belonging', labelTranslationKey: 'belongingLabel', + informationTranslationKey: 'belongingInformation', imageSrc: '/images/local-contexts-notices/belonging.png', }, [LocalContextsNoticeEnrichmentType.Caring]: { titleTranslationKey: 'caring', labelTranslationKey: 'caringLabel', + informationTranslationKey: 'caringInformation', imageSrc: '/images/local-contexts-notices/caring.png', }, [LocalContextsNoticeEnrichmentType.Gender_Aware]: { titleTranslationKey: 'genderAware', labelTranslationKey: 'genderAwareLabel', + informationTranslationKey: 'genderAwareInformation', imageSrc: '/images/local-contexts-notices/gender-aware.png', }, [LocalContextsNoticeEnrichmentType.Leave_Undisturbed]: { titleTranslationKey: 'leaveUndisturbed', labelTranslationKey: 'leaveUndisturbedLabel', + informationTranslationKey: 'leaveUndisturbedInformation', imageSrc: '/images/local-contexts-notices/leave-undisturbed.png', }, [LocalContextsNoticeEnrichmentType.Safety]: { titleTranslationKey: 'safety', labelTranslationKey: 'safetyLabel', + informationTranslationKey: 'safetyInformation', imageSrc: '/images/local-contexts-notices/safety.png', }, [LocalContextsNoticeEnrichmentType.Viewing]: { titleTranslationKey: 'viewing', labelTranslationKey: 'viewingLabel', + informationTranslationKey: 'viewingInformation', imageSrc: '/images/local-contexts-notices/viewing.png', }, [LocalContextsNoticeEnrichmentType.Withholding]: { titleTranslationKey: 'withholding', labelTranslationKey: 'withholdingLabel', + informationTranslationKey: 'withholdingInformation', imageSrc: '/images/local-contexts-notices/withholding.png', }, } as const; diff --git a/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/overview.tsx b/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/overview.tsx index 59b489018..2e27dff5e 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/overview.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/local-contexts-notices/overview.tsx @@ -47,7 +47,6 @@ export default async function LocalContextsNotices() { }; } - // Default notice when there are no localContextsNotices const defaultNotice = { id: 'attributionIncomplete', title: tNotices('attributionIncomplete'), @@ -61,21 +60,25 @@ export default async function LocalContextsNotices() { label: tNotices('attributionIncompleteLabel'), }; - // Determine notices to display - const noticesToDisplay = localContextsNotices?.length - ? localContextsNotices.map(mapNoticeToDisplay) - : [defaultNotice]; + const noticesToDisplay = [ + ...(localContextsNotices?.map(mapNoticeToDisplay) || []), + defaultNotice, + ]; return (
-

+

{t('title')}

{t.rich('description', { link: text => ( @@ -85,7 +88,7 @@ export default async function LocalContextsNotices() { })}

- +
{noticesToDisplay.map(notice => (
-
-
-
-

- {t(translationKey)} -

-
- {t(`${translationKey}SubTitle`)} + <> +
+
+
+
+

+ {t(translationKey)} +

+
+ {t(`${translationKey}SubTitle`)} +
-
- {!children && metadataEnrichments.length === 0 ? ( -
- {t.rich('noData', { - subject: () => ( - {t(translationKey)} - ), - })} -
- ) : ( -
- - {children} - - {metadataEnrichments?.map(enrichment => ( - - + {!children && metadataEnrichments.length === 0 ? ( +
+ {t.rich('noData', { + subject: () => ( + {t(translationKey)} + ), + })} +
+ ) : ( +
+ + {children} - ))} -
+ {metadataEnrichments?.map(enrichment => ( + + + + ))} +
+ )} +
+ {enrichmentType && ( + )}
- {enrichmentType && ( - - )} -
+ + ); } @@ -104,7 +114,7 @@ export async function MetadataEntry({ return (
-
+
{children} {languageCode && (
diff --git a/apps/researcher/src/app/[locale]/objects/[id]/object-lists-menu.tsx b/apps/researcher/src/app/[locale]/objects/[id]/object-lists-menu.tsx index 16f6071b2..162dc324e 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/object-lists-menu.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/object-lists-menu.tsx @@ -58,7 +58,7 @@ function CommunityMenuItems({ }); addNotification({ - id: 'objectAddedToList', + id: 'objectList.added.success', message: t.rich('objectAddedToList', { name: () => {objectList.name}, }), @@ -66,7 +66,7 @@ function CommunityMenuItems({ }); } catch (err) { addNotification({ - id: 'errorObjectAddedToList', + id: 'objectList.added.error', message: t('errorObjectAddedToList'), type: 'error', }); @@ -76,7 +76,7 @@ function CommunityMenuItems({ await deleteObjectFromList(objectList.objects![0].id, communityId); addNotification({ - id: 'objectRemovedFromList', + id: 'objectList.removed.success', message: t.rich('objectRemovedFromList', { name: () => {objectList.name}, }), @@ -84,7 +84,7 @@ function CommunityMenuItems({ }); } catch (err) { addNotification({ - id: 'errorObjectRemovedFromList', + id: 'objectList.removed.error', message: t('errorObjectRemovedFromList'), type: 'error', }); diff --git a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx index 419993cb9..c059f08a5 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/page.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/page.tsx @@ -3,6 +3,7 @@ import heritageObjects from '@/lib/heritage-objects-instance'; import Gallery from './gallery'; import ToFilteredListButton from '@/components/to-filtered-list-button'; import {ChevronLeftIcon} from '@heroicons/react/24/solid'; +import {InformationCircleIcon} from '@heroicons/react/24/outline'; import {ObjectIcon} from '@/components/icons'; import {Metadata} from './metadata'; import {decodeRouteSegment} from '@/lib/clerk-route-segment-transformer'; @@ -20,6 +21,7 @@ import {env} from 'node:process'; import Map from './map'; import {ReadMoreText} from '@/components/read-more-text'; import LocalContextsNotices from './local-contexts-notices/overview'; +import {ChevronDownIcon} from '@heroicons/react/24/outline'; export const dynamic = 'force-dynamic'; @@ -63,7 +65,7 @@ export default async function Details({params}: Props) { return ( <> -
+
@@ -80,7 +82,7 @@ export default async function Details({params}: Props) {
-
+
@@ -108,30 +110,66 @@ export default async function Details({params}: Props) {
))}
+
+ {organization && ( + <> + {t('providerCurrentHolder')} + + + {organization.name} + + + + , {organization.address?.addressLocality} + + )} +
+
+
+
+
- +
-

+

{t('metadata')}

@@ -217,9 +255,9 @@ export default async function Details({params}: Props) {
-