+ {tags &&
{tags.split(',').map(tag => tag.trim()).filter(Boolean).map((tag, index) =>
{tag} )}
}
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/DropdownScrolling.test.tsx b/Keas.Mvc/ClientApp/src/components/Shared/DropdownScrolling.test.tsx
index f2666a84b..051c07acb 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/DropdownScrolling.test.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/DropdownScrolling.test.tsx
@@ -136,8 +136,8 @@ describe.each(dropdowns)('$name scrolling', ({ renderDropdown }) => {
it('closes the previous selector when another selector is opened', () => {
render(<>
-
-
+
+
>);
const first = screen.getByRole('combobox', { name: 'First tags' });
const second = screen.getByRole('combobox', { name: 'Second tags' });
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/Filtering.tsx b/Keas.Mvc/ClientApp/src/components/Shared/Filtering.tsx
index f787c90fa..965a25de3 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/Filtering.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/Filtering.tsx
@@ -24,14 +24,8 @@ export const ColumnFilterHeaders =
({
{headerGroups.map(group => (
{group.headers.map(header => (
-
-
+
+
{header.column.getCanFilter()
? flexRender(
header.column.columnDef.meta?.Filter || DefaultColumnFilter,
@@ -39,7 +33,7 @@ export const ColumnFilterHeaders = ({
)
: null}
-
+
))}
))}
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/ReactTable.tsx b/Keas.Mvc/ClientApp/src/components/Shared/ReactTable.tsx
index 0e850a8ac..1d8f6ec94 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/ReactTable.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/ReactTable.tsx
@@ -14,11 +14,13 @@ import { ReactTableUtil } from '../../util/tableUtil';
export const ReactTable = ({
columns,
data,
- initialState
+ initialState,
+ tableClassName = ''
}: {
columns: PeaksColumn[];
data: T[];
initialState?: PeaksInitialState;
+ tableClassName?: string;
}) => {
const table = useTable({
features: peaksFeatures,
@@ -53,7 +55,7 @@ export const ReactTable = ({
return (
-
+
{headerGroups.map(headerGroup => (
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/ReadOnlyAssetValues.test.tsx b/Keas.Mvc/ClientApp/src/components/Shared/ReadOnlyAssetValues.test.tsx
index fd8079169..54bd2a8b7 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/ReadOnlyAssetValues.test.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/ReadOnlyAssetValues.test.tsx
@@ -1,7 +1,15 @@
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
import { afterEach, expect, it, vi } from 'vitest';
+import AccessEditValues from '../Access/AccessEditValues';
+import EquipmentEditValues from '../Equipment/EquipmentEditValues';
+import KeyEditValues from '../Keys/KeyEditValues';
import KeySerialEditValues from '../Keys/KeySerialEditValues';
+import WorkstationEditValues from '../Workstations/WorkstationEditValues';
+import { fakeAccesses } from '../specs/mockData/Access';
+import { fakeEquipment } from '../specs/mockData/Equipment';
+import { fakeKeys } from '../specs/mockData/Key';
import { fakeKeySerials } from '../specs/mockData/KeySerial';
+import { fakeWorkstations } from '../specs/mockData/Workstation';
afterEach(cleanup);
@@ -20,3 +28,62 @@ it('displays immutable key values as text while keeping serial edits functional'
fireEvent.change(numberInput, { target: { value: 'NEW-123' } });
expect(change).toHaveBeenCalledWith('number', 'NEW-123');
});
+
+it.each([
+ {
+ name: 'access',
+ element: ,
+ labels: ['Name', 'Notes', 'Tags']
+ },
+ {
+ name: 'key',
+ element: ,
+ labels: ['Name', 'Code', 'Notes', 'Tags']
+ },
+ {
+ name: 'key serial',
+ element: ,
+ labels: ['Key Serial Number', 'Status', 'Notes', 'Tags']
+ },
+ {
+ name: 'workstation',
+ element: ,
+ labels: ['Name', 'Room', 'Notes', 'Tags']
+ }
+])('associates every $name edit field with its visible label', ({ element, labels }) => {
+ render(element);
+ labels.forEach(label => {
+ expect(screen.getByLabelText(label, { exact: true })).toHaveAccessibleName(label);
+ });
+});
+
+it('names equipment fields and documentation links', () => {
+ render( );
+ [
+ 'Name', 'Type', 'Serial Number / Identifier', 'Protection Level',
+ 'Availability Level', 'Make', 'Model', 'Managed System ID', 'Notes', 'Tags', 'Room'
+ ].forEach(label => {
+ expect(screen.getByLabelText(label, { exact: true })).toHaveAccessibleName(label);
+ });
+ expect(screen.getByRole('link', { name: 'About protection levels' })).toHaveAttribute('href');
+ expect(screen.getByRole('link', { name: 'About availability levels' })).toHaveAttribute('href');
+ expect(screen.getByRole('link', { name: 'About equipment attributes' })).toHaveAttribute('href');
+});
+
+it('keeps labels associated with their own controls when two key editors are mounted', () => {
+ render(<>
+
+
+ >);
+ ['Name', 'Code', 'Notes', 'Tags'].forEach(label => {
+ const controls = screen.getAllByLabelText(label, { exact: true });
+ expect(controls).toHaveLength(2);
+ expect(controls[0].id).not.toBe(controls[1].id);
+ controls.forEach(control => expect(control).toHaveAccessibleName(label));
+ });
+});
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.test.tsx b/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.test.tsx
index d7899c3e5..b6cb8771b 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.test.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.test.tsx
@@ -1,4 +1,13 @@
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
+import { Context } from '../../Context';
+import SearchAccess from '../Access/SearchAccess';
+import SearchEquipment from '../Equipment/SearchEquipment';
+import SearchKeys from '../Keys/SearchKeys';
+import SearchKeySerials from '../Keys/SearchKeySerials';
+import AssignPerson from '../People/AssignPerson';
+import SearchSpaces from '../Spaces/SearchSpaces';
+import SearchWorkstations from '../Workstations/SearchWorkstations';
import SearchAsyncOptions from './SearchAsyncOptions';
it('searches asynchronously, selects a server result and hides the menu on outside focus after rerender', async () => {
@@ -6,6 +15,7 @@ it('searches asynchronously, selects a server result and hides the menu on outsi
const onChange = vi.fn();
const props = {
id: 'people-search',
+ inputProps: { 'aria-label': 'Find person' },
isLoading: false,
minLength: 2,
placeholder: 'Find person',
@@ -17,7 +27,7 @@ it('searches asynchronously, selects a server result and hides the menu on outsi
options: []
};
const { rerender } = render( );
- const input = screen.getByRole('combobox');
+ const input = screen.getByRole('combobox', { name: 'Find person' });
fireEvent.focus(input);
fireEvent.change(input, { target: { value: 'Sa' } });
await waitFor(() => expect(onSearch).toHaveBeenCalledWith('Sa'));
@@ -43,6 +53,7 @@ it('preserves a default selection and permits a new value', async () => {
render(
{
expect.objectContaining({ name: 'New person', customOption: true })
]);
});
+
+it.each([
+ { name: 'Supervisor', element: },
+ { name: 'Pick an access to assign', element: },
+ { name: 'Pick an equipment to assign', element: },
+ { name: 'Pick a key serial to assign', element: },
+ { name: 'Pick a workstation to assign', element: }
+])('uses the visible label "$name" for an assignment search', ({ name, element }) => {
+ render(
+ {element}
+ );
+ const input = screen.getByRole('combobox', { name });
+ expect(screen.getByLabelText(name)).toBe(input);
+});
+
+it('uses external labels for Room and key searches without overriding them', () => {
+ render(<>
+ Room
+
+ Pick a key to associate
+
+ >);
+ expect(screen.getByRole('combobox', { name: 'Room' })).toBe(screen.getByLabelText('Room'));
+ expect(screen.getByRole('combobox', { name: 'Pick a key to associate' })).toBe(screen.getByLabelText('Pick a key to associate'));
+});
+
+it('keeps standalone searches named and generates unique IDs for repeated instances', () => {
+ render(<>
+
+
+
+
+ >);
+ expect(screen.getAllByRole('combobox', { name: 'Search for space' })).toHaveLength(2);
+ expect(screen.getAllByRole('combobox', { name: 'Search for key by name or by serial number' })).toHaveLength(2);
+ const inputs = screen.getAllByRole('combobox');
+ expect(new Set(inputs.map(input => input.id)).size).toBe(inputs.length);
+});
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.tsx b/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.tsx
index 9473017c2..48a521d7c 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/SearchAsyncOptions.tsx
@@ -1,7 +1,9 @@
+import { InputHTMLAttributes } from 'react';
import { SearchCombobox } from './SearchCombobox';
interface IProps {
id: string;
+ inputProps?: InputHTMLAttributes;
isLoading: boolean;
minLength: number;
placeholder: string;
@@ -23,6 +25,7 @@ const SearchAsyncOptions = (props: IProps) => {
return (
{
+ it('updates a persistent live region for matches, no matches, and dismissal', () => {
+ render( );
+ const status = screen.getByRole('status');
+ const input = screen.getByRole('combobox');
+ expect(status).toBeEmptyDOMElement();
+ fireEvent.change(input, { target: { value: 'lap' } });
+ expect(status).toHaveTextContent('1 option available.');
+ fireEvent.change(input, { target: { value: 'missing' } });
+ expect(screen.getByRole('status')).toBe(status);
+ expect(status).toHaveTextContent('No matches found');
+ fireEvent.keyDown(input, { key: 'Escape' });
+ expect(status).toBeEmptyDOMElement();
+ });
+
+ it('keeps the visible label as its name before and after keyboard selection', () => {
+ const change = vi.fn();
+ render(<>
+ Room
+
+ >);
+ const input = screen.getByRole('combobox', { name: 'Room' });
+ expect(screen.getByLabelText('Room')).toBe(input);
+ fireEvent.change(input, { target: { value: '101' } });
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
+ fireEvent.keyDown(input, { key: 'Enter' });
+ expect(change).toHaveBeenCalledWith(['Room 101']);
+ expect(input).toHaveValue('Room 101');
+ expect(input).toHaveAccessibleName('Room');
+ });
+
+ it('preserves an explicit accessible name for a standalone search', () => {
+ render( );
+ expect(screen.getByRole('combobox', { name: 'Find a person' })).toBeInTheDocument();
+ });
+
it('filters suggestions and selects with the keyboard', () => {
const change = vi.fn();
render( );
@@ -85,6 +121,7 @@ describe('DaisyUI search combobox', () => {
expect(screen.queryByRole('listbox')).toBeNull();
fireEvent.change(input, { target: { value: 'Ali' } });
fireEvent.change(input, { target: { value: 'Alice' } });
+ expect(screen.getByRole('status')).toHaveTextContent('Searching…');
await waitFor(() => expect(search).toHaveBeenCalledWith('Alice'));
expect(search).toHaveBeenCalledTimes(1);
view.rerender( true} />);
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/SearchCombobox.tsx b/Keas.Mvc/ClientApp/src/components/Shared/SearchCombobox.tsx
index ad8423aa4..1a1caf693 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/SearchCombobox.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/SearchCombobox.tsx
@@ -23,6 +23,7 @@ interface Props {
newSelectionPrefix?: string;
filterBy?: (option: any) => boolean;
highlightOnlyResult?: boolean;
+ // Use an associated label, or supply aria-label/aria-labelledby here.
inputProps?: React.InputHTMLAttributes;
renderMenuItemChildren?: (option: any, props: { text: string }, index: number) => React.ReactNode;
}
@@ -108,7 +109,7 @@ export const SearchCombobox = (props: Props) => {
))}
= 0 ? `${props.id}-option-${activeIndex}` : undefined}
aria-invalid={props.isInvalid || undefined} aria-busy={loading || undefined}
@@ -120,7 +121,7 @@ export const SearchCombobox = (props: Props) => {
setQuery(event.target.value); setOpen(true); setActive(-1);
}}
onKeyDown={handleKeyDown} />
- {loading && }
+ {loading && }
{props.clearButton && selected.length > 0 && !props.disabled && (
{ commit([]); setQuery(''); input.current?.focus(); setOpen(false); }}>
@@ -128,6 +129,11 @@ export const SearchCombobox = (props: Props) => {
)}
+
+ {expanded ? loading ? 'Searching…' : choices.length
+ ? `${choices.length} ${choices.length === 1 ? 'option' : 'options'} available.`
+ : props.emptyLabel ?? 'No matches found' : ''}
+
{expanded &&
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/TableCompatibility.test.tsx b/Keas.Mvc/ClientApp/src/components/Shared/TableCompatibility.test.tsx
index 7b1df2956..29cd67bbe 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/TableCompatibility.test.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/TableCompatibility.test.tsx
@@ -11,6 +11,7 @@ import AccessAssignmentTable from '../Access/AccessAssignmentTable';
import EquipmentTable from '../Equipment/EquipmentTable';
import KeySerialTable from '../Keys/KeySerialTable';
import KeyTable from '../Keys/KeyTable';
+import KeyList from '../Keys/KeyList';
import PeopleTable from '../People/PeopleTable';
import SpacesTable from '../Spaces/SpacesTable';
import { fakeAccesses } from '../specs/mockData/Access';
@@ -160,6 +161,42 @@ const shownIds = (
return details.mock.calls.map(([record]) => record.id);
};
+it.each(tableCases)(
+ 'names every column in $name without exposing filter cells as extra headers',
+ ({ element }) => {
+ const { container } = render(element(['Alpha'], vi.fn()));
+ expect(screen.getByRole('columnheader', { name: 'Details' }))
+ .toBeInTheDocument();
+ screen.getAllByRole('columnheader').forEach(header => {
+ expect(header).toHaveAccessibleName();
+ });
+ const filters = container.querySelector('.asset-table-filters');
+ expect(filters.querySelector('div[aria-label]')).toBeNull();
+ filters.querySelectorAll('input, select').forEach(control => {
+ expect(control).toHaveAccessibleName();
+ });
+ expect(within(filters as HTMLElement).queryAllByRole('columnheader'))
+ .toHaveLength(0);
+ }
+);
+
+it.each([
+ ['keys', 'Serials (In Use / Total)'],
+ ['spaces', 'Workstations (In Use / Total)']
+])('exposes the %s count explanation without hover', (name, heading) => {
+ render(tableCases.find(table => table.name === name).element(['Alpha'], vi.fn()));
+ expect(screen.getByRole('columnheader', { name: heading })).toBeVisible();
+ expect(screen.getByText('(In Use / Total)')).toBeVisible();
+});
+
+it('exposes the nested key list count explanation without hover', () => {
+ render( );
+ expect(screen.getByRole('columnheader', { name: 'Serials (In Use / Total)' }))
+ .toBeVisible();
+ expect(screen.getByText('(In Use / Total)')).toBeVisible();
+ expect(screen.getByRole('columnheader', { name: 'Details' })).toBeInTheDocument();
+});
+
it.each(tableCases)(
'preserves case, natural numbers and ties in $name',
({ header, element }) => {
diff --git a/Keas.Mvc/ClientApp/src/components/Shared/TableFilters.test.tsx b/Keas.Mvc/ClientApp/src/components/Shared/TableFilters.test.tsx
index 5f22c43b6..b4d41a12b 100644
--- a/Keas.Mvc/ClientApp/src/components/Shared/TableFilters.test.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Shared/TableFilters.test.tsx
@@ -8,9 +8,11 @@ import {
import EquipmentTable from '../Equipment/EquipmentTable';
import AccessTable from '../Access/AccessTable';
import KeySerialTable from '../Keys/KeySerialTable';
+import SpacesTable from '../Spaces/SpacesTable';
import { fakeEquipment } from '../specs/mockData/Equipment';
import { fakeAccesses } from '../specs/mockData/Access';
import { fakeKeySerials } from '../specs/mockData/KeySerial';
+import { fakeSpaces } from '../specs/mockData/Space';
afterEach(() => {
cleanup();
@@ -23,6 +25,23 @@ const names = (container: HTMLElement) =>
row => row.children[2].textContent
);
+it('names the workstation filter and preserves its assigned-space behavior', () => {
+ const { container } = render(
+
+ );
+ const filter = screen.getByRole('combobox', { name: 'Filter workstations' });
+ fireEvent.change(filter, { target: { value: 'assigned' } });
+ expect(container.querySelectorAll('tbody tr')).toHaveLength(1);
+ expect(container.querySelector('tbody')).toHaveTextContent('Temporary Building 200');
+ fireEvent.change(filter, { target: { value: 'all' } });
+ expect(container.querySelectorAll('tbody tr')).toHaveLength(2);
+});
+
it.each([
['expired', ['Past', 'Now']],
['unexpired', ['Later', 'Three weeks', 'Six weeks']],
diff --git a/Keas.Mvc/ClientApp/src/components/Spaces/SearchSpaces.tsx b/Keas.Mvc/ClientApp/src/components/Spaces/SearchSpaces.tsx
index 8418cfcae..5fbc63a30 100644
--- a/Keas.Mvc/ClientApp/src/components/Spaces/SearchSpaces.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Spaces/SearchSpaces.tsx
@@ -1,10 +1,12 @@
-import { useContext, useState } from 'react';
+import { useContext, useId, useState } from 'react';
import { SearchCombobox, Highlighter } from '../Shared/SearchCombobox';
import { toast } from 'react-toastify';
import { Context } from '../../Context';
import { ISpace } from '../../models/Spaces';
interface IProps {
+ // Supply an id when associating a visible label outside this component.
+ id?: string;
onSelect: (space: ISpace) => void;
defaultSpace?: ISpace;
isRequired?: boolean;
@@ -13,6 +15,7 @@ interface IProps {
// TODO: need a way to clear out selected space
// Assign a space via search lookup, unless a space is already provided
const SearchSpaces = (props: IProps) => {
+ const inputId = useId();
const [isSearchLoading, setIsSearchLoading] = useState(false);
const [spaces, setSpaces] = useState([]);
const context = useContext(Context);
@@ -72,7 +75,8 @@ const SearchSpaces = (props: IProps) => {
return (
{
});
const headerRecord = container.querySelector('.table-row').textContent;
- expect(headerRecord).toBe(' RoomRoom NameKeysEquipmentWorkstations ');
+ expect(headerRecord).toBe('DetailsRoomRoom NameKeysEquipmentWorkstations (In Use / Total)');
});
it('Shows spaces list', async () => {
diff --git a/Keas.Mvc/ClientApp/src/components/Spaces/SpacesList.tsx b/Keas.Mvc/ClientApp/src/components/Spaces/SpacesList.tsx
index ef284bd1d..b1c5896ae 100644
--- a/Keas.Mvc/ClientApp/src/components/Spaces/SpacesList.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Spaces/SpacesList.tsx
@@ -23,7 +23,7 @@ const SpacesList = (props: IProps) => {
const spacesList =
!spaces || spaces.length < 1 ? (
- No Spaces Found
+ No Spaces Found
) : (
spaces.map(renderItem)
@@ -33,7 +33,7 @@ const SpacesList = (props: IProps) => {
-
+ Details
Room
Room Name
Actions
diff --git a/Keas.Mvc/ClientApp/src/components/Spaces/SpacesTable.tsx b/Keas.Mvc/ClientApp/src/components/Spaces/SpacesTable.tsx
index ee5a8ba77..6db56f22a 100644
--- a/Keas.Mvc/ClientApp/src/components/Spaces/SpacesTable.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Spaces/SpacesTable.tsx
@@ -1,7 +1,5 @@
import { AssetDetailsLink } from '../Shared/AssetDetailsLink';
-import { InformationCircleIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
-import { UncontrolledTooltip } from 'reactstrap';
import { ISpace, ISpaceInfo } from '../../models/Spaces';
import { ReactTableUtil } from '../../util/tableUtil';
import { ReactTable } from '../Shared/ReactTable';
@@ -24,6 +22,7 @@ const SpaceWorkstationColumnFilter = ({ column }) => {
return (
{
setFilter(e.target.value || undefined);
@@ -70,7 +69,7 @@ const SpacesTable = (props: IProps) => {
onClick={() => props.showDetails(data.row.original.space)}
/>
),
- header: ' '
+ header: 'Details'
},
{
cell: data => (
@@ -115,14 +114,7 @@ const SpacesTable = (props: IProps) => {
header: () => (
Workstations{' '}
-
-
- In Use / Total
-
+ (In Use / Total)
),
accessorFn: spaceInfo => {
diff --git a/Keas.Mvc/ClientApp/src/components/Workstations/SearchWorkstations.tsx b/Keas.Mvc/ClientApp/src/components/Workstations/SearchWorkstations.tsx
index 90622dcc9..796474926 100644
--- a/Keas.Mvc/ClientApp/src/components/Workstations/SearchWorkstations.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Workstations/SearchWorkstations.tsx
@@ -1,6 +1,6 @@
import { DisplayField } from '../Shared/AssetSummary';
import { PlusIcon } from '@heroicons/react/24/outline';
-import { useContext, useState } from 'react';
+import { useContext, useId, useState } from 'react';
import { SearchCombobox, Highlighter } from '../Shared/SearchCombobox';
import { toast } from 'react-toastify';
import { Button } from 'reactstrap';
@@ -18,6 +18,7 @@ interface IProps {
// Search for existing workstation then send selection back to parent
const SearchWorkstations = (props: IProps) => {
+ const inputId = useId();
const [isSearchLoading, setIsSearchLoading] = useState(false);
const [workstations, setWorkstations] = useState([]);
const context = useContext(Context);
@@ -25,10 +26,10 @@ const SearchWorkstations = (props: IProps) => {
const renderSelectWorkstation = () => {
return (
-
Pick a workstation to assign
+
Pick a workstation to assign
{
const headerRecord = container.querySelector('thead').textContent;
- expect(headerRecord).toBe('NameSpaceAssigned ToExpirationActions');
+ expect(headerRecord).toBe('DetailsNameSpaceAssigned ToExpirationActions');
});
it('Shows add button', async () => {
diff --git a/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationEditValues.tsx b/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationEditValues.tsx
index a2ccd4574..f576657d0 100644
--- a/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationEditValues.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationEditValues.tsx
@@ -1,5 +1,6 @@
import { AssetActions, AssetSummary, DisplayField } from '../Shared/AssetSummary';
import { PencilSquareIcon } from '@heroicons/react/24/outline';
+import { useId } from 'react';
import { Button, FormFeedback, FormGroup, Input, Label } from 'reactstrap';
import { IValidationError } from '../../models/Shared';
import { ISpace } from '../../models/Spaces';
@@ -19,6 +20,7 @@ interface IProps {
}
const WorkstationEditValues = (props: IProps) => {
+ const formId = useId();
if (!props.selectedWorkstation) {
return null;
}
@@ -49,8 +51,8 @@ const WorkstationEditValues = (props: IProps) => {
- Name
- Name
+ props.changeProperty('name', e.target.value)}
invalid={error && error.path === 'name'} />
@@ -61,14 +63,15 @@ const WorkstationEditValues = (props: IProps) => {
? `${props.selectedWorkstation.space.roomNumber} ${props.selectedWorkstation.space.bldgName}` : null}
) : (
- Room
- props.changeProperty('space', space)}
+ Room
+ props.changeProperty('space', space)}
defaultSpace={props.space || props.selectedWorkstation.space} isRequired />
)}
- Notes
+ Notes
{
- Tags
+ Tags
{
}
onSelect={e => props.changeProperty('tags', e.join(','))}
placeholder='Search for Tags'
- id='searchTagsWorkstationEditValues'
+ id={`${formId}-tags`}
/>
{error && error.path === 'tags' && error.message}
diff --git a/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationList.tsx b/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationList.tsx
index 5be805560..2b34d5072 100644
--- a/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationList.tsx
+++ b/Keas.Mvc/ClientApp/src/components/Workstations/WorkstationList.tsx
@@ -16,7 +16,7 @@ const WorkstationList = (props: IProps) => {
const workstations =
!props.workstations || props.workstations.length < 1 ? (
- No Workstations Found
+ No Workstations Found
) : (
props.workstations.map(x => (
@@ -38,7 +38,7 @@ const WorkstationList = (props: IProps) => {
-
+ Details
Name
Space
Assigned To
diff --git a/Keas.Mvc/ClientApp/src/styles/asset-tables.css b/Keas.Mvc/ClientApp/src/styles/asset-tables.css
index bbde89131..e07afe246 100644
--- a/Keas.Mvc/ClientApp/src/styles/asset-tables.css
+++ b/Keas.Mvc/ClientApp/src/styles/asset-tables.css
@@ -31,11 +31,33 @@
white-space: nowrap;
}
- .asset-table .table .asset-table-filters th {
+ .asset-table .table .asset-table-filters td {
padding-top: 0;
padding-bottom: 0.75rem;
}
+ /* Keep filtering and pagination from resizing equipment columns. */
+ .asset-table .equipment-table {
+ table-layout: fixed;
+ min-width: 64rem;
+ }
+
+ .asset-table .equipment-table th:first-child {
+ width: 7rem;
+ }
+
+ .asset-table .equipment-table th:nth-child(5) {
+ width: 14rem;
+ }
+
+ .asset-table .equipment-table th:last-child {
+ width: 9rem;
+ }
+
+ .asset-table .equipment-table tbody td {
+ overflow-wrap: anywhere;
+ }
+
.asset-table .table tbody tr:nth-child(odd) {
background: color-mix(
in oklab,
diff --git a/Keas.Mvc/Views/Admin/Index.cshtml b/Keas.Mvc/Views/Admin/Index.cshtml
index 9007a958e..21f988277 100644
--- a/Keas.Mvc/Views/Admin/Index.cshtml
+++ b/Keas.Mvc/Views/Admin/Index.cshtml
@@ -26,7 +26,7 @@
@item.Slug
}
@@ -48,7 +48,7 @@
{
@item.Id @item.Name
- View group
+ View group
}
diff --git a/Keas.Mvc/Views/DocumentSettings/Index.cshtml b/Keas.Mvc/Views/DocumentSettings/Index.cshtml
index 4226b5a5d..1c230b2f7 100644
--- a/Keas.Mvc/Views/DocumentSettings/Index.cshtml
+++ b/Keas.Mvc/Views/DocumentSettings/Index.cshtml
@@ -60,7 +60,7 @@
@item.AccountName @item.AccountId @item.ApiBasePath
}
diff --git a/Keas.Mvc/Views/Group/IncompleteDocumentsReport.cshtml b/Keas.Mvc/Views/Group/IncompleteDocumentsReport.cshtml
index b1730e231..8d86481f5 100644
--- a/Keas.Mvc/Views/Group/IncompleteDocumentsReport.cshtml
+++ b/Keas.Mvc/Views/Group/IncompleteDocumentsReport.cshtml
@@ -37,7 +37,7 @@
Other
}
Team
-
+ Actions
diff --git a/Keas.Mvc/Views/Group/PeopleLeavingWithAssets.cshtml b/Keas.Mvc/Views/Group/PeopleLeavingWithAssets.cshtml
index c7f2e8670..d8e29b1c8 100644
--- a/Keas.Mvc/Views/Group/PeopleLeavingWithAssets.cshtml
+++ b/Keas.Mvc/Views/Group/PeopleLeavingWithAssets.cshtml
@@ -70,7 +70,7 @@
Team
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/ActionsByAdmins.cshtml b/Keas.Mvc/Views/Report/ActionsByAdmins.cshtml
index a8274ab17..24f15d4c1 100644
--- a/Keas.Mvc/Views/Report/ActionsByAdmins.cshtml
+++ b/Keas.Mvc/Views/Report/ActionsByAdmins.cshtml
@@ -61,7 +61,7 @@
Description
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/InactiveSpaces.cshtml b/Keas.Mvc/Views/Report/InactiveSpaces.cshtml
index dc874adc3..4d59ebf4a 100644
--- a/Keas.Mvc/Views/Report/InactiveSpaces.cshtml
+++ b/Keas.Mvc/Views/Report/InactiveSpaces.cshtml
@@ -35,7 +35,7 @@
Equipment Count
Key Count
WorkStation Count
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/PeopleInTeam.cshtml b/Keas.Mvc/Views/Report/PeopleInTeam.cshtml
index 2c2fc98b1..3f041523d 100644
--- a/Keas.Mvc/Views/Report/PeopleInTeam.cshtml
+++ b/Keas.Mvc/Views/Report/PeopleInTeam.cshtml
@@ -96,7 +96,7 @@
User Email
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/PeopleLeavingWithAssets.cshtml b/Keas.Mvc/Views/Report/PeopleLeavingWithAssets.cshtml
index 80268e276..9e025faae 100644
--- a/Keas.Mvc/Views/Report/PeopleLeavingWithAssets.cshtml
+++ b/Keas.Mvc/Views/Report/PeopleLeavingWithAssets.cshtml
@@ -69,7 +69,7 @@
@Html.DisplayNameFor(model => model.Slug)
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/PeopleWithIncompleteDocuments.cshtml b/Keas.Mvc/Views/Report/PeopleWithIncompleteDocuments.cshtml
index 1c045dcd6..ec8be8ee4 100644
--- a/Keas.Mvc/Views/Report/PeopleWithIncompleteDocuments.cshtml
+++ b/Keas.Mvc/Views/Report/PeopleWithIncompleteDocuments.cshtml
@@ -35,7 +35,7 @@
{
Other
}
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/PersonEquipmentHistoryReport.cshtml b/Keas.Mvc/Views/Report/PersonEquipmentHistoryReport.cshtml
index 994e9c0dd..bf816ef62 100644
--- a/Keas.Mvc/Views/Report/PersonEquipmentHistoryReport.cshtml
+++ b/Keas.Mvc/Views/Report/PersonEquipmentHistoryReport.cshtml
@@ -25,7 +25,7 @@
Action
Actor
Description
-
+ Actions
diff --git a/Keas.Mvc/Views/Report/SupervisorDirectReports.cshtml b/Keas.Mvc/Views/Report/SupervisorDirectReports.cshtml
index 4f26eb3a3..371c2d9e2 100644
--- a/Keas.Mvc/Views/Report/SupervisorDirectReports.cshtml
+++ b/Keas.Mvc/Views/Report/SupervisorDirectReports.cshtml
@@ -34,7 +34,7 @@
Name
-
+ Actions