diff --git a/Keas.Mvc/ClientApp/src/components/Access/AccessAssignmentTable.tsx b/Keas.Mvc/ClientApp/src/components/Access/AccessAssignmentTable.tsx index 297ac5e60..dce703169 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/AccessAssignmentTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/AccessAssignmentTable.tsx @@ -45,7 +45,7 @@ const AccessAssignmentTable = (props: IProps) => { onClick={() => props.showDetails(data.row.original)} /> ), - header: ' ' + header: 'Details' }, { header: 'Assignment', diff --git a/Keas.Mvc/ClientApp/src/components/Access/AccessContainer.test.tsx b/Keas.Mvc/ClientApp/src/components/Access/AccessContainer.test.tsx index b7b1ea1e5..452222cd7 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/AccessContainer.test.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/AccessContainer.test.tsx @@ -63,7 +63,7 @@ describe('Access Container', () => { const headerRecord = container.querySelector('.table-row').textContent; expect(headerRecord).toBe( - ' NameNumber of AssignmentsAssigned ToFirst ExpirationActions' + 'DetailsNameNumber of AssignmentsAssigned ToFirst ExpirationActions' ); }); diff --git a/Keas.Mvc/ClientApp/src/components/Access/AccessDetailContainer.tsx b/Keas.Mvc/ClientApp/src/components/Access/AccessDetailContainer.tsx index 1e35ab986..91df57e5e 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/AccessDetailContainer.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/AccessDetailContainer.tsx @@ -144,7 +144,7 @@ const AccessDetailContainer = (props: IProps) => { {tags.length > 0 && ( -
+
{tags.map(tag => ( { + const formId = useId(); if (!props.disableEditing && !props.onAccessUpdate) { throw new Error( 'If the access is editable then a callback must be provided' @@ -45,8 +47,9 @@ const AccessEditValues = (props: IProps) => {
- + { - + { - + { props.onAccessUpdate({ ...access, tags: e.join(',') }); }} placeholder='Search for Tags' - id='searchTags' + id={`${formId}-tags`} /> {error && error.path === 'tags' && error.message} diff --git a/Keas.Mvc/ClientApp/src/components/Access/AccessList.tsx b/Keas.Mvc/ClientApp/src/components/Access/AccessList.tsx index aae00726d..d13508855 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/AccessList.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/AccessList.tsx @@ -15,7 +15,7 @@ const AccessAssignmentList = (props: IProps) => { const access = !props.accessAssignments || props.accessAssignments.length < 1 ? ( - No Accesses Found + No Accesses Found ) : ( props.accessAssignments.map(x => ( @@ -34,7 +34,7 @@ const AccessAssignmentList = (props: IProps) => { - diff --git a/Keas.Mvc/ClientApp/src/components/Access/AccessTable.tsx b/Keas.Mvc/ClientApp/src/components/Access/AccessTable.tsx index da8b52e2e..3f900f70d 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/AccessTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/AccessTable.tsx @@ -54,7 +54,7 @@ const AccessTable = (props: IProps) => { onClick={() => props.showDetails(data.row.original)} /> ), - header: ' ' + header: 'Details' }, { header: 'Name', diff --git a/Keas.Mvc/ClientApp/src/components/Access/SearchAccess.tsx b/Keas.Mvc/ClientApp/src/components/Access/SearchAccess.tsx index 8d6faa8cd..dc4417c08 100644 --- a/Keas.Mvc/ClientApp/src/components/Access/SearchAccess.tsx +++ b/Keas.Mvc/ClientApp/src/components/Access/SearchAccess.tsx @@ -1,5 +1,5 @@ import { PlusIcon } from '@heroicons/react/24/outline'; -import { useContext, useState } from 'react'; +import { useContext, useId, useState } from 'react'; import { Highlighter } from '../Shared/SearchCombobox'; import { toast } from 'react-toastify'; import { Button } from 'reactstrap'; @@ -15,6 +15,7 @@ interface IProps { // Search for existing access then send selection back to parent const SearchAccess = (props: IProps) => { + const inputId = useId(); const [accesses, setAccesses] = useState([]); const [isSearchLoading, setIsSearchLoading] = useState(false); const context = useContext(Context); @@ -22,10 +23,10 @@ const SearchAccess = (props: IProps) => { const renderSelectAccess = () => { return (
- +
{
{' '} { document.body.appendChild(container); }); +describe('Managed-system search accessibility', () => { + it('labels the input and pending action while preserving result selection', async () => { + let resolveSearch: (value: unknown) => void; + const fetch = vi.fn(() => new Promise(resolve => { resolveSearch = resolve; })); + const select = vi.fn(); + render( + + + , + { container } + ); + + fireEvent.click(screen.getByRole('button', { name: 'Look Up' })); + const dialog = await screen.findByRole('dialog', { name: 'Search by Computer Property' }); + const property = within(dialog).getByRole('textbox', { name: 'Computer Property' }); + const status = within(dialog).getByRole('status'); + expect(status).toBeEmptyDOMElement(); + expect(within(dialog).getByLabelText('Computer Property')).toBe(property); + fireEvent.change(property, { target: { value: 'Research' } }); + fireEvent.click(within(dialog).getByRole('button', { name: 'Search!' })); + + const pending = within(dialog).getByRole('button', { name: 'Searching…' }); + expect(pending).toBeDisabled(); + expect(pending).toHaveAttribute('aria-busy', 'true'); + expect(status).toHaveTextContent('Searching…'); + expect(fetch).toHaveBeenCalledExactlyOnceWith('/api/team/equipment/GetComputersBySearch?value=Research'); + + await act(async () => resolveSearch({ result: [{ + hardware_u_bigfix_id: '123', + hardware_display_name: 'Research laptop', + hardware_u_device_name: 'LAB-01' + }] })); + expect(within(dialog).getByRole('button', { name: 'Search!' })).toBeEnabled(); + expect(status).toHaveTextContent('1 computer found.'); + fireEvent.click(within(dialog).getByRole('button', { name: 'Research laptop (LAB-01)' })); + expect(select).toHaveBeenCalledExactlyOnceWith('systemManagementId', '123'); + + fireEvent.click(within(dialog).getByRole('button', { name: 'Search!' })); + expect(status).toHaveTextContent('Searching…'); + await act(async () => resolveSearch({ result: [] })); + expect(within(dialog).getByRole('status')).toBe(status); + expect(status).toHaveTextContent('No results found for the search term.'); + }); +}); + describe('Equipment duplication', () => { beforeEach(() => { // The date picker measures text with canvas, which jsdom does not implement. @@ -126,7 +172,7 @@ describe('Equipment duplication', () => { const saveCopy = () => fireEvent.click(screen.getByRole('button', { name: 'Save' })); const selectOtherPerson = async (name: string) => { - fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: name } }); + fireEvent.change(screen.getByRole('combobox', { name: 'Assign to' }), { target: { value: name } }); fireEvent.click(await screen.findByRole('option', { name: new RegExp(name) })); }; @@ -141,7 +187,7 @@ describe('Equipment duplication', () => { expect(screen.getByLabelText('Make')).toHaveValue(state.source.make); expect(screen.getByLabelText('Model')).toHaveValue(state.source.model); expect(screen.getByLabelText('Attribute value 1')).toHaveValue('5'); - expect(screen.getByRole('combobox', { name: 'Search for person by name or email' })).toHaveValue(''); + expect(screen.getByRole('combobox', { name: 'Assign to' })).toHaveValue(''); fireEvent.change(screen.getByLabelText('Name'), { target: { value: 'New laptop' } }); fireEvent.change(screen.getByLabelText('Serial Number / Identifier'), { target: { value: 'NEW-SERIAL' } }); fireEvent.change(screen.getByLabelText('Attribute value 1'), { target: { value: '6' } }); @@ -182,7 +228,7 @@ describe('Equipment duplication', () => { it('prevents Enter in a pending person search from submitting a new equipment record', async () => { const state = await setup(); - const personSearch = screen.getByRole('combobox', { name: 'Search for person by name or email' }); + const personSearch = screen.getByRole('combobox', { name: 'Assign to' }); fireEvent.change(personSearch, { target: { value: 'Searching' } }); expect(fireEvent.keyDown(personSearch, { key: 'Enter', code: 'Enter' })).toBe(false); expect(state.duplicate).not.toHaveBeenCalled(); @@ -228,7 +274,7 @@ describe('Equipment duplication', () => { expect(await screen.findByRole('alert')).toHaveTextContent('assignment could not be confirmed'); expect(state.assetInUseUpdated).not.toHaveBeenCalled(); - fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: '' } }); + fireEvent.change(screen.getByRole('combobox', { name: 'Assign to' }), { target: { value: '' } }); fireEvent.click(screen.getByRole('button', { name: 'Save assignment' })); expect(await screen.findByRole('alert')).toHaveTextContent(`already assigned to ${state.otherPerson.name}`); @@ -263,7 +309,7 @@ describe('Equipment duplication', () => { saveCopy(); expect(await screen.findByRole('alert')).toHaveTextContent('assignment could not be confirmed'); - fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: '' } }); + fireEvent.change(screen.getByRole('combobox', { name: 'Assign to' }), { target: { value: '' } }); fireEvent.click(screen.getByRole('button', { name: 'Save assignment' })); await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument()); @@ -283,7 +329,7 @@ describe('Equipment duplication', () => { expect(await screen.findByRole('alert')).toHaveTextContent('assignment could not be confirmed'); state.details.mockRejectedValueOnce(new Error('Details unavailable')); - fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: '' } }); + fireEvent.change(screen.getByRole('combobox', { name: 'Assign to' }), { target: { value: '' } }); fireEvent.click(screen.getByRole('button', { name: 'Save assignment' })); expect(await screen.findByRole('alert')).toHaveTextContent('Unable to verify the saved assignment'); @@ -297,7 +343,7 @@ describe('Equipment duplication', () => { it('allows changing the person from a person page without adding the copy to the original person', async () => { const state = await setup({ view: 'person' }); - expect(screen.getByRole('combobox', { name: 'Search for person by name or email' })).toHaveValue(`${state.person.name} (${state.person.email})`); + expect(screen.getByRole('combobox', { name: 'Assign to' })).toHaveValue(`${state.person.name} (${state.person.email})`); await selectOtherPerson(state.otherPerson.name); fireEvent.change(screen.getByLabelText('Name'), { target: { value: 'Other person copy' } }); saveCopy(); @@ -311,7 +357,7 @@ describe('Equipment duplication', () => { it('allows clearing the person and saves unassigned outside that person’s list', async () => { const state = await setup({ view: 'person' }); - fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: '' } }); + fireEvent.change(screen.getByRole('combobox', { name: 'Assign to' }), { target: { value: '' } }); fireEvent.change(screen.getByLabelText('Name'), { target: { value: 'Unassigned copy' } }); saveCopy(); @@ -323,7 +369,7 @@ describe('Equipment duplication', () => { it('excludes a copy from the space page when its room is cleared', async () => { const state = await setup({ view: 'space' }); - const spaceInput = screen.getByRole('combobox', { name: 'Search for space' }); + const spaceInput = screen.getByRole('combobox', { name: 'Room' }); fireEvent.click(within(spaceInput.parentElement).getByRole('button', { name: 'Clear selection' })); fireEvent.change(screen.getByLabelText('Name'), { target: { value: 'Roomless copy' } }); saveCopy(); @@ -383,7 +429,7 @@ describe('Equipment Container', () => { }); const headerRecord = container.querySelector('.table-row').textContent; - expect(headerRecord).toBe(' Serial NumberNameAssigned ToExpirationActions'); + expect(headerRecord).toBe('DetailsSerial NumberNameAssigned ToExpirationActions'); }); it('Shows Add Button', async () => { diff --git a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentDetails.tsx b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentDetails.tsx index 5026f6df5..7c1ed973a 100644 --- a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentDetails.tsx +++ b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentDetails.tsx @@ -117,7 +117,7 @@ const EquipmentDetails = (props: IProps) => { )} {tags.length > 0 && ( -
+
{tags.map(tag => {tag})}
)} diff --git a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentEditValues.tsx b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentEditValues.tsx index 9b25413e9..2ba0ab22b 100644 --- a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentEditValues.tsx +++ b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentEditValues.tsx @@ -34,6 +34,7 @@ interface IProps { } const EquipmentEditValues = (props: IProps) => { + const formId = React.useId(); const typeValue = props.selectedEquipment.type || 'Default'; const listItems = !!props.equipmentTypes ? ( props.equipmentTypes.map(x => ( @@ -123,9 +124,9 @@ const EquipmentEditValues = (props: IProps) => {
- + { - + { - + { ) && ( <> - {' '} + {' '} { { - {' '} + {' '} { { {shouldShowForType(props.selectedEquipment.type, 'Make') && ( - + { )} {shouldShowForType(props.selectedEquipment.type, 'Model') && ( - + { ) && ( { )} - + {
- + { } onSelect={e => props.changeProperty('tags', e.join(','))} placeholder='Search for Tags' - id='searchTagsEquipmentEditValues' + id={`${formId}-tags`} /> {error && error.path === 'tags' && error.message} @@ -363,8 +368,9 @@ const EquipmentEditValues = (props: IProps) => { {props.disableEditing && ( // if we are looking at details, or if we are assigning - + { {!props.disableEditing && ( // if we are editing or creating - + { const equipment = !props.equipment || props.equipment.length < 1 ? (
- + ) : ( props.equipment.map(x => ( @@ -36,7 +36,7 @@ const EquipmentList = (props: IProps) => {
+ Details Name Assigned? Number of Assignments
No Equipment FoundNo Equipment Found
- diff --git a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystem.tsx b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystem.tsx index 84dc1b7e7..8275dcbc1 100644 --- a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystem.tsx +++ b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystem.tsx @@ -2,6 +2,7 @@ import EquipmentManagedSystemInfo from './EquipmentManagedSystemInfo'; import EquipmentManagedSystemSearchId from './EquipmentManagedSystemSearchId'; interface IProps { + inputId: string; managedSystemId: string; addManagedSystemId: (property: string, id: string) => void; disableEditing: boolean; @@ -28,7 +29,7 @@ const EquipmentManagedSystem = (props: IProps) => { return ( <>
- Managed System ID + {renderManagedSystemInfoOrSearchId()}
diff --git a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystemSearchId.tsx b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystemSearchId.tsx index 716ae4240..155f8c99b 100644 --- a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystemSearchId.tsx +++ b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentManagedSystemSearchId.tsx @@ -1,6 +1,6 @@ import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal'; import { ArrowPathIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline'; -import { useContext, useState } from 'react'; +import { useContext, useId, useState } from 'react'; import { toast } from 'react-toastify'; import { Button, Form, FormFeedback, FormGroup, Input, Table } from 'reactstrap'; import { Context } from '../../Context'; @@ -11,6 +11,7 @@ interface IProps { } const EquipmentManagedSystemSearchId = (props: IProps) => { + const propertyId = useId(); const [isFetched, setIsFetched] = useState(false); const [isSearching, setIsSearching] = useState(false); const [isValidSearch, setIsValidSearch] = useState(true); @@ -68,6 +69,13 @@ const EquipmentManagedSystemSearchId = (props: IProps) => { Computer property is required +
+ {isSearching ? 'Searching…' : isFetched + ? !isValidSearch ? 'No data to present.' + : listOfComputers?.length ? `${listOfComputers.length} ${listOfComputers.length === 1 ? 'computer' : 'computers'} found.` + : 'No results found for the search term.' + : ''} +
{renderNameTable()} ); @@ -76,11 +84,11 @@ const EquipmentManagedSystemSearchId = (props: IProps) => { const renderInputSearch = () => { return ( <> - + { @@ -146,14 +154,14 @@ const EquipmentManagedSystemSearchId = (props: IProps) => { const renderSearchButton = () => { if (isSearching) { return ( - ); } else { return ( - ); diff --git a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentTable.tsx b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentTable.tsx index eb4b2053f..26e4c1feb 100644 --- a/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/Equipment/EquipmentTable.tsx @@ -68,7 +68,7 @@ const EquipmentTable = (props: IProps) => { onClick={() => props.showDetails(data.row.original)} /> ), - header: ' ' + header: 'Details' }, { header: 'Serial Number', @@ -116,6 +116,7 @@ const EquipmentTable = (props: IProps) => { return ( { + const inputId = useId(); const [equipment, setEquipment] = useState([]); const [isSearchLoading, setIsSearchLoading] = useState(false); const context = useContext(Context); @@ -25,10 +26,10 @@ const SearchEquipment = (props: IProps) => { const renderSelectEquipment = () => { return (
- +
{ return (
+ Details Serial Name Assigned To
- - - {histories}
diff --git a/Keas.Mvc/ClientApp/src/components/Keys/AssignKeySerial.tsx b/Keas.Mvc/ClientApp/src/components/Keys/AssignKeySerial.tsx index 89f205b06..631bf9176 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/AssignKeySerial.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/AssignKeySerial.tsx @@ -2,7 +2,7 @@ import { AssetActions } from '../Shared/AssetSummary'; import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal'; import { ArrowPathIcon, XMarkIcon } from '@heroicons/react/24/outline'; import { addYears, format, startOfDay } from 'date-fns'; -import { useEffect, useState } from 'react'; +import { useEffect, useId, useState } from 'react'; import { Button, Form } from 'reactstrap'; import { IKey, IKeyInfo } from '../../models/Keys'; import { IKeySerial, keySerialSchema } from '../../models/KeySerials'; @@ -35,6 +35,7 @@ interface IProps { } const AssignKeySerial = (props: IProps) => { + const keySearchId = useId(); const assignment = props.selectedKeySerial && props.selectedKeySerial.keySerialAssignment; const [date, setDate] = useState( @@ -209,8 +210,9 @@ const AssignKeySerial = (props: IProps) => {
{!keySerial.key && (
- + { + const formId = useId(); const [error, setError] = useState(''); const [selectedKeyInfo, setSelectedKeyInfo] = useState( props.selectedKeyInfo @@ -68,8 +69,8 @@ const AssociateSpace = (props: IProps) => { return
{`${selectedSpace.roomNumber} ${selectedSpace.bldgName}`}
; } return
- - + +
; }; @@ -78,8 +79,8 @@ const AssociateSpace = (props: IProps) => { return
{`${selectedKeyInfo.key.name} - ${selectedKeyInfo.key.code}`}
; } return
- - + +
; }; diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeyContainer.test.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeyContainer.test.tsx index 9504d0168..24231a2fe 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeyContainer.test.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeyContainer.test.tsx @@ -66,7 +66,7 @@ describe('Key Container', () => { }); const headerRecord = container.querySelector('.table-row').textContent; - expect(headerRecord).toBe(' Key NameKey CodeSerials SpacesActions'); + expect(headerRecord).toBe('DetailsKey NameKey CodeSerials (In Use / Total)SpacesActions'); }); it('Shows Add Button', async () => { diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeyDetailContainer.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeyDetailContainer.tsx index a88b676e7..f976c8ece 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeyDetailContainer.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeyDetailContainer.tsx @@ -110,7 +110,7 @@ const KeyDetailContainer = (props: IProps) => {
{tags.length > 0 && ( -
+
{tags.map(tag => ( { + const formId = useId(); const [name, setName] = useState(props.selectedKey.name); const [code, setCode] = useState(props.selectedKey.code); const [tags, setTags] = useState(props.selectedKey.tags); @@ -73,8 +74,9 @@ const KeyEditValues = (props: IProps) => { return (
- + { - + { - + { - + {error && error.path === 'tags' && error.message} diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeyList.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeyList.tsx index 2bf2cd602..44445ead7 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeyList.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeyList.tsx @@ -1,5 +1,3 @@ -import { InformationCircleIcon } from '@heroicons/react/24/outline'; -import { UncontrolledTooltip } from 'reactstrap'; import { IKey, IKeyInfo } from '../../models/Keys'; import KeyListItem from './KeyListItem'; @@ -31,7 +29,7 @@ const KeyList = (props: IProps) => { const keys = !keysInfo || keysInfo.length < 1 ? ( - No Keys Found + No Keys Found ) : ( keysInfo.map(renderItem) @@ -41,15 +39,12 @@ const KeyList = (props: IProps) => { - diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialContainer.test.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialContainer.test.tsx index f7bee166d..99b85c219 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialContainer.test.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialContainer.test.tsx @@ -68,7 +68,7 @@ describe('Key Serial Container', () => { const headerRecord = document.querySelector('.table-row').textContent; expect(headerRecord).toBe( - ' Key Code and SNStatusAssignmentExpirationActions' + 'DetailsKey Code and SNStatusAssignmentExpirationActions' ); }); diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialEditValues.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialEditValues.tsx index e4a00bf3d..bc519320e 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialEditValues.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialEditValues.tsx @@ -21,6 +21,7 @@ interface IProps { } const KeySerialEditValues = (props: IProps) => { + const formId = React.useId(); const { keySerial, error } = props; const numberValue = keySerial ? keySerial.number : ''; @@ -92,8 +93,9 @@ const KeySerialEditValues = (props: IProps) => {
{props.keySerial.key.name ? props.keySerial.key.name : ''}
{props.keySerial.key.code}
- + { - + { - + { - + { .filter(Boolean)} onSelect={tags => props.changeProperty('tags', tags.join(','))} placeholder='Search for Tags' - id='searchTagsKeySerialEditValues' + id={`${formId}-tags`} inputProps={{ 'aria-label': 'Tags' }} isInvalid={error && error.path === 'tags'} /> diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialList.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialList.tsx index 9c2b9f86a..3b710ef66 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialList.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialList.tsx @@ -29,7 +29,7 @@ const KeySerialList = (props: IProps) => { const serials = !keySerials || keySerials.length < 1 ? ( - + ) : ( keySerials.map(renderItem) @@ -39,7 +39,7 @@ const KeySerialList = (props: IProps) => {
+ Details Key Name Key Code Serials{' '} - - - In Use / Total - + (In Use / Total) Actions
No Key Serials FoundNo Key Serials Found
- diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialTable.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialTable.tsx index b8272691b..48aac3b29 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeySerialTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeySerialTable.tsx @@ -59,7 +59,7 @@ const KeySerialTable = (props: IProps) => { onClick={() => props.showDetails(data.row.original)} /> ), - header: ' ' + header: 'Details' }, { header: 'Key Code and SN', diff --git a/Keas.Mvc/ClientApp/src/components/Keys/KeyTable.tsx b/Keas.Mvc/ClientApp/src/components/Keys/KeyTable.tsx index e765a6d37..ea4dfd96d 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/KeyTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/KeyTable.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 { IKey, IKeyInfo } from '../../models/Keys'; import { ReactTableUtil } from '../../util/tableUtil'; import ListActionsDropdown, { IAction } from '../ListActionsDropdown'; @@ -32,7 +30,7 @@ export default class KeyTable extends React.Component { onClick={() => this.props.showDetails(data.row.original.key)} /> ), - header: ' ' + header: 'Details' }, { header: 'Key Name', @@ -54,14 +52,7 @@ export default class KeyTable extends React.Component { header: _ => (
Serials{' '} - - - In Use / Total - + (In Use / Total)
), accessorFn: keyInfo => { diff --git a/Keas.Mvc/ClientApp/src/components/Keys/SearchKeySerials.tsx b/Keas.Mvc/ClientApp/src/components/Keys/SearchKeySerials.tsx index 4ad37d523..dfc528b05 100644 --- a/Keas.Mvc/ClientApp/src/components/Keys/SearchKeySerials.tsx +++ b/Keas.Mvc/ClientApp/src/components/Keys/SearchKeySerials.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 key then send selection back to parent const SearchKeySerials = (props: IProps) => { + const inputId = useId(); const [isSearchLoading, setIsSearchLoading] = useState(false); const [keySerials, setKeySerials] = useState([]); const context = useContext(Context); @@ -31,10 +32,10 @@ const SearchKeySerials = (props: IProps) => { const renderSelectKey = () => { return (
- +
void; onDeselect: () => void; @@ -14,6 +16,7 @@ interface IProps { // Search for existing key then send selection back to parent const SearchKeys = (props: IProps) => { + const inputId = useId(); const [isSearchLoading, setIsSearchLoading] = useState(false); const [keysInfo, setKeysInfo] = useState([]); const context = useContext(Context); @@ -92,7 +95,8 @@ const SearchKeys = (props: IProps) => { return ( { + const inputId = useId(); const context = useContext(Context); const [isSearchLoading, setIsSearchLoading] = useState(false); const [people, setPeople] = useState([]); @@ -33,9 +34,9 @@ const AssignPerson = (props: IProps) => { return (
- + { person.userId || person.homePhone || person.teamPhone || - person.supervisor || - person.isSupervisor; + person.supervisor; const tags = Array.from( new Set( (person.tags || '') @@ -69,10 +68,10 @@ const BioContainer = ({ person }: IProps) => { )} - {hasContact && ( + {(hasContact || person.isSupervisor) && (

Contact details

-
+ {hasContact &&
{person.email && ( { {person.supervisor && ( {person.supervisor.name} )} -
+
} {person.isSupervisor && ( { const headerRecord = container.querySelector('.table-row').textContent; expect(headerRecord).toBe( - ' NameEmailSupervisorKeysEquipmentAccessWorkstations' + 'DetailsNameEmailSupervisorKeysEquipmentAccessWorkstations' ); }); diff --git a/Keas.Mvc/ClientApp/src/components/People/PeopleTable.tsx b/Keas.Mvc/ClientApp/src/components/People/PeopleTable.tsx index ab91a5b66..3de9c5a04 100644 --- a/Keas.Mvc/ClientApp/src/components/People/PeopleTable.tsx +++ b/Keas.Mvc/ClientApp/src/components/People/PeopleTable.tsx @@ -28,7 +28,7 @@ const PeopleTable = (props: IProps) => { onClick={() => props.showDetails(data.row.original)} /> ), - header: ' ' + header: 'Details' }, { header: 'Name', diff --git a/Keas.Mvc/ClientApp/src/components/People/PersonDetailsAccessibility.test.tsx b/Keas.Mvc/ClientApp/src/components/People/PersonDetailsAccessibility.test.tsx new file mode 100644 index 000000000..b197a7642 --- /dev/null +++ b/Keas.Mvc/ClientApp/src/components/People/PersonDetailsAccessibility.test.tsx @@ -0,0 +1,68 @@ +import { cleanup, render, screen } from '@testing-library/react'; +import { Context } from '../../Context'; +import AccessList from '../Access/AccessList'; +import EquipmentList from '../Equipment/EquipmentList'; +import HistoryList from '../History/HistoryList'; +import KeySerialList from '../Keys/KeySerialList'; +import KeyList from '../Keys/KeyList'; +import SpacesList from '../Spaces/SpacesList'; +import WorkstationList from '../Workstations/WorkstationList'; +import { fakeEquipment } from '../specs/mockData/Equipment'; +import BioContainer from './BioContainer'; + +afterEach(cleanup); + +it.each([ + ['access', ], + ['equipment', ], + ['key serials', ], + ['keys', ], + ['spaces', ], + ['workstations', ] +])('covers every %s column with the empty-state data cell', (_name, element) => { + render(element); + expect(screen.getByRole('cell')).toHaveAttribute( + 'colspan', String(screen.getAllByRole('columnheader').length) + ); +}); + +const context = { + fetch: vi.fn(), + permissions: [], + team: { id: 1, name: 'Team', slug: 'team' }, + tags: [] +}; + +it('keeps history content without an empty table header container', () => { + const { container } = render( + + + + ); + expect(screen.getByRole('cell', { name: 'Assigned equipment' })).toBeVisible(); + expect(container.querySelector('thead')).toBeNull(); +}); + +it('keeps the direct-reports link without an empty contact description list', () => { + const person = { + ...fakeEquipment[0].assignment.person, + email: null, userId: null, homePhone: null, teamPhone: null, + supervisor: null, isSupervisor: true + }; + const { container, rerender } = render( + + ); + expect(screen.getByRole('link', { name: 'View direct reports' })).toHaveAttribute( + 'href', `/team/Report/SupervisorDirectReports/?personId=${person.id}` + ); + expect(container.querySelector('dl')).toBeNull(); + rerender( + + + + ); + expect(container.querySelector('dl dt')).toHaveTextContent('Email'); + expect(screen.getByRole('link', { name: 'person@example.com' })).toBeVisible(); +}); diff --git a/Keas.Mvc/ClientApp/src/components/Shared/AssetFilterBar.tsx b/Keas.Mvc/ClientApp/src/components/Shared/AssetFilterBar.tsx index 6579cca7d..a5b63039f 100644 --- a/Keas.Mvc/ClientApp/src/components/Shared/AssetFilterBar.tsx +++ b/Keas.Mvc/ClientApp/src/components/Shared/AssetFilterBar.tsx @@ -208,7 +208,7 @@ export const AssetFilterBar = ({ narrow your results.

{chips.length > 0 && ( -
+
{chips.map(({ category, value }) => ( {fields.map(([label, value]) => {value})} - {tags &&
+ {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 => ( - ))} ))} 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 (
-
+ Details Key Code Serial Number Status
-
+
+
{header.column.getCanFilter() ? flexRender( header.column.columnDef.meta?.Filter || DefaultColumnFilter, @@ -39,7 +33,7 @@ export const ColumnFilterHeaders = ({ ) : null}
- +
+
{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(<> + + + + + ); + 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(<> + + + ); + 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 && - + ) : ( spaces.map(renderItem) @@ -33,7 +33,7 @@ const SpacesList = (props: IProps) => {
No Spaces FoundNo Spaces Found
- 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 ( 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} ) : ( - - props.changeProperty('space', space)} + + props.changeProperty('space', space)} defaultSpace={props.space || props.selectedWorkstation.space} isRequired /> )} - + { - + { } 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 ? ( - + ) : ( props.workstations.map(x => ( @@ -38,7 +38,7 @@ const WorkstationList = (props: IProps) => {
+ Details Room Room Name Actions
No Workstations FoundNo Workstations Found
- 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 @@ } @@ -48,7 +48,7 @@ { - + } 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 @@ } 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 @@ } - + 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 @@ - + 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 @@ - + 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 @@ - + 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 @@ - + 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 @@ - + 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 @@ { } - + 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 @@ - + 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 @@ - +
+ Details Name Space Assigned To@item.Slug
@item.Id@item.NameView groupView group
@item.AccountName@item.AccountId@item.ApiBasePath
- +
OtherTeamActions
Team Actions
Description Actions
Equipment Count Key Count WorkStation CountActions
User Email Actions
@Html.DisplayNameFor(model => model.Slug) Actions
OtherActions
Action Actor DescriptionActions
Name Actions