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

fix: Allow filename filters to contain parentheses #1907

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

esm7
Copy link
Contributor

@esm7 esm7 commented Apr 23, 2023

Fixed:
#1852

Description

This makes sure that BooleanField is always last in FilterParser.
If a field is added after BooleanField, it shows a TypeScript compilation error.

Motivation and Context

Fixes #1852

How has this been tested?

I tried the query described in the bug and it works as expected.
I also tried adding this to the tests, however this also caused the tests to catch #1500, which this PR does not fix, so I had to leave these tests out for now :(

Screenshots (if appropriate)

Types of changes

Changes visible to users:

  • Bug fix (prefix: fix - non-breaking change which fixes an issue)
  • New feature (prefix: feat - non-breaking change which adds functionality)
  • Breaking change (prefix: feat!! or fix!! - fix or feature that would cause existing functionality to not work as expected)
  • Documentation (prefix: docs - improvements to any documentation content for users)
  • Sample vault (prefix: vault - improvements to the Tasks-Demo sample vault)
  • Contributing Guidelines (prefix: contrib - any improvements to documentation content for contributors - see Contributing to Tasks)

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)
  • Infrastructure (prefix: chore - examples include GitHub Actions, issue templates)

Checklist

Terms

claremacrae added a commit to ilandikov/obsidian-tasks that referenced this pull request Apr 24, 2023
claremacrae added a commit that referenced this pull request Apr 24, 2023
* refactor: add FolderField class for folder grouping

* refactor: add RootField class for root grouping

* refactor: add BacklinkField class for backlink grouping

* refactor: remove old grouping

* refactor: rename the famous 'parseGroupBy'

* test: test: check grouper.property on new fields

* docs: Document root and folder filtering

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* fix: Disable filtering by backlink - use filename and heading instead

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* refactor: Shorten variable name in tests

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* refactor: Duplicate grouper implementation for backlink field

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* fix: BacklinkField.value() no longer escapes characters

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* fix: FolderField.value() no longer escapes characters

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* fix: RootField.value() no longer escapes characters

Co-Authored-By: Ilyas Landikov <93825870+ilandikov@users.noreply.github.com>

* test: Add simple test for folder filter

* test: Add failing tests for RootField.value() and filtering

Git hooks disabled to allow commit and push.

* test: fix test description

* fix: remove the first '/' if present in the path

* refactor: BacklinkField.grouper() refactor

* test: additional test case on BacklinkField grouping

* refactor: Folder and Root Field to groupers to call value()

* refactor: Reorder new lines in FilterParser.ts to avoid #1907 conflict

---------

Co-authored-by: Clare Macrae <github@cfmacrae.fastmail.co.uk>
Copy link
Collaborator

@claremacrae claremacrae left a comment

Choose a reason for hiding this comment

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

I tried making RecurrenceField last and confirmed that I saw an error.

I don't think I would have understood how to fix it from the error alone, but the comments are very clear.

And I take your point about not being able to add a specific test because of the more general bug.

So very happy to approve this.

@claremacrae claremacrae changed the title Fixed issue #1852 by making sure BooleanField is always last fix: Allow filename filters to contain parentheses Apr 24, 2023
@claremacrae claremacrae merged commit a327be7 into obsidian-tasks-group:main Apr 24, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎉 Released
Development

Successfully merging this pull request may close these issues.

filename searches with parentheses fail to parse.
2 participants