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: convert TaskLayoutOptions to enum #2631

Conversation

ilandikov
Copy link
Collaborator

Description

  • convert TaskLayoutOptions to enum
  • remove a place to edit when adding new Task field (// NEW_TASK_FIELD_EDIT_REQUIRED)
  • replace Task fields string values with references to enum

Motivation and Context

  • create a single container for TaskLayoutOptions value
  • strengthen the code by having links to values instead of values
  • decrease number of places to edit when adding new Task field (// NEW_TASK_FIELD_EDIT_REQUIRED)

How has this been tested?

Unit tests.

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

  • My code follows the code style of this project and passes yarn run lint.
  • My change has adequate Unit Test coverage.

Terms

@claremacrae claremacrae added the type: internal Only regards development or contributing label Jan 31, 2024
src/Query/Query.ts Show resolved Hide resolved
src/Layout/TaskLayoutOptions.ts Show resolved Hide resolved
@claremacrae
Copy link
Collaborator

I went to rename Task.blockedBy to Task.dependsOn - and realised it would conflict with this, so have held off doing it for now.

@claremacrae claremacrae merged commit 7a9a4a6 into obsidian-tasks-group:main Feb 3, 2024
1 check passed
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.

2 participants