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

Removing a number in a cell does not remove the time entry #432

Closed
1 task
HenrikeW opened this issue May 12, 2022 · 2 comments · Fixed by #433
Closed
1 task

Removing a number in a cell does not remove the time entry #432

HenrikeW opened this issue May 12, 2022 · 2 comments · Fixed by #433
Assignees
Labels
bug Something isn't working frontend This is likely affecting the frontend

Comments

@HenrikeW
Copy link
Contributor

HenrikeW commented May 12, 2022

Describe the bug

In a cell that contains a time entry from a database, this time entry is not removed if the user only removes the number with Backspace or Delete and saves. He/she instead has to type a 0 into the cell and save to effectively remove the entry from the database.
In technical terms, the newTimeEntries array that keeps track of changes in the frontend code, isn't updated in this case.
This only is a problem with entries from the database. The cell behavior for so far unsaved entries works as expected.

Steps to reproduce

  1. Go to the report page to a week that already has entries from the database.
  2. Click into a cell with entry and remove the number with Backspace or delete
  3. Click "Save changes" - you should get the warning that you don't have any changes to save. That's the bug.

To reproduce the correct behavior when pressing 0:

  1. Repeat steps 1 and 2 from above.
  2. Type 0 in the cell
  3. Click "Save changes"
  4. Reload the page - the entry should be gone

To reproduce the correct behavior for unsaved entries:

  1. Go to the report page
  2. Click in an empty cell and enter a number
  3. Remove the number again with Backspace or Delete
  4. Click "Save changes" - you should get the warning that you don't have any changes to save.

Environment

develop branch

Expected behavior

  • if a time entry from the database in a cell is removed with Backspace or Delete, this should be recognized as a change and delete the entry from the database when pressing "Save changes"

Screenshots

Additional context

@HenrikeW HenrikeW added bug Something isn't working frontend This is likely affecting the frontend labels May 12, 2022
@kusalananda
Copy link
Member

The behaviour seems slightly different from what's described in the first scenario. When clicking "Save changes" in the 3rd step, I get the error dialogue box saying I have no changes to save.

@HenrikeW
Copy link
Contributor Author

Yes, of course, you're right Andreas! I updated the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend This is likely affecting the frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants