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, sorting and grouping for created date #1741

Closed
2 tasks done
claremacrae opened this issue Mar 8, 2023 · 5 comments · Fixed by #1744
Closed
2 tasks done

Add filtering, sorting and grouping for created date #1741

claremacrae opened this issue Mar 8, 2023 · 5 comments · Fixed by #1744
Assignees
Labels
scope: filters Additions and modifications to the search filters scope: grouping Changes to the grouping capabilities scope: sorting Changes to the sorting capabilities scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks type: enhancement New feature or request

Comments

@claremacrae
Copy link
Collaborator

⚠️ Please check that this feature request hasn't been suggested before.

  • I searched previous Ideas in Discussions didn't find any similar feature requests.
  • I searched previous Issues didn't find any similar feature requests.

🔖 Feature description

This is to remind me to implement filtering, sorting and grouping for the new created date field that was added in #1723.

This ticket is actually a duplicated of #98, but discussions cannot be added to GitHub projects.

✔️ Solution

  • Implement filter and sort using the DateField implementation
    • Create a new CreateDateField class, inheriting DateField
    • Add a corresponding test file, with minimal tests
  • Implement grouping using DateField
    • Refactor the date-grouping code to use the new interface in Field
    • Then grouping comes for free
  • Update the docs (filters.md, sorting.md, grouping.md and quick reference)

❓ Alternatives

No response

📝 Additional Context

No response

@claremacrae claremacrae added type: enhancement New feature or request scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks scope: filters Additions and modifications to the search filters scope: sorting Changes to the sorting capabilities scope: grouping Changes to the grouping capabilities labels Mar 8, 2023
@claremacrae claremacrae moved this from 🔖 Ready to 🆕 New in Tasks (Obsidian plugin) Roadmap Mar 8, 2023
@vanadium23
Copy link
Contributor

I can grab this one, because the description is fully detailed for the needed implementation.

@claremacrae
Copy link
Collaborator Author

Hi @vanadium23, oh that’s great. Thank you.

The searching and sorting should be clear, I hope

Please could that go in a first PR?

I will add some more info shortly about the grouping one.

@claremacrae
Copy link
Collaborator Author

The searching and sorting should be clear, I hope

Please could that go in a first PR?

Ignore that ordering suggestion - I might have a better idea by the time I've finished writing up the grouping steps.

@claremacrae
Copy link
Collaborator Author

The Grouping implementation

The description in #1549 now contains info describing the old grouping code and the new.

It was my intention to migrate all the old grouping instructions to the new mechanism, but that hasn't happened yet.

I hope it will give you enough info to:

  • Move the group by code for dates to DateField.ts
    • Add the two required grouping functions to DateField.ts
    • Remove all the date-grouping code from Query.ts and Group.ts
  • Testing would then involve:
    • What the tests might look like: I suggest seeing StatusNameField.test.ts for the kind of test to write
    • What data to test with: I suggest moving the data-field-related test cases in Group.test.ts to the bottom of each of the existing DoneDateField.test.ts and similar.

Order of Work

Kent Beck says something like "Make the change easy, then make the easy change".

I think if you were to do the above for DateField, that would be a first step that would be a pure refactor: PR.

Then once that was merged, a second PR would be to provide the new CreatedDateField, which would implement filtering, sorting and grouping for created date all in just a few lines of code and a feat: PR.

@claremacrae
Copy link
Collaborator Author

FYI I'm going to 'assign' this to you, @vanadium23 ... This doesn't mean you are 'required' to do it, it just reminds me and lets others know that someone has volunteered to try and take a look...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: filters Additions and modifications to the search filters scope: grouping Changes to the grouping capabilities scope: sorting Changes to the sorting capabilities scope: task dates and times Requests for enhancements to types and formats of dates and times associated with tasks type: enhancement New feature or request
Projects
Status: 🎉 Released
Development

Successfully merging a pull request may close this issue.

2 participants