Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const AccessEditValues = (props: IProps) => {
</FormFeedback>
</FormGroup>
<FormGroup>
<Label>Tags</Label>
<Label for='searchTags'>Tags</Label>
<SearchDefinedOptions
definedOptions={props.tags}
disabled={props.disableEditing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const EquipmentEditValues = (props: IProps) => {
</div>

<FormGroup className='space-y-2'>
<Label for='tags'>Tags</Label>
<Label for='searchTagsEquipmentEditValues'>Tags</Label>
<SearchDefinedOptions
definedOptions={props.tags}
disabled={props.disableEditing}
Expand Down
2 changes: 1 addition & 1 deletion Keas.Mvc/ClientApp/src/components/Keys/KeyEditValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const KeyEditValues = (props: IProps) => {
</FormFeedback>
</FormGroup>
<FormGroup>
<Label>Tags</Label>
<Label for='searchTagsKeyEditValues'>Tags</Label>
<SearchDefinedOptions
definedOptions={props.searchableTags}
disabled={props.disableEditing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const WorkstationEditValues = (props: IProps) => {
</FormGroup>

<FormGroup>
<Label for='tags'>Tags</Label>
<Label for='searchTagsWorkstationEditValues'>Tags</Label>
<SearchDefinedOptions
definedOptions={props.tags}
disabled={props.disableEditing}
Expand Down
21 changes: 21 additions & 0 deletions Keas.Mvc/ClientApp/src/layoutAccessibility.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference types="node" />
import { afterEach, expect, it } from 'vitest';
import { cleanup, screen } from '@testing-library/react';
import { readFileSync } from 'node:fs';

const layout = readFileSync('../Views/Shared/_Layout.cshtml', 'utf8');

afterEach(() => {
cleanup();
document.body.innerHTML = '';
});

it('names the actual mobile navigation button using its visible Menu label', () => {
const toggle = layout.match(/<button\b[^>]*data-navigation-toggle[\s\S]*?<\/button>/)?.[0];
expect(toggle).toBeTruthy();
document.body.innerHTML = toggle;
const button = screen.getByRole('button', { name: 'Menu' });
expect(button).toHaveTextContent('Menu');
expect(button).toHaveAttribute('aria-expanded', 'false');
expect(button).toHaveAttribute('aria-controls', 'navbarText');
});
12 changes: 6 additions & 6 deletions Keas.Mvc/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="space-y-8 pb-8">
<header class="space-y-2">
@await Html.PartialAsync("_ActiveTeamEyebrow")
<h1 class="m-0 text-3xl font-semibold text-base-content">Welcome to PEAKS, @User.GetNameClaim()</h1>
<h1 class="m-0 text-3xl font-semibold leading-normal text-base-content">Welcome to PEAKS, @User.GetNameClaim()</h1>
<p class="m-0 text-lg text-base-content/70">View your assignments and manage your team's assets.</p>
</header>

Expand Down Expand Up @@ -65,7 +65,7 @@
}

<section aria-labelledby="quick-actions-heading" class="space-y-4">
<h2 id="quick-actions-heading" class="mb-2 text-2xl font-semibold text-base-content">Quick Actions</h2>
<h2 id="quick-actions-heading" class="mb-2 text-2xl font-semibold leading-normal text-base-content">Quick Actions</h2>
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
<a asp-controller="Confirm" asp-action="MyStuff"
class="group block rounded-sm border border-main-border bg-base-100 p-5 text-base-content transition hover:bg-base-200 hover:shadow-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">
Expand All @@ -74,7 +74,7 @@
<hero-icon name="arrow-right"
class="size-5 text-base-content/40 group-hover:text-primary"></hero-icon>
</div>
<h3 class="m-0 text-xl font-semibold">MyStuff</h3>
<h3 class="m-0 text-xl font-semibold leading-normal">MyStuff</h3>
<p class="mb-0 mt-2 text-sm leading-6 text-base-content/70">View your assigned keys, equipment, access,
workstations, and documents.</p>
</a>
Expand All @@ -87,7 +87,7 @@
<hero-icon name="arrow-right"
class="size-5 text-base-content/40 group-hover:text-primary"></hero-icon>
</div>
<h3 class="m-0 text-xl font-semibold">Administer Team</h3>
<h3 class="m-0 text-xl font-semibold leading-normal">Administer Team</h3>
<p class="mb-0 mt-2 text-sm leading-6 text-base-content/70">Manage your team's settings, permissions,
and imports.</p>
</a>
Expand All @@ -101,7 +101,7 @@
<hero-icon name="arrow-right"
class="size-5 text-base-content/40 group-hover:text-primary"></hero-icon>
</div>
<h3 class="m-0 text-xl font-semibold">Team Assets</h3>
<h3 class="m-0 text-xl font-semibold leading-normal">Team Assets</h3>
<p class="mb-0 mt-2 text-sm leading-6 text-base-content/70">Browse your team's people and their asset
assignments.</p>
</a>
Expand All @@ -121,7 +121,7 @@
AuthorizationService.AuthorizeAsync(User, AccessCodes.Codes.SpaceMasterAccess)).Succeeded;

<section aria-labelledby="browse-assets-heading" class="space-y-4">
<h2 id="browse-assets-heading" class="m-0 text-2xl font-semibold text-base-content">Browse Assets</h2>
<h2 id="browse-assets-heading" class="m-0 text-2xl font-semibold leading-normal text-base-content">Browse Assets</h2>
<ul class="m-0 max-w-2xl list-none divide-y divide-main-border p-0">
<li class="people-color">
<a href="/@teamSlug/people"
Expand Down
84 changes: 43 additions & 41 deletions Keas.Mvc/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,40 @@
</head>

<body class="flex min-h-screen flex-col bg-base-200 font-sans text-base-content">
@if (Configuration["Environment:ShowTestBanner"] == "Yes")
{
<div role="alert" class="shrink-0 bg-error text-error-content">
<div class="content-wrapper flex items-center justify-center gap-3 py-3 text-center sm:py-4">
<hero-icon name="exclamation-triangle" class="size-7 shrink-0 sm:size-8" aria-hidden="true"></hero-icon>
<p class="m-0 text-base font-semibold leading-snug sm:text-lg">
<strong class="block text-lg font-bold uppercase tracking-wide sm:inline sm:text-xl">Test site</strong>
<span class="block sm:ml-3 sm:inline">Beta testing. Data will not be retained.</span>
</p>
</div>
</div>
}
<div class="flex-1">
<header class="bg-base-100 py-4">
<div class="content-wrapper">
<header class="bg-base-100">
<a href="#main-content"
class="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[1200] focus:rounded-md focus:bg-primary focus:px-4 focus:py-3 focus:font-semibold focus:text-primary-content focus:outline-2 focus:outline-offset-2 focus:outline-primary">Skip to main content</a>
@if (Configuration["Environment:ShowTestBanner"] == "Yes")
{
<div role="alert" class="shrink-0 bg-error text-error-content">
<div class="content-wrapper flex items-center justify-center gap-3 py-3 text-center sm:py-4">
<hero-icon name="exclamation-triangle" class="size-7 shrink-0 sm:size-8" aria-hidden="true"></hero-icon>
<p class="m-0 text-base font-semibold leading-normal sm:text-lg">
<strong class="block text-lg font-bold uppercase tracking-wide sm:inline sm:text-xl">Test site</strong>
<span class="block sm:ml-3 sm:inline">Beta testing. Data will not be retained.</span>
</p>
</div>
</div>
}
<div class="content-wrapper py-4">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div class="min-w-0">

<a class="inline-flex items-center gap-2 rounded-md text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"
asp-area="" asp-controller="Home" asp-action="Index">
<img class="h-10 w-auto shrink-0" src="~/media/peaks.svg" alt="" width="40" height="40">
<div class="min-w-0">
<h1 class="text-xl font-bold">PEAKS</h1>
<p class="text-sm text-base-content/70">People, Equipment, Access, Keys and Space</p>
<h1 class="text-xl font-bold leading-normal">PEAKS</h1>
<p class="text-sm leading-normal text-base-content/70">People, Equipment, Access, Keys and Space</p>
</div>
</a>


</div>
<div class="shrink-0">
<a target="blank" href="https://ucdavis.edu">
<a target="_blank" rel="noopener noreferrer" href="https://ucdavis.edu"
class="inline-flex min-h-11 items-center justify-center rounded-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">
<img class="mx-auto w-28 max-w-full opacity-80 sm:w-32" src="~/media/ucdavisbluelogo.svg"
asp-append-version="true" alt="UC Davis Logo">
</a>
Expand All @@ -147,8 +150,7 @@
<div class="content-wrapper">
<button
class="my-2 inline-flex items-center gap-2 rounded-md pe-4 py-2 text-lg font-semibold text-base-content hover:text-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary lg:hidden"
type="button" data-navigation-toggle aria-controls="navbarText" aria-expanded="false"
aria-label="Toggle navigation">
type="button" data-navigation-toggle aria-controls="navbarText" aria-expanded="false">
<hero-icon name="bars-3" class="size-5" aria-hidden="true"></hero-icon>
<span class="text-lg font-semibold text-base-content">Menu</span>
</button>
Expand Down Expand Up @@ -303,37 +305,37 @@
</div>
</div>
</nav>
@if (!string.IsNullOrWhiteSpace(TempData["ErrorMessage"] as string))
{
<div class="content-wrapper">
<div class="alert alert-error">
<button type="button" class="float-right cursor-pointer" data-dismiss-message
aria-label="Dismiss message">
<hero-icon name="x-mark" class="size-5"></hero-icon>
</button> @TempData["ErrorMessage"]
<main id="main-content" tabindex="-1" class="content-wrapper mt-8">
@if (!string.IsNullOrWhiteSpace(TempData["ErrorMessage"] as string))
{
<div class="mb-4">
<div class="alert alert-error">
<button type="button" class="btn btn-ghost btn-square min-h-11 min-w-11 float-right" data-dismiss-message
aria-label="Dismiss message">
<hero-icon name="x-mark" class="size-5"></hero-icon>
</button> @TempData["ErrorMessage"]
</div>
</div>
</div>
}
@if (!string.IsNullOrWhiteSpace(TempData["Message"] as string))
{
<div class="content-wrapper">
<div class="alert alert-info">
<button type="button" class="float-right cursor-pointer" data-dismiss-message
aria-label="Dismiss message">
<hero-icon name="x-mark" class="size-5"></hero-icon>
</button> @TempData["Message"]
}
@if (!string.IsNullOrWhiteSpace(TempData["Message"] as string))
{
<div class="mb-4">
<div class="alert alert-info">
<button type="button" class="btn btn-ghost btn-square min-h-11 min-w-11 float-right" data-dismiss-message
aria-label="Dismiss message">
<hero-icon name="x-mark" class="size-5"></hero-icon>
</button> @TempData["Message"]
</div>
</div>
</div>
}
}

<main role="main" class="content-wrapper mt-8">
@* Inject React *@
<div id="root"></div>

@RenderBody()
</main>
</div>
<footer class="content-wrapper mt-8 shrink-0 py-6 text-sm text-base-content/60">
<footer class="content-wrapper mt-8 shrink-0 py-6 text-sm leading-normal text-base-content/60">
<p>Copyright &copy; @DateTime.Now.Year The Regents of the University of California, Davis campus.
All rights reserved.</p>
</footer>
Expand Down
Loading