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: make creating a task with both Cancelled and Done not possible with the Edit Task modal #2987

Conversation

ilandikov
Copy link
Collaborator

Types of changes

Changes visible to users:

Description

  • when validating edit modal input, check whether done and cancelled date have been input. If yes, invalidate the form and show error on cancelled and done date inputs for user to take action.

Motivation and Context

  • make editing with modal consistent and logical (a task cannot have cancelled and done date at the same time).

How has this been tested?

  • manual test in demo vault build on the commit with the fix

Screenshots

Снимок экрана 2024-07-24 в 13 00 29

Checklist

  • My code follows the code style of this project and passes yarn run lint.
  • My change has adequate Unit Test coverage.
    • this is not testable, developing tests here requires quite an effort, the fix is small and manually testable

Terms

@claremacrae
Copy link
Collaborator

Thanks for looking at this!

Looking at the code, I couldn't see how the values would be changed back to valid. So did a quick test.

  • Set Done
  • Set Cancelled
  • Delete Cancelled

Result:

image

Copy link

@ilandikov
Copy link
Collaborator Author

Many thanks for this test!

I've done a fix for this, but it looks very ugly and confirms my hypothesis that we need to extract a validator function for EditableTask to implement this and other helpful stuff for the modal (I have another bug in my sleeve).

I don't think that this is mergeable, but it good that we explored this solution quickly. However if you find this solution to be Ok, I'm fine to merge this if we find a test framework together later.

@claremacrae
Copy link
Collaborator

I've done a fix for this, but it looks very ugly and confirms my hypothesis that we need to extract a validator function for EditableTask to implement this and other helpful stuff for the modal (I have another bug in my sleeve).

I have some ideas about approaches to take...

I don't think that this is mergeable, but it good that we explored this solution quickly. However if you find this solution to be Ok, I'm fine to merge this if we find a test framework together later.

How high a priority do you think the bug really is, though?

With regards to how we use our pairing time, I would much prefer to get the properties and sub-tsk facilities out first.

@claremacrae
Copy link
Collaborator

Should have said, yes, I don't think this is mergeable...

@ilandikov
Copy link
Collaborator Author

How high a priority do you think the bug really is, though?

With regards to how we use our pairing time, I would much prefer to get the properties and sub-tsk facilities out first.

No hurry at all, I just think this would open up a lot of space for improvement.

Let's finish what we have in the pipe for now and see later if we switch on this =)

@claremacrae
Copy link
Collaborator

Thanks for your understanding.

@claremacrae claremacrae added the scope: edit task The Create or edit task modal/dialog label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: edit task The Create or edit task modal/dialog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Task modal: creating a task with both Cancelled and Done is possible
2 participants