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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress/support/enrichmentFormPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const updateNameEnrichment = () => {
cy.contains('Save', { timeout: 500 }).click({
force: true,
});
cy.wait(3000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you need to add a wait here ?
Is it possible to detect a progressbar / notification instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you need to add a wait here ?

We need to wait for the save request to be fully done before reloading the page, otherwise the enrichment isn't saved yet when the page reload. I don't know why we didn't get it before.
Maybe I could track the notification or wait for the save button to be enabled again (it gets disabled when saving).

Copy link
Collaborator Author

@Madeorsk Madeorsk Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find a way to get it to work every time when I use the save button state... I don't really understand what's happening here, but with this small wait, the test always pass, and without it, it fails randomly.

cy.reload();
cy.findByLabelText('Name *', { timeout: 3500 }).should(
'have.value',
Expand Down
2 changes: 1 addition & 1 deletion src/app/custom/translations.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@
"resource_description" "Resource description" "Description de la ressource"
"resource_detail_first" "Resource detail first" "Premier détail de la ressource"
"resource_detail_second" "Resource detail second" "Second détail de la ressource"
"resource_detail_third" "Resource detail third" "Troisième détail de la ressource"
"resource_detail_third" "Resource subtitle (e.g. author)" "Sous-titre de la ressource (exemple : auteur)"
"resource_sort_field" "Resource sort field" "Champ de tri de la ressource"
"resource_sort_order" "Sort order" "Ordre de tri"
"dialog_import_has_enrichments" "Import has enrichments" "L'import a des enrichissements"
Expand Down
19 changes: 10 additions & 9 deletions src/app/js/admin/Search/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,16 @@ export const SearchForm = ({ fields, loadField }: SearchFormProps) => {
clearText={translate('clear')}
isLoading={isPending}
/>
{/* Resource detail 3 is used as subtitle. */}
<SearchAutocomplete
testId={`autocomplete_search_syndication_${overview.RESOURCE_DETAIL_3}`}
translation={translate('resource_detail_third')}
fields={fieldsForResourceSyndication}
onChange={handleSResourceDetailThird}
value={resourceDetailThird}
clearText={translate('clear')}
isLoading={isPending}
/>
<SearchAutocomplete
testId={`autocomplete_search_syndication_${overview.RESOURCE_DESCRIPTION}`}
translation={translate('resource_description')}
Expand Down Expand Up @@ -441,15 +451,6 @@ export const SearchForm = ({ fields, loadField }: SearchFormProps) => {
clearText={translate('clear')}
isLoading={isPending}
/>
<SearchAutocomplete
testId={`autocomplete_search_syndication_${overview.RESOURCE_DETAIL_3}`}
translation={translate('resource_detail_third')}
fields={fieldsForResourceSyndication}
onChange={handleSResourceDetailThird}
value={resourceDetailThird}
clearText={translate('clear')}
isLoading={isPending}
/>
</Box>

<Box display="flex" gap={2}>
Expand Down
36 changes: 18 additions & 18 deletions src/app/js/public/search/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ const SearchResult = ({
{result[titleField.name]}
</Box>
)}
{thirdDetailField && result[thirdDetailField.name] && (
<div
className={classnames(
'search-result-detail-third',
styles.details,
)}
>
<div
className={classnames(
'search-result-detail-3',
styles.detailsColumn,
)}
title={result[thirdDetailField.name]}
>
{result[thirdDetailField.name]}
</div>
</div>
)}
{descriptionField && result[descriptionField.name] && (
<Box
className={classnames(
Expand Down Expand Up @@ -211,24 +229,6 @@ const SearchResult = ({
{result[secondDetailField.name]}
</Box>
)}
{thirdDetailField && result[thirdDetailField.name] && (
<div
className={classnames(
'search-result-detail-third',
styles.details,
)}
>
<div
className={classnames(
'search-result-detail-3',
styles.detailsColumn,
)}
title={result[thirdDetailField.name]}
>
{result[thirdDetailField.name]}
</div>
</div>
)}
</div>
)}
<ExpandMoreIcon
Expand Down
3 changes: 3 additions & 0 deletions src/common/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export const RESOURCE_TITLE = 1;
export const RESOURCE_DESCRIPTION = 2;
export const RESOURCE_DETAIL_1 = 3;
export const RESOURCE_DETAIL_2 = 4;
/**
* Resource detail 3 is used as subtitle.
*/
export const RESOURCE_DETAIL_3 = 6;
export const SUBRESOURCE_TITLE = 5;

Expand Down
Loading