Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Release #3478

Merged
merged 50 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
acb4442
adds cypress tests for index service
thoniTUB Nov 23, 2023
ba0c1cb
Merge branch 'develop' into feature/global_indexservice
thoniTUB Dec 11, 2023
9caba2e
implement getResultType manually instead of deriving it from Aggregator.
awildturtok Apr 4, 2024
a2a86df
remove now unused getResultType from Aggregator
awildturtok Apr 4, 2024
6c6a19e
Merge branch 'develop' into feature/global_indexservice
thoniTUB Apr 17, 2024
113d80b
Merge branch 'develop' into feature/global_indexservice
thoniTUB Apr 23, 2024
26a3547
Merge branch 'develop' into feature/global_indexservice
thoniTUB May 24, 2024
994361c
create dataset for new test
thoniTUB May 24, 2024
26bff49
integrate index test in dataset test
thoniTUB May 24, 2024
59191e1
Merge pull request #3461 from ingef/master
thoniTUB Jun 4, 2024
7f7ddfa
adds managerNode to script end
thoniTUB Jun 4, 2024
328acac
Merge branch 'develop' into feature/explicit-select-type
awildturtok Jun 4, 2024
0f324dd
fix error for DistinctSelect unmapped case
awildturtok Jun 4, 2024
b7650cd
fixes missing mapping for ConceptColumnSelect and borking ListType
awildturtok Jun 5, 2024
9398588
Fix formatting of PrefixAggregator
awildturtok Jun 5, 2024
9329190
Merge pull request #3463 from ingef/feature/explicit-select-type
awildturtok Jun 5, 2024
ec22487
use Set<String> for MultiSelectFilterNode
awildturtok Jun 12, 2024
685732e
use lable not name in ConceptColumnSelect to give properly cased output.
awildturtok Jun 12, 2024
f5175cc
apply Set<String> usage to FlagSelect
awildturtok Jun 12, 2024
22ded57
Merge branch 'develop' into feature/global_indexservice
thoniTUB Jun 12, 2024
f16f91d
Merge pull request #3227 from ingef/feature/global_indexservice
thoniTUB Jun 12, 2024
94657e1
Rework select and filter conversion (#3453)
jnsrnhld Jun 12, 2024
4b152e6
Merge branch 'develop' into feature/manager-node-in-script-end
thoniTUB Jun 13, 2024
23e6503
Merge pull request #3462 from ingef/feature/manager-node-in-script-end
thoniTUB Jun 13, 2024
e8d740c
Merge branch 'develop' into feature/use-string-set
awildturtok Jun 13, 2024
463de8a
Merge pull request #3466 from ingef/feature/use-string-set
awildturtok Jun 13, 2024
2d2b76e
unifiy printConceptLocalId into Concept/TreeConcept
awildturtok Jun 13, 2024
94a7bf4
Merge pull request #3467 from ingef/feature/use-label-for-ConceptColu…
awildturtok Jun 13, 2024
043689e
Implement COUNT_QUARTERS select and filter for dateranges (#3446)
jnsrnhld Jun 13, 2024
67ed3ee
Implement ConceptColumnSelect conversion (#3465)
jnsrnhld Jun 13, 2024
b29f06e
support nested StructureNodes
thoniTUB Jun 14, 2024
6a8c021
remove unnecessary methods
thoniTUB Jun 14, 2024
5965df0
remove ShutdownShard message, as it is cumbersome in distributed envi…
thoniTUB Jun 14, 2024
cd5b9c6
remove more dead code
thoniTUB Jun 14, 2024
53dc972
fix indent
thoniTUB Jun 14, 2024
d668265
Merge pull request #3468 from ingef/fix/nested-structure-nodes
thoniTUB Jun 17, 2024
fee6ba1
Merge branch 'develop' into fix/separate-manager-restart
thoniTUB Jun 17, 2024
9789c12
Merge pull request #3469 from ingef/fix/separate-manager-restart
thoniTUB Jun 17, 2024
81d7f72
Bump io.github.classgraph:classgraph from 4.8.97 to 4.8.112 in /backend
dependabot[bot] Jun 21, 2024
1d59016
Improve history's default filter state and its empty search state
Kadrian Jun 24, 2024
da199d4
Merge pull request #3473 from ingef/improve-history-default-state-and…
Kadrian Jun 24, 2024
92d768a
Make more history content searchable
Kadrian Jun 24, 2024
e087d85
Extract search into function
Kadrian Jun 24, 2024
b7d2c6c
Reorganize timeline data logic and search logic
Kadrian Jun 24, 2024
d762930
Merge pull request #3474 from ingef/make-more-history-content-searchable
Kadrian Jun 24, 2024
ee1c9b8
Make projec titems search and concept tree search debounced input fie…
Kadrian Jun 24, 2024
02aaa17
Merge pull request #3475 from ingef/change-search-to-debounced-input-…
Kadrian Jun 24, 2024
4ad9a6a
Merge branch 'develop' into dependabot/maven/backend/io.github.classg…
thoniTUB Jun 25, 2024
49a1af7
Merge pull request #3472 from ingef/dependabot/maven/backend/io.githu…
thoniTUB Jun 25, 2024
1cd9bf1
Revert "Make projec titems search and concept tree search debounced i…
awildturtok Jul 1, 2024
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
Prev Previous commit
Next Next commit
Extract search into function
Kadrian committed Jun 24, 2024

Verified

This commit was signed with the committer’s verified signature.
dovydas55 Dovydas Stankevicius
commit e087d85e705e6383608f0de975a60dd8b5dbffb4
113 changes: 61 additions & 52 deletions frontend/src/js/entity-history/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -279,6 +279,59 @@ export interface EventsByQuarterWithGroups {
differences: string[][];
}

// Filter concepts by searchTerm
const isMatch = (str: string, searchTerm: string) =>
str.toLowerCase().includes(searchTerm.toLowerCase());

const entryMatchesSearchTerm = ({
entry: [key, value],
columnBuckets,
searchTerm,
rootConceptIdsByColumn,
}: {
entry: [key: string, value: unknown];
columnBuckets: ColumnBuckets;
searchTerm: string;
rootConceptIdsByColumn: Record<string, ConceptIdT>;
}) => {
const conceptColumn = columnBuckets.concepts.find((col) => col.label === key);

if (conceptColumn) {
const rootConceptId = rootConceptIdsByColumn[conceptColumn.label];
const rootConcept = getConceptById(rootConceptId, rootConceptId);

if (!rootConcept) return false;

const concept = getConceptById(value as string, rootConceptId);

if (!concept) return false;

return isMatch(
`${rootConcept.label} ${concept.label} - ${concept.description}`,
searchTerm,
);
}

const restColumn = columnBuckets.rest.find((col) => col.label === key);

if (restColumn) {
return isMatch(value as string, searchTerm);
}

const groupableColumn = columnBuckets.groupableIds.find(
(col) =>
col.label === key &&
!isDateColumn(col) && // Because they're already displayed somewhere else
!isSourceColumn(col), // Because they're already displayed somewhere else
);

if (groupableColumn) {
return isMatch(value as string, searchTerm);
}

return false;
};

const groupByQuarter = (
entityData: EntityHistoryStateT["currentEntityData"],
sources: Set<string>,
@@ -341,10 +394,6 @@ const groupByQuarter = (
});
}

// Filter concepts by searchTerm
const isMatch = (str: string) =>
!searchTerm || str.toLowerCase().includes(searchTerm.toLowerCase());

const filteredSortedEvents = sortedEvents
.map(({ year, quarterwiseData }) => ({
year,
@@ -353,54 +402,14 @@ const groupByQuarter = (
: quarterwiseData.map(({ quarter, events }) => ({
quarter,
events: events.filter((event) => {
return Object.entries(event).some(([key, value]) => {
const conceptColumn = columnBuckets.concepts.find(
(col) => col.label === key,
);

if (conceptColumn) {
const rootConceptId =
rootConceptIdsByColumn[conceptColumn.label];
const rootConcept = getConceptById(
rootConceptId,
rootConceptId,
);

if (!rootConcept) return false;

const concept = getConceptById(
value as string,
rootConceptId,
);

if (!concept) return false;

return isMatch(
`${rootConcept.label} ${concept.label} - ${concept.description}`,
);
}

const restColumn = columnBuckets.rest.find(
(col) => col.label === key,
);

if (restColumn) {
return isMatch(value as string);
}

const groupableColumn = columnBuckets.groupableIds.find(
(col) =>
col.label === key &&
!isDateColumn(col) && // Because they're already displayed somewhere else
!isSourceColumn(col), // Because they're already displayed somewhere else
);

if (groupableColumn) {
return isMatch(value as string);
}

return false;
});
return Object.entries(event).some((entry) =>
entryMatchesSearchTerm({
entry,
columnBuckets,
rootConceptIdsByColumn,
searchTerm,
}),
);
}),
})),
}))