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

refactor: Introduce (empty) SearchInfo class #2373

Merged
merged 7 commits into from
Oct 27, 2023
Merged

Conversation

claremacrae
Copy link
Collaborator

Description

SearchInfo will soon contain selected data passed in from the Query being executed.

This is the Parameter Object pattern: it is a container for information that will be passed down through multiple levels of code, in order to be able to in future pass through more data, without having to update the function signatures of all the layers in between.

Note: Lots of the FilterFunction use don't need the 2nd parameter added, as they only act on the Task.

For now, I've taken the decision to only update the locations that needed to be updated in order to compile, rather than having loads of unused variables.

Motivation and Context

  • I found when working with @DanielTMolloy919 on the dependencies code that we needed to pass Task[] down from Query to the filter functions
  • Now I want to be able to pass the query file name down as well, in order to allow filter by function to have access to the path of the query block - to provide query.file.path etc in custom filtering and grouping.

Now we pass through a SearchInfo object, rather than keeping on adding more parameters to pass down through all the layers from Query to FilterFunction.

And in future Query can add more data to SearchInfo, and the filters that need that information can use it.

How has this been tested?

  • By running tests
  • By checking some of the searches in the Tasks-Demo vault.

Screenshots (if appropriate)

Types of changes

Internal changes:

  • Refactor (prefix: refactor - non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)
  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Checklist

Terms

@claremacrae claremacrae added the type: internal Only regards development or contributing label Oct 27, 2023
@claremacrae claremacrae merged commit a326092 into main Oct 27, 2023
2 checks passed
@claremacrae claremacrae deleted the add-search-info-class branch October 27, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: internal Only regards development or contributing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant