Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #70 from eea/develop
Browse files Browse the repository at this point in the history
ExpandableTable include title in searchable content
  • Loading branch information
andreiggr committed May 12, 2022
2 parents 8c557f9 + 2c74265 commit 83fc6fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [0.2.13](https://github.com/eea/volto-forests-theme/compare/0.2.12...0.2.13)

- ExpandableTable include title in searchable content [`49e98af`](https://github.com/eea/volto-forests-theme/commit/49e98afe8d0c7c55f583c1f7d96616d86cbe6846)

#### [0.2.12](https://github.com/eea/volto-forests-theme/compare/0.2.11...0.2.12)

> 11 May 2022
- Merge pull request #69 from eea/develop [`8c557f9`](https://github.com/eea/volto-forests-theme/commit/8c557f9d133d6f6079d9b3354d6df373b053fc64)
- Set and remove filters for table too [`8840f54`](https://github.com/eea/volto-forests-theme/commit/8840f547fdca9bded96e9681d0721627503e2b61)

#### [0.2.11](https://github.com/eea/volto-forests-theme/compare/0.2.10...0.2.11)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-forests-theme",
"version": "0.2.12",
"version": "0.2.13",
"description": "@eeacms/volto-forests-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ const View = (props) => {
return;
}
const re = new RegExp(_.escapeRegExp(data.value), 'i');

const searchableCols =
props.data && props.data.popupTitle
? [...selectedColumns, { column: props.data.popupTitle }]
: selectedColumns;

const isMatch = (result) => {
for (let colDef of selectedColumns) {
for (let colDef of searchableCols) {
if (re.test(result[colDef.column])) {
return true;
}
Expand All @@ -92,7 +98,7 @@ const View = (props) => {
}, time);
},
/* eslint-disable-next-line */
[filteredTableData, selectedColumns],
[filteredTableData, selectedColumns, data.popupTitle],
);

React.useEffect(() => {
Expand Down

0 comments on commit 83fc6fa

Please sign in to comment.