Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/folio-org/ui-linked-data
Browse files Browse the repository at this point in the history
…into feat/UILD-427-authority-validation
  • Loading branch information
SKarolFolio committed Dec 17, 2024
2 parents ad97f1c + e1f5010 commit 90ee588
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/common/hooks/useFetchSearchData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const useFetchSearchData = () => {
precedingRecordsCount,
} = useSearchContext();
const { setIsLoading } = useLoadingState();
const { setMessage, data, setData, resetData, setPageMetadata } = useSearchState();
const { addStatusMessagesItem, resetStatusMessages } = useStatusState();
const { setMessage, resetMessage, data, setData, resetData, setPageMetadata } = useSearchState();
const { addStatusMessagesItem } = useStatusState();

const validateAndNormalizeQuery = useCallback(
(type: SearchIdentifiers, query: string) => {
Expand Down Expand Up @@ -133,7 +133,6 @@ export const useFetchSearchData = () => {
selectedSegment,
baseQuerySelector = SearchableIndexQuerySelector.Query,
}: FetchDataParams) => {
resetStatusMessages();
const selectedNavigationSegment = selectedSegment ?? navigationSegment?.value;

data && resetData();
Expand Down Expand Up @@ -176,6 +175,7 @@ export const useFetchSearchData = () => {

setData(content);
setPageMetadata({ totalPages, totalElements: totalRecords, prev, next });
resetMessage();
} catch {
addStatusMessagesItem?.(UserNotificationFactory.createMessage(StatusType.error, 'ld.errorFetching'));
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/common/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $blue-700: #255096;
$blue-600: #2d62b7;
$blue-800: #1d3f75;
$gray-200: #d7d8da;
$gray-400: #8d9095;
$gray-400: #727272;
$gray-600: #3d3f42;
$blue-100: #d8e3f5;
$blue-400: #6591d9;
Expand Down
6 changes: 5 additions & 1 deletion src/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ type ButtonGroupProps = {
};

export const ButtonGroup = ({ className, fullWidth, children }: ButtonGroupProps) => {
return <div className={classNames('button-group', { 'full-width': fullWidth }, className)}>{children}</div>;
return (
<div role="tablist" className={classNames('button-group', { 'full-width': fullWidth }, className)}>
{children}
</div>
);
};
4 changes: 3 additions & 1 deletion src/components/ComplexLookupField/ComplexLookupField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC } from 'react';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import classNames from 'classnames';
import { IS_EMBEDDED_MODE } from '@common/constants/build.constants';
import { VALUE_DIVIDER } from '@common/constants/complexLookup.constants';
Expand All @@ -20,6 +20,7 @@ interface Props {
}

export const ComplexLookupField: FC<Props> = ({ value = undefined, id, entry, onChange }) => {
const { formatMessage } = useIntl();
const { layout, htmlId } = entry;
const lookupConfig = COMPLEX_LOOKUPS_CONFIG[layout?.api as string];
const buttonConfigLabel = lookupConfig?.labels?.button;
Expand Down Expand Up @@ -54,6 +55,7 @@ export const ComplexLookupField: FC<Props> = ({ value = undefined, id, entry, on
onClick={() => handleDelete(id)}
className="complex-lookup-selected-delete"
data-testid="complex-lookup-selected-delete"
aria-label={formatMessage({ id: 'ld.aria.edit.removeComplexLookupFieldValue' })}
>
<CloseIcon />
</button>
Expand Down
10 changes: 8 additions & 2 deletions src/components/ComplexLookupField/MarcPreviewComplexLookup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ export const MarcPreviewComplexLookup: FC<MarcPreviewComplexLookupProps> = ({ on
const { complexValue: marcPreviewData, metadata: marcPreviewMetadata } = useMarcPreviewState();

const renderCloseButton = () => (
<Button data-testid="nav-close-button" type={ButtonType.Icon} onClick={onClose} className="nav-close">
<Button
ariaLabel={formatMessage({ id: 'ld.aria.complexLookup.marcPreview.close' })}
data-testid="nav-close-button"
type={ButtonType.Icon}
onClick={onClose}
className="nav-close"
>
<Times16 />
</Button>
);
Expand Down Expand Up @@ -60,7 +66,7 @@ export const MarcPreviewComplexLookup: FC<MarcPreviewComplexLookupProps> = ({ on
</Button>
</div>
</SearchControlPane>
<div className="marc-preview-content">
<div className="marc-preview-content" tabIndex={0}>
<div className="marc-preview-content-title">
<FormattedMessage id="ld.marcAuthorityRecord" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DropdownField/DropdownField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const DropdownField: FC<IDropdownField> = ({
disabled={isDisabled}
className="edit-section-field-input dropdown-field"
data-testid={testId}
ariaLabelledby={htmlId}
ariaLabelledBy={htmlId}
/>
);
};
2 changes: 1 addition & 1 deletion src/components/EditSection/EditSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useInputsState, useProfileState, useStatusState, useUIState } from '@sr
import { renderDrawComponent } from './renderDrawComponent';
import './EditSection.scss';

const USER_INPUT_DELAY = 750;
const USER_INPUT_DELAY = 100;

export const EditSection = memo(() => {
const { selectedEntriesService } = useServicesContext() as Required<ServicesParams>;
Expand Down
7 changes: 4 additions & 3 deletions src/components/Table/TableFlex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const TableFlex = ({ header, data, className, onRowClick, onHeaderCellCli
};

return (
<div data-testid="table" className={classNames(table, tableFlex, className)}>
<div ref={tableHeadElemRef} className={tableHead}>
<div ref={tableHeadRowElemRef} className={tableRow}>
<div role="table" data-testid="table" className={classNames(table, tableFlex, className)}>
<div role="rowgroup" ref={tableHeadElemRef} className={tableHead}>
<div role="row" ref={tableHeadRowElemRef} className={tableRow}>
{sortedHeaderEntries.map(([key, { label, className, ...rest }]) => (
<div
key={key}
Expand Down Expand Up @@ -105,6 +105,7 @@ export const TableFlex = ({ header, data, className, onRowClick, onHeaderCellCli
className={classNames('table-cell', className, headerClassName)}
data-testid={key}
key={key}
role="cell"
{...rest}
>
<div className="table-cell-content">{(children || label) ?? ''}</div>
Expand Down
2 changes: 2 additions & 0 deletions translations/ui-linked-data/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"ld.searchQueryWouldBeHere": "{query} would be here",
"ld.continue": "Continue",
"ld.aria.modal.close": "Close {modalKind} modal",
"ld.aria.complexLookup.marcPreview.close": "Close lookup MARC preview section",
"ld.aria.advancedSearch.queryInput": "Advanced search row query input",
"ld.aria.advancedSearch.operator": "Advanced search row operator",
"ld.aria.advancedSearch.qualifier": "Advanced search row qualifier",
Expand All @@ -197,6 +198,7 @@
"ld.aria.edit.close": "Close edit page",
"ld.aria.edit.deleteComponent": "Delete component",
"ld.aria.edit.duplicateComponent": "Duplicate component",
"ld.aria.edit.removeComplexLookupFieldValue": "Remove complex lookup field value",
"ld.aria.resourcePreview.close": "Close resource preview pane",
"ld.aria.externalResourcePreview.close": "Close external resource preview page",
"ld.aria.marcAuthorityPreview.close": "Close MARC authority preview",
Expand Down
4 changes: 2 additions & 2 deletions translations/ui-linked-data/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"ld.person": "Person",
"ld.source": "Source",
"ld.family": "Family",
"ld.organization": "Organization",
"ld.organization": "Organizacja",
"ld.meeting": "Meeting",
"ld.corporateBody": "Corporate body",
"ld.jurisdiction": "Jurisdiction",
Expand Down Expand Up @@ -164,7 +164,7 @@
"ld.thesaurus": "Thesaurus",
"ld.typeOfHeading": "Type of heading",
"ld.dateCreated": "Date created",
"ld.dateUpdated": "Date updated",
"ld.dateUpdated": "Data aktualizacji",
"ld.excludeSeeFrom": "Exclude see from",
"ld.excludeSeeFromAlso": "Exclude see from also",
"ld.previous": "Previous",
Expand Down
18 changes: 9 additions & 9 deletions translations/ui-linked-data/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"ld.assign": "Atribuir",
"ld.assignAuthority": "Atribuir autoridade",
"ld.change": "Mudar",
"ld.searchCreatorAuthority": "Search creator authority",
"ld.searchCreatorAuthority": "Pesquisar autoridade do criador",
"ld.selectMarcAuthority": "Selecione a autoridade MARC",
"ld.marcAuthority": "Autoridade MARC",
"ld.keyword": "Palavra-chave",
Expand All @@ -166,7 +166,7 @@
"ld.dateCreated": "Data de criação",
"ld.dateUpdated": "Data de atualização",
"ld.excludeSeeFrom": "Excluir VER DE",
"ld.excludeSeeFromAlso": "Exclude see from also",
"ld.excludeSeeFromAlso": "Excluir Ver Também",
"ld.previous": "Anterior",
"ld.next": "Próximo",
"ld.from": "De",
Expand All @@ -183,11 +183,11 @@
"ld.continue": "Continuar",
"ld.aria.filters.select": "Selecione identificadores de busca",
"ld.aria.filters.textbox": "Caixa de texto de consulta de busca",
"ld.aria.filters.reset": "Reset filters button",
"ld.aria.filters.reset.announce": "Search field and filters are reset",
"ld.backToInventory": "Back to inventory",
"ld.properties": "Properties",
"ld.errorFetchingExternalResourceForEditing": "Error fetching external resource for editing",
"ld.duplicateImportWarn": "Duplicate import warning",
"ld.rdPropertiesMatchContinue": "Properties of this resource match an existing resource. Do you want to continue?"
"ld.aria.filters.reset": "Botão Redefinir filtros",
"ld.aria.filters.reset.announce": "Campo de busca e filtros são redefinidos",
"ld.backToInventory": "Voltar ao inventário",
"ld.properties": "Propriedades",
"ld.errorFetchingExternalResourceForEditing": "Erro ao buscar recurso externo para edição",
"ld.duplicateImportWarn": "Aviso de importação duplicada",
"ld.rdPropertiesMatchContinue": "As propriedades desse recurso correspondem a um recurso existente. Deseja continuar?"
}

0 comments on commit 90ee588

Please sign in to comment.