From 61890fdd27d1ef59de59b84f27ef79a4f975677e Mon Sep 17 00:00:00 2001 From: Galust Date: Thu, 8 Feb 2024 16:28:33 +0400 Subject: [PATCH 01/29] fix(AdvancedSearch): stop immediate call for action onclick --- src/lib/molecules/AdvancedSearch/SearchResultRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/molecules/AdvancedSearch/SearchResultRow.js b/src/lib/molecules/AdvancedSearch/SearchResultRow.js index 0e81d898..f28f2e18 100644 --- a/src/lib/molecules/AdvancedSearch/SearchResultRow.js +++ b/src/lib/molecules/AdvancedSearch/SearchResultRow.js @@ -79,7 +79,7 @@ function SearchResultRow({ element }) { appearance="minimal" onFocus={handleFocus} cornerRadius="smooth" - onClick={action.onClick(element)} + onClick={() => action?.onClick(element)} className="searchResultRow__action" ariaLabel={action.name || action.icon} /> From 31bed3546ac97db7ad5930e2fe31259b4906f2e5 Mon Sep 17 00:00:00 2001 From: Galust Date: Fri, 9 Feb 2024 11:56:38 +0400 Subject: [PATCH 02/29] feat(AdvancedSearch): add tooltip for actions --- .../molecules/AdvancedSearch/SearchResult.js | 10 +++--- .../AdvancedSearch/SearchResultRow.js | 32 ++++++++++--------- src/lib/molecules/AdvancedSearch/index.js | 10 +++--- .../AdvancedSearch/AdvancedSearch.stories.jsx | 9 ++++-- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/lib/molecules/AdvancedSearch/SearchResult.js b/src/lib/molecules/AdvancedSearch/SearchResult.js index 837ab268..ee347924 100644 --- a/src/lib/molecules/AdvancedSearch/SearchResult.js +++ b/src/lib/molecules/AdvancedSearch/SearchResult.js @@ -147,8 +147,9 @@ SearchResult.propTypes = { actions: PropTypes.arrayOf( PropTypes.shape({ name: PropTypes.string, - icon: PropTypes.string, - onClick: PropTypes.func + icon: PropTypes.string.isRequired, + onClick: PropTypes.func, + description: PropTypes.string }) ) }) @@ -207,8 +208,9 @@ SearchResult.propTypes = { actions: PropTypes.arrayOf( PropTypes.shape({ name: PropTypes.string, - icon: PropTypes.string, - onClick: PropTypes.func + icon: PropTypes.string.isRequired, + onClick: PropTypes.func, + description: PropTypes.string }) ) }) diff --git a/src/lib/molecules/AdvancedSearch/SearchResultRow.js b/src/lib/molecules/AdvancedSearch/SearchResultRow.js index f28f2e18..b6d053de 100644 --- a/src/lib/molecules/AdvancedSearch/SearchResultRow.js +++ b/src/lib/molecules/AdvancedSearch/SearchResultRow.js @@ -70,19 +70,20 @@ function SearchResultRow({ element }) { })} > {actions?.map((action, index) => ( -