diff --git a/src/components/AuthorAffiliations/AuthorAffiliations.tsx b/src/components/AuthorAffiliations/AuthorAffiliations.tsx index ad4f9e549..d54e0e96b 100644 --- a/src/components/AuthorAffiliations/AuthorAffiliations.tsx +++ b/src/components/AuthorAffiliations/AuthorAffiliations.tsx @@ -76,7 +76,7 @@ const AffiliationHeader = ({ formState }: { formState: AffTableState }) => { {caption} - {sub} + {sub} ); }; diff --git a/src/components/BibstemPicker/BibstemPicker.tsx b/src/components/BibstemPicker/BibstemPicker.tsx index 87514dcbc..8c20ddd53 100644 --- a/src/components/BibstemPicker/BibstemPicker.tsx +++ b/src/components/BibstemPicker/BibstemPicker.tsx @@ -273,7 +273,7 @@ const BibstemPickerImpl = (props: IBibstemPickerProps, ref: ForwardedRef) name="bibstems" defaultValue={state.hiddenValue} {...omit(['value'], inputProps)} - onFocus={() => selectRef.current.focus()} + tabIndex={-1} ref={ref} /> @@ -341,6 +341,10 @@ const BibstemPickerImpl = (props: IBibstemPickerProps, ref: ForwardedRef) ':hover': { backgroundColor: colors.pill }, color: colors.pillText, }), + placeholder: (provided) => ({ + ...provided, + color: colors.pillText, + }), }} {...pick(['onBlur'], inputProps)} /> diff --git a/src/components/ClassicForm/ClassicForm.tsx b/src/components/ClassicForm/ClassicForm.tsx index 55ac79c2f..4f0d32f92 100644 --- a/src/components/ClassicForm/ClassicForm.tsx +++ b/src/components/ClassicForm/ClassicForm.tsx @@ -304,7 +304,7 @@ ClassicForm.propTypes = propTypes; const LogicRadios = (props: { variant: 'andor' | 'all'; radioProps: UseFormRegisterReturn }) => { const { variant, radioProps } = props; return ( - + And diff --git a/src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.tsx b/src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.tsx index 328305c42..d3ee54e74 100644 --- a/src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.tsx +++ b/src/components/FeedbackForms/AssociatedArticles/AssociatedArticlesForm.tsx @@ -402,7 +402,7 @@ export const AssociatedTable = () => { {associatedBibcodes.map((b, index) => ( - + { value={newAssociatedBibcode} ref={newAssociatedBibcodeRef} onKeyDown={handleKeydownNewBibcode} + aria-label="add new bibcode" /> { value={newAuthor?.name ?? ''} ref={newAuthorNameRef} onKeyDown={handleKeydownNewAuthor} + aria-label="name" /> @@ -196,6 +197,7 @@ export const AuthorsTable = ({ editable }: { editable: boolean }) => { onChange={handleNewAffChange} value={newAuthor?.aff ?? ''} onKeyDown={handleKeydownNewAuthor} + aria-label="affiliation" /> @@ -204,6 +206,7 @@ export const AuthorsTable = ({ editable }: { editable: boolean }) => { onChange={handleNewOrcidChange} value={newAuthor?.orcid ?? ''} onKeyDown={handleKeydownNewAuthor} + aria-label="orcid" /> @@ -223,7 +226,7 @@ export const AuthorsTable = ({ editable }: { editable: boolean }) => { - + diff --git a/src/components/FeedbackForms/MissingRecord/ReferencesField.tsx b/src/components/FeedbackForms/MissingRecord/ReferencesField.tsx index 45b5ce814..248127802 100644 --- a/src/components/FeedbackForms/MissingRecord/ReferencesField.tsx +++ b/src/components/FeedbackForms/MissingRecord/ReferencesField.tsx @@ -151,7 +151,7 @@ export const ReferencesTable = ({ editable }: { editable: boolean }) => {
No. Name Affiliation ORCiD
- + {editable && } diff --git a/src/components/FeedbackForms/MissingRecord/UrlsField.tsx b/src/components/FeedbackForms/MissingRecord/UrlsField.tsx index c50219504..5d71b3eba 100644 --- a/src/components/FeedbackForms/MissingRecord/UrlsField.tsx +++ b/src/components/FeedbackForms/MissingRecord/UrlsField.tsx @@ -173,7 +173,7 @@ export const UrlsTable = ({ editable }: { editable: boolean }) => {
No. Type ReferenceActions
- + {editable && } diff --git a/src/components/FeedbackForms/MissingReferences/MissingReferenceTable.tsx b/src/components/FeedbackForms/MissingReferences/MissingReferenceTable.tsx index 372d1d592..af4b6f2e6 100644 --- a/src/components/FeedbackForms/MissingReferences/MissingReferenceTable.tsx +++ b/src/components/FeedbackForms/MissingReferences/MissingReferenceTable.tsx @@ -111,7 +111,7 @@ export const MissingReferenceTable = () => {
No. Type URLActions
- + diff --git a/src/components/Libraries/CollabTable.tsx b/src/components/Libraries/CollabTable.tsx index d0db5a9a4..0db1d903e 100644 --- a/src/components/Libraries/CollabTable.tsx +++ b/src/components/Libraries/CollabTable.tsx @@ -196,10 +196,10 @@ export const CollabTable = ({ id }: { id: LibraryIdentifier }) => {
No. Citing Bibcode Cited Bibcode Actions
- + - + diff --git a/src/components/Libraries/LibraryEntityPane.tsx b/src/components/Libraries/LibraryEntityPane.tsx index 81b5ceb06..13a567554 100644 --- a/src/components/Libraries/LibraryEntityPane.tsx +++ b/src/components/Libraries/LibraryEntityPane.tsx @@ -342,7 +342,7 @@ export const LibraryEntityPane = ({ id, publicView }: ILibraryEntityPaneProps) = )} - + {name} @@ -528,6 +528,7 @@ const BulkMenu = ({ onChange={handleChange} mr={2} data-testid="select-all-checkbox" + aria-label="select or deselect all" /> {selectedDocs.length > 0 && ( diff --git a/src/components/Libraries/LibraryListTable.tsx b/src/components/Libraries/LibraryListTable.tsx index e444d5819..fcedc4e1d 100644 --- a/src/components/Libraries/LibraryListTable.tsx +++ b/src/components/Libraries/LibraryListTable.tsx @@ -53,13 +53,13 @@ type SortDirection = 'asc' | 'desc'; const columns: { id: Column; heading: string; sortable: boolean; hint?: string }[] = [ { id: 'public', - heading: '', + heading: 'Visibility', sortable: false, hint: 'public or private', }, { id: 'num_users', - heading: '', + heading: 'Users', sortable: false, hint: 'number of collaborators', }, @@ -192,7 +192,7 @@ export const LibraryListTable = (props: ILibraryListTableProps) => {
No. Email PermissionAction
- {!isMobile && (selectable || showIndex) && } + {!isMobile && (selectable || showIndex) && } {columns.map((column) => ( {allHiddenCols.indexOf(column.id) === -1 && ( @@ -269,7 +269,12 @@ export const LibraryListTable = (props: ILibraryListTableProps) => { )} diff --git a/src/components/Libraries/LibrarySettingsPane.tsx b/src/components/Libraries/LibrarySettingsPane.tsx index ccc5cdc53..ebeca6d78 100644 --- a/src/components/Libraries/LibrarySettingsPane.tsx +++ b/src/components/Libraries/LibrarySettingsPane.tsx @@ -211,6 +211,7 @@ export const LibrarySettingsPane = ({ id, isFromLanding = false }: ISettingsPane href={isFromLanding ? '/user/libraries' : `/user/libraries/${id}`} display="inline" data-testid="settings-back-btn" + aria-label="Back to library" > diff --git a/src/components/Libraries/OperationModal.tsx b/src/components/Libraries/OperationModal.tsx index 9238abcf0..826b0b564 100644 --- a/src/components/Libraries/OperationModal.tsx +++ b/src/components/Libraries/OperationModal.tsx @@ -197,7 +197,7 @@ export const OperationModal = ({ name="action" control={control} render={({ field: { ref, ...rest } }) => ( - + Union diff --git a/src/components/NavBar/FeedbackDropdown.tsx b/src/components/NavBar/FeedbackDropdown.tsx index 7e62b2aff..8c6cbcd9b 100644 --- a/src/components/NavBar/FeedbackDropdown.tsx +++ b/src/components/NavBar/FeedbackDropdown.tsx @@ -1,8 +1,9 @@ import { ChevronDownIcon } from '@chakra-ui/icons'; -import { HStack, List, ListItem, Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react'; +import { DarkMode, HStack, Link, List, ListItem, Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react'; import { useRouter } from 'next/router'; import { MouseEvent, ReactElement } from 'react'; import { ListType } from './types'; +import { useColorModeColors } from '@/lib/useColorModeColors'; export const feedbackItems = { record: { @@ -45,19 +46,7 @@ export const FeedbackDropdown = (props: IFeedbackDropdownProps): ReactElement => const { type, onFinished } = props; const items = Object.values(feedbackItems); const router = useRouter(); - - const handleAccordionClick = (e: MouseEvent) => { - if (typeof onFinished === 'function') { - // Allow the default navigation but also close the drawer. - // Use setTimeout so the drawer closes after the click propagates. - setTimeout(() => onFinished(), 0); - } - - // If Cmd/Ctrl+Click, let the browser handle natively (new tab) - if (e.metaKey || e.ctrlKey) { - return; - } - }; + const colors = useColorModeColors(); return type === ListType.DROPDOWN ? ( @@ -68,23 +57,61 @@ export const FeedbackDropdown = (props: IFeedbackDropdownProps): ReactElement => {items.map((item) => ( - + {item.label} ))} ) : ( + + + + ); +}; + +const SideFeedbackMenu = ({ onFinished }: { onFinished?: () => void }) => { + const items = Object.values(feedbackItems); + + const colors = useColorModeColors(); + + const router = useRouter(); + + const handleAccordionClick = (e: MouseEvent) => { + if (typeof onFinished === 'function') { + // Allow the default navigation but also close the drawer. + // Use setTimeout so the drawer closes after the click propagates. + setTimeout(() => onFinished(), 0); + } + + // If Cmd/Ctrl+Click, let the browser handle natively (new tab) + if (e.metaKey || e.ctrlKey) { + return; + } + }; + + return ( {items.map((item) => ( - {item.label} - + ))} diff --git a/src/components/Pagination/ControlledPaginationControls.tsx b/src/components/Pagination/ControlledPaginationControls.tsx index bb704f993..88883d46a 100644 --- a/src/components/Pagination/ControlledPaginationControls.tsx +++ b/src/components/Pagination/ControlledPaginationControls.tsx @@ -42,6 +42,7 @@ export const ControlledPaginationControls = (props: IControlledPaginationControl onChange={(e) => onChangePageSize(e.target.value ? (Number(e.target.value) as NumPerPageType) : 10)} size="sm" data-testid="page-size-selector" + aria-label="page size" > diff --git a/src/components/Pagination/PaginationControls.tsx b/src/components/Pagination/PaginationControls.tsx index 2514d2f36..5ac6d0e70 100644 --- a/src/components/Pagination/PaginationControls.tsx +++ b/src/components/Pagination/PaginationControls.tsx @@ -27,6 +27,7 @@ export const PaginationControls = (props: IPaginationControlsP onChange={(e) => table.setPageSize(e.target.value ? Number(e.target.value) : 10)} size="sm" display={{ base: 'none', sm: 'block' }} + aria-label="numbers per page" > diff --git a/src/components/RecaptchaMessage/RecaptchaMessage.tsx b/src/components/RecaptchaMessage/RecaptchaMessage.tsx index db8ff646c..a35e63d03 100644 --- a/src/components/RecaptchaMessage/RecaptchaMessage.tsx +++ b/src/components/RecaptchaMessage/RecaptchaMessage.tsx @@ -3,7 +3,7 @@ import { SimpleLink } from '@/components/SimpleLink'; export const RecaptchaMessage = (props: TextProps) => { return ( - + This site is protected by reCAPTCHA and the Google {' '} diff --git a/src/components/SearchFacet/SearchFacetModal/SelectedList.tsx b/src/components/SearchFacet/SearchFacetModal/SelectedList.tsx index ba9caaec0..294b1a8b4 100644 --- a/src/components/SearchFacet/SearchFacetModal/SelectedList.tsx +++ b/src/components/SearchFacet/SearchFacetModal/SelectedList.tsx @@ -1,4 +1,4 @@ -import { BoxProps, Flex, IconButton, Tag, TagCloseButton, TagLabel, Wrap } from '@chakra-ui/react'; +import { BoxProps, Flex, IconButton, Tag, TagCloseButton, TagLabel, Wrap, WrapItem } from '@chakra-ui/react'; import { useFacetStore } from '@/components/SearchFacet/store/FacetStore'; import { isEmpty } from 'ramda'; import { MouseEventHandler } from 'react'; @@ -41,18 +41,20 @@ export const SelectedList = (props: BoxProps) => { > {selected.map((key) => ( - - - {facetId === 'simbad_object_facet_hier' && key.startsWith('1/') - ? getObjectName(formatKeyToName(key), queryClient) - : formatKeyToName(key)} - - - + + + + {facetId === 'simbad_object_facet_hier' && key.startsWith('1/') + ? getObjectName(formatKeyToName(key), queryClient) + : formatKeyToName(key)} + + + + ))} - {onlyCount ? null : } diff --git a/src/components/Tags/Tags.tsx b/src/components/Tags/Tags.tsx index 90e5a1802..885731a72 100644 --- a/src/components/Tags/Tags.tsx +++ b/src/components/Tags/Tags.tsx @@ -26,7 +26,7 @@ export const Tags = ({ tagItems, onRemove, onClear, placeHolder, ...boxProps }: return ( - {tagItems.length === 0 && placeHolder ? {placeHolder} : null} + {tagItems.length === 0 && placeHolder ? {placeHolder} : null} {tagItems.map((item) => ( {item.label} diff --git a/src/components/Visualizations/GraphPanes/AuthorNetworkGraphPane.tsx b/src/components/Visualizations/GraphPanes/AuthorNetworkGraphPane.tsx index 4cf105b30..e9deeaa13 100644 --- a/src/components/Visualizations/GraphPanes/AuthorNetworkGraphPane.tsx +++ b/src/components/Visualizations/GraphPanes/AuthorNetworkGraphPane.tsx @@ -45,7 +45,7 @@ export const AuthorNetworkGraphPane = ({ return ( - + {views.map((v) => ( diff --git a/src/components/Visualizations/GraphPanes/BubblePlotPane.tsx b/src/components/Visualizations/GraphPanes/BubblePlotPane.tsx index 5d12c3194..f1e6458e4 100644 --- a/src/components/Visualizations/GraphPanes/BubblePlotPane.tsx +++ b/src/components/Visualizations/GraphPanes/BubblePlotPane.tsx @@ -75,7 +75,7 @@ export const BubblePlotPane = ({ graph, onApplyFilter }: IBubblePlotPaneProps): Search - + {Object.entries(plotTypes).map(([k, v]) => ( diff --git a/src/components/Visualizations/GraphPanes/HIndexGraphPane.tsx b/src/components/Visualizations/GraphPanes/HIndexGraphPane.tsx index 3994b94c6..fc70aff89 100644 --- a/src/components/Visualizations/GraphPanes/HIndexGraphPane.tsx +++ b/src/components/Visualizations/GraphPanes/HIndexGraphPane.tsx @@ -120,7 +120,7 @@ export const HIndexGraphPane = ({ buckets, sum, type, onApplyCondition }: IHInde Y-Axis - + Linear Log @@ -136,7 +136,6 @@ export const HIndexGraphPane = ({ buckets, sum, type, onApplyCondition }: IHInde xScaleType="linear" /> Recalculate Cloud } /> { )}
{ d3.selectAll('.paper-circle') .data(nodes, (n) => n.bibcode) + .attr('tabindex', '-1') .join('circle') .transition() .duration(200) @@ -468,7 +469,9 @@ export const BubblePlot = ({ const g = svg .attr('viewBox', [0, 0, width + margin.left + margin.right, height + margin.top + margin.bottom]) .append('g') - .attr('transform', `translate(${margin.left},${margin.top})`); + .attr('transform', `translate(${margin.left},${margin.top})`) + .attr('role', 'img') + .attr('aria-label', 'bubble plot'); // Render Axis g.append('g').attr('class', 'x-axis').attr('transform', `translate(0, ${height})`).call(xAxis); diff --git a/src/components/Visualizations/Graphs/Histogram.tsx b/src/components/Visualizations/Graphs/Histogram.tsx index 0b9113a0f..dfade68b5 100644 --- a/src/components/Visualizations/Graphs/Histogram.tsx +++ b/src/components/Visualizations/Graphs/Histogram.tsx @@ -114,7 +114,8 @@ export const Histogram = ({ .attr('transform', (d) => `translate(${xScale(d.x0)} , 0)`) .attr('width', (d) => xScale(d.x1) - xScale(d.x0)) .attr('height', height) - .attr('tabindex', 0) + .attr('tabindex', '-1') + .attr('focusable', 'false') .style('fill', '#fff') .style('opacity', 0) // make it transparent .on('mouseover', (event, bin) => { diff --git a/src/components/Visualizations/Graphs/LineGraph.tsx b/src/components/Visualizations/Graphs/LineGraph.tsx index 749fc5457..30b7ce37f 100644 --- a/src/components/Visualizations/Graphs/LineGraph.tsx +++ b/src/components/Visualizations/Graphs/LineGraph.tsx @@ -19,7 +19,7 @@ export const LineGraph = memo( const darkTheme = useNivoDarkTheme(); return ( - +
Show the first - + {`papers (max is ${max})`} diff --git a/src/components/Visualizations/utils/graphUtils.ts b/src/components/Visualizations/utils/graphUtils.ts index bf819b65b..2cb7f2dd4 100644 --- a/src/components/Visualizations/utils/graphUtils.ts +++ b/src/components/Visualizations/utils/graphUtils.ts @@ -446,6 +446,7 @@ export const getAuthorNetworkSummaryGraph = (response: IADSApiAuthorNetworkRespo // years range const years = uniq(bibcodes.map((bibcode) => parseInt(bibcode.slice(0, 4)))); + console.log(bibcodes); const yearsRange = d3.extent(years); const allYears = range(yearsRange[0], yearsRange[1]); // fill in the years gap diff --git a/src/pages/paper-form.tsx b/src/pages/paper-form.tsx index fc01644ea..478509f80 100644 --- a/src/pages/paper-form.tsx +++ b/src/pages/paper-form.tsx @@ -129,7 +129,7 @@ const PaperForm: NextPage<{ error?: IPaperFormServerError }> = ({ error: ssrErro ); return ( - + {`${BRAND_NAME_FULL} Paper Form`} @@ -172,6 +172,7 @@ const JournalQueryForm = ({ onSubmit, error }: SubFormProps) => { return ( { }; return ( - + Reference Query @@ -324,7 +325,7 @@ const BibcodeQueryForm = ({ onSubmit, error }: SubFormProps) => { }; return ( - + Bibliographic Code Query @@ -446,10 +447,7 @@ const journalQueryNotEmpty = pipe< any((v) => v.length > 0), ); -export const getSearchQuery = async ( - formParams: PaperFormState[PaperFormType], - queryClient: QueryClient, -) => { +export const getSearchQuery = async (formParams: PaperFormState[PaperFormType], queryClient: QueryClient) => { switch (formParams.form) { case PaperFormType.JOURNAL_QUERY: { if (journalQueryNotEmpty(formParams)) { diff --git a/src/theme.ts b/src/theme.ts index 252a8698e..33ae98dae 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -76,6 +76,7 @@ export const theme = extendTheme( }, a: { color: mode('blue.500', 'blue.200')(props), + fontWeight: 'bold', }, }), }, @@ -205,27 +206,9 @@ export const theme = extendTheme( }, }, Input: { - parts: ['field', 'addon'], - sizes: { - lg: { - field: { - borderRadius: 'sm', - }, - }, - md: { - field: { - borderRadius: 'sm', - }, - }, - sm: { - field: { - borderRadius: 'sm', - }, - }, - xs: { - field: { - borderRadius: 'sm', - }, + baseStyle: { + field: { + borderRadius: 'sm', }, }, },
Select {showIndex && `${pageSize * pageIndex + index + 1} `} {selectable && ( - + )}