Skip to content

Commit

Permalink
new branch for accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Doppen committed Jun 21, 2024
1 parent 41e23ae commit a6c5e47
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 25 deletions.
13 changes: 11 additions & 2 deletions apps/researcher/src/app/[locale]/communities/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ export default async function CommunityPage({params}: Props) {
<div className="w-full px-4 sm:px-10 max-w-[1800px] mx-auto pt-4 pb-10 md:pt-10 md:pb-16 xl:pt-16 xl:pb-20 flex flex-col lg:flex-row gap-10">
<SlideOutClosed id={slideOutEditFormId}>
<main className="w-full lg:w-2/3 xl:w-3/4">
<h1 className="text-2xl md:text-3xl lg:text-4xl 2xl:text-5xl max-w-5xl inline-flex gap-2">
<h1
className="text-2xl md:text-3xl lg:text-4xl 2xl:text-5xl max-w-5xl inline-flex gap-2"
tabIndex={0}
>
<span className="font-normal">{t('title')}</span>
<span data-testid="community-name">{community.name}</span>
</h1>
Expand Down Expand Up @@ -147,7 +150,13 @@ export default async function CommunityPage({params}: Props) {
<div className="w-full md:w-3/4">
<div className="flex justify-between my-4">
<div>
<h2 className="text-xl">{t('objectListsTitle')}</h2>
<h2
className="text-xl"
tabIndex={0}
arial-label={t('accessibilityObjectListsTitle')}
>
{t('objectListsTitle')}
</h2>
{objectLists.length > 0 && (
<p>{t('objectListsSubTitle', {count: objectLists.length})}</p>
)}
Expand Down
4 changes: 3 additions & 1 deletion apps/researcher/src/app/[locale]/communities/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export default async function CommunitiesPage({searchParams = {}}: Props) {
<div className="bg-consortium-green-300 text-consortium-blue-800 py-10 md:py-20 grow">
<div className="flex flex-col md:flex-row gap-4 md:gap-20 w-full max-w-[1800px] mx-auto px-4 sm:px-10">
<div className="flex flex-col gap-4 w-full md:w-3/5 max-w-md">
<h1 className="text-2xl md:text-4xl">{t('title')}</h1>
<h1 className="text-2xl md:text-4xl" tabIndex={0}>
{t('title')}
</h1>

<div className="">
<p>{t('pageDescription')}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default function DataTable() {
return (
<div className="w-full block">
<div className="flex justify-between items-center">
<h3 className="my-4 w-full pt-4">{t('dataTableTitle')}</h3>
<h3 className="my-4 w-full pt-4" tabIndex={0}>
{t('dataTableTitle')}
</h3>
<div className="flex items-center text-consortium-blue-800 ">
{selectedEvents.length > 0 && (
<button
Expand Down Expand Up @@ -96,9 +98,9 @@ function ProvenanceEventRow({
{metadata.map(
({prop, translationKey}) =>
event[prop] && (
<div key={prop}>
<div key={prop} tabIndex={0}>
{t(translationKey)}{' '}
<strong>{event[prop] as string}</strong>
<strong tabIndex={0}>{event[prop] as string}</strong>
</div>
)
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function Provenance({objectId}: {objectId: string}) {
return (
<div className="w-full">
<div className="mx-auto px-4 sm:px-10 max-w-[1800px]">
<h2 id="provenance" className="text-2xl mb-2 mt-20">
<h2 id="provenance" className="text-2xl mb-2 mt-20" tabIndex={0}>
{t('title')}
</h2>
<p className="text-neutral-600 text-sm max-w-2xl mb-6">
Expand All @@ -70,7 +70,7 @@ export default async function Provenance({objectId}: {objectId: string}) {
<ProvenanceProvider events={userEvents}>
<div className="w-full">
<div className="mx-auto px-4 sm:px-10 max-w-[1800px]">
<h2 id="provenance" className="text-2xl mb-2 mt-20">
<h2 id="provenance" className="text-2xl mb-2 mt-20" tabIndex={0}>
{t('title')}
</h2>
<p className="text-neutral-600 text-sm max-w-2xl mb-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export default async function LocalContextsNotices() {

return (
<div className="my-16" id="localContextNotices">
<h2 className="text-2xl mb-4 scroll-mt-20">{t('title')}</h2>
<h2 className="text-2xl mb-4 scroll-mt-20" tabIndex={0}>
{t('title')}
</h2>
<p className="text-neutral-600 text-sm max-w-xl mb-6">
{t.rich('description', {
link: text => (
Expand All @@ -84,7 +86,10 @@ export default async function LocalContextsNotices() {
>
<div className="w-full xl:w-1/5 border-t border-neutral-400">
<div className="sticky top-8 py-1">
<h3 className="text-lg w-full my-1 flex items-center">
<h3
className="text-lg w-full my-1 flex items-center"
tabIndex={0}
>
{notice.title}
</h3>
<Image
Expand Down
6 changes: 3 additions & 3 deletions apps/researcher/src/app/[locale]/objects/[id]/metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function Metadata({
<div className="flex flex-col xl:flex-row gap-2 xl:gap-10">
<div className="w-full xl:w-1/5 border-t border-neutral-400 pt-4">
<div className="sticky top-0 py-1">
<h3 className="text-lg w-full my-1 flex items-center">
<h3 className="text-lg w-full my-1 flex items-center" tabIndex={0}>
{t(translationKey)}
</h3>
<div className="text-neutral-600 text-sm">
Expand Down Expand Up @@ -110,10 +110,10 @@ export async function MetadataEntry({

return (
<div className="border-t border-neutral-200 flex flex-col lg:flex-row justify-between gap-2 first:border-0 ">
<div className="w-full lg:w-2/3 py-3 whitespace-pre-wrap">
<div className="w-full lg:w-2/3 py-3 whitespace-pre-wrap" tabIndex={0}>
{children}
{languageCode && (
<div>
<div tabIndex={0}>
<Language languageCode={languageCode} />
</div>
)}
Expand Down
11 changes: 8 additions & 3 deletions apps/researcher/src/app/[locale]/objects/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default async function Details({params}: Props) {
<h1
className="text-2xl md:text-3xl lg:text-4xl 2xl:text-5xl max-w-5xl"
data-testid="page-title"
tabIndex={0}
>
{object.name || (
<span className="text-consortium-blue-100">
Expand Down Expand Up @@ -117,7 +118,7 @@ export default async function Details({params}: Props) {
<div className="mb-4">
{organization.address?.addressLocality}
</div>
<a href="#provider" className="p-4 -ml-4 italic">
<a href="#provider" className="p-4 -ml-4 italic" tabIndex={0}>
{t('providerInfo')}
</a>
</>
Expand All @@ -130,7 +131,9 @@ export default async function Details({params}: Props) {
<main className="w-full md:w-2/3 order-2 md:order-1">
<Notifications />
<div className="mb-4 mt-10 flex justify-between">
<h2 className="text-2xl">{t('metadata')}</h2>
<h2 className="text-2xl" tabIndex={0}>
{t('metadata')}
</h2>
</div>
<div className="flex flex-col gap-8 self-stretch">
<Metadata
Expand Down Expand Up @@ -230,7 +233,9 @@ export default async function Details({params}: Props) {
<div className="w-full">
<div className="mx-auto px-4 sm:px-10 max-w-[1800px]">
<div className="mt-10" id="provider">
<h2 className="text-xl mt-4">{t('dataProviderTitle')}</h2>
<h2 className="text-xl mt-4" tabIndex={0}>
{t('dataProviderTitle')}
</h2>
<div className="flex flex-col md:flex-row mt-4">
<div className="w-full md:w-1/2">
<div className="mb-4">{t('dataProviderDescription')}</div>
Expand Down
6 changes: 3 additions & 3 deletions apps/researcher/src/app/[locale]/objects/[id]/provided-by.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export function ProvidedBy({
})}
>
<div>
<div>
<div tabIndex={0}>
{t.rich('name', {
name: () => <strong>{name}</strong>,
name: () => <strong tabIndex={0}>{name}</strong>,
})}
</div>
{communityName && (
<div>
{t.rich('community', {
name: () => <strong>{communityName}</strong>,
name: () => <strong tabIndex={0}>{communityName}</strong>,
})}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ export function UserEnrichmentForm({
data-testid="enrichment-form"
>
<div className="flex justify-between items-center border-b -mx-4 px-4 pb-2 mb-2">
<h3>{t('title')}</h3>
<h3 tabIndex={0}>{t('title')}</h3>
<SlideOutButton
className="p-1 sm:py-2 sm:px-3 rounded-full text-xs bg-neutral-200/50 hover:bg-neutral-300/50 text-neutral-800 transition flex items-center gap-1"
id={slideOutId}
aira-label="Close form"
>
<XMarkIcon className='className="w-4 h-4 stroke-neutral-900' />
</SlideOutButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export function HeritageObjectListItem({
href={`/objects/${encodeRouteSegment(heritageObject.id)}`}
data-testid="object-card"
className="flex flex-row justify-start items-center gap-4 border-t border-neutral-200 py-3 w-full no-underline"
aria-label={t('heritageObject')}
>
<div className="w-30">
{imageUrl &&
Expand Down
7 changes: 4 additions & 3 deletions apps/researcher/src/messages/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
"backButton": "Search",
"noEntity": "Object could not be found",
"object": "Object",
"providerCurrentHolder": "Bronhouder object",
"providerCurrentHolder": "Data provider object",
"providerInfo": "More info",
"contactInfo": "Contact info",
"dataProviderTitle": "Bronhouder object",
"dataProviderTitle": "Data provider object",
"dataProviderDescription": "The data of this object is provided by:",
"websiteLabel": "Website",
"objectIdLabel": "Reference or object ID by the the data provider",
Expand Down Expand Up @@ -388,7 +388,7 @@
"addCommunity": "Create a community",
"showMyCommunities": "Show only my communities"
},
"Community": {
"Community": {
"title": "Community of",
"backButton": "All communities",
"noEntity": "Community could not be found",
Expand All @@ -398,6 +398,7 @@
"membersButton": "Manage members",
"goToListButton": "See all objects",
"objectListsTitle": "Lists",
"accessibilityObjectListsTitle": "Lists with objects created by this community",
"objectListsCardType": "List",
"objectListsSubTitle": "This community has {count, plural, =0 {0 lists} =1 {1 list} other {# lists}}",
"membersTitle": "Members",
Expand Down
3 changes: 2 additions & 1 deletion apps/researcher/src/messages/nl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"noData": "Geen <subject></subject> beschikbaar",
"identifier": "ID: {identifier}",
"metadata": "Metadata",
"name": "titel",
"name": "Titel",
"noName": "Geen titel",
"description": "Beschrijving",
"locationsCreated": "Locatie van creatie",
Expand Down Expand Up @@ -398,6 +398,7 @@
"membersButton": "Leden beheren",
"goToListButton": "Bekijk alle objecten",
"objectListsTitle": "Lijsten",
"accessibilityObjectListsTitle": "Lijsten met objecten, aangemaakt door deze community",
"objectListsCardType": "Lijst",
"objectListsSubTitle": "Deze community heeft {count, plural, =0 {0 lijsten} =1 {1 lijst} other {# lijsten}}",
"membersTitle": "Leden",
Expand Down

0 comments on commit a6c5e47

Please sign in to comment.