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

Add filtering by metadata #7388

Merged
merged 11 commits into from
Jan 28, 2024
Merged

Add filtering by metadata #7388

merged 11 commits into from
Jan 28, 2024

Conversation

shefalijoshi
Copy link
Contributor

@shefalijoshi shefalijoshi commented Jan 18, 2024

Closes: #7389

Describe your changes:

Added a new filtering section for metadata filters
Added new sourceMap array property filterMetadata to specify a list of properties for metadata filtering.
Example:

"sourceMap": {
"filterMetadata": ["description", "properties.latitude"]
}

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Is this a breaking change to be called out in the release notes?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (1fc6056) 55.90% compared to head (4b0ab1e) 55.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7388   +/-   ##
=======================================
  Coverage   55.90%   55.91%           
=======================================
  Files         662      662           
  Lines       26397    26432   +35     
  Branches     2563     2574   +11     
=======================================
+ Hits        14757    14779   +22     
- Misses      10928    10939   +11     
- Partials      712      714    +2     
Flag Coverage Δ
e2e-full 41.87% <ø> (ø)
e2e-stable 59.78% <0.00%> (-0.04%) ⬇️
unit 48.94% <35.41%> (-0.01%) ⬇️
Files Coverage Δ
src/plugins/timelist/plugin.js 100.00% <ø> (ø)
src/plugins/plan/util.js 45.76% <45.45%> (-0.08%) ⬇️
src/plugins/timelist/TimelistComponent.vue 59.72% <66.66%> (+3.90%) ⬆️
.../plugins/timelist/inspector/FilteringComponent.vue 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fc6056...4b0ab1e. Read the comment docs.

Copy link
Contributor

@michaelrogers michaelrogers left a comment

Choose a reason for hiding this comment

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

Invalid metadata filters can be saved for example foo.bar. Otherwise, these changes look good to me; filtering by metadata is working as expected.
Screenshot 2024-01-25 at 3 21 37 PM

Copy link
Contributor

@charlesh88 charlesh88 left a comment

Choose a reason for hiding this comment

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

Ran locally with a test plan with metadata and appears to work correctly. Added a "No filters applied" message for both input areas and additional detail about how it works in the hint text visible while editing. LGTM.

Test plan:
Synth plan 2024-01-25.json

charlesh88 and others added 3 commits January 25, 2024 16:44
- Added a "No filters applied" message for both input areas.
- Added additional detail about how it works in the hint text visible while editing.
@shefalijoshi
Copy link
Contributor Author

Invalid metadata filters can be saved for example foo.bar. Otherwise, these changes look good to me; filtering by metadata is working as expected. Screenshot 2024-01-25 at 3 21 37 PM

This is fixed now. Please re-test and review.

Copy link
Contributor

@michaelrogers michaelrogers left a comment

Choose a reason for hiding this comment

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

Nice work! These changes look good to me. There is a linting error for an unused import in TimelistComponent.vue that will need to be addressed before merging.

There are some observations about the behavior of the filtering that might be worth noting that aren't necessarily bugs:

  • If a user inputs an invalid string and saves, the string will be chopped off at the invalid character without informing the user (though it can be verified in the textarea after saving). If the invalid char is at the beginning like :foobar, then this term will not be saved at all. Otherwise if it is like foo.bar, only foo will be saved as a search term (which is probably okay).
  • The properties metadata is only traversed at the first level. So a value in this field would not be searched properties.level1.level2.
  • Adding only whitespace or a null value in the comma separated list will match all values. foo, ,bar or foo,,bar.

@shefalijoshi shefalijoshi added this to the Target:4.0.0 milestone Jan 26, 2024
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 26, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 26, 2024
@shefalijoshi shefalijoshi added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 27, 2024
@shefalijoshi shefalijoshi enabled auto-merge (squash) January 27, 2024 15:23
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 27, 2024
@unlikelyzero unlikelyzero added the type:feature Feature. Required intentional design label Jan 28, 2024
@unlikelyzero unlikelyzero added pr:e2e:couchdb npm run test:e2e:couchdb pr:e2e:perf Trigger perf tests labels Jan 28, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 28, 2024
@shefalijoshi shefalijoshi merged commit 60e1eeb into master Jan 28, 2024
27 checks passed
@shefalijoshi shefalijoshi deleted the timelist-metadata-filtering branch January 28, 2024 18:04
@github-actions github-actions bot removed the pr:e2e:perf Trigger perf tests label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Feature. Required intentional design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow filtering of time list activities by metadata
5 participants