Local save tweak #30

Merged
mslw merged 3 commits from local-save-tweak into master 2022-07-25 14:31:55 +00:00
mslw commented 2022-07-14 15:39:52 +00:00 (Migrated from github.com)

This PR closes #29 with the following changes:

  • Save buttons at the end were reordered (now: 1 - Daten lokal speichern, 2 - Daten speichern 3 - Lokale Daten laden).

  • The submit button (Daten Speichern) is now enabled only after the local save has been used. This makes local save essentially required (though there are loopholes). From the code point of view, the state of the submit button (enabled/disabled) is now tracked by a global variable pointing to an object literal, which has a a method to update. I'm not sure if that's the best way of doing so, and if you have better ones I'd be happy to rework it. The goal is to make it harder to "forget" local saving and send the data straight away, thus exiting the form (i just lacked imagination to do something other than what was literally requested).

This PR closes #29 with the following changes: - Save buttons at the end were reordered (now: 1 - Daten lokal speichern, 2 - Daten speichern 3 - Lokale Daten laden). - The submit button (Daten Speichern) is now enabled only after the local save has been used. This makes local save essentially required (though there are loopholes). From the code point of view, the state of the submit button (enabled/disabled) is now tracked by a global variable pointing to an object literal, which has a a method to update. I'm not sure if that's the best way of doing so, and if you have better ones I'd be happy to rework it. The goal is to make it harder to "forget" local saving and send the data straight away, thus exiting the form (i just lacked imagination to do something other than what was literally requested).
christian-monch (Migrated from github.com) reviewed 2022-07-25 12:22:18 +00:00
christian-monch (Migrated from github.com) left a comment

Function-wise it looks good to me. Please consider whether you work in the comments or not.

Function-wise it looks good to me. Please consider whether you work in the comments or not.
christian-monch (Migrated from github.com) commented 2022-07-25 12:09:28 +00:00

You might want to use set instead of toggle, since "toggle" ususally means to flip the logical state, i.e. to set x := not x, and you are just setting the value here.

You might want to use `set` instead of `toggle`, since "toggle" ususally means to flip the logical state, i.e. to set `x := not x`, and you are just setting the value here.
christian-monch (Migrated from github.com) commented 2022-07-25 12:19:46 +00:00

On the same note: submitButtonToggler should probably be something like submitButtonUpdater

On the same note: `submitButtonToggler` should probably be something like `submitButtonUpdater`
christian-monch (Migrated from github.com) commented 2022-07-25 12:16:31 +00:00

Don't leave commented code lying around, it is hard to say how old the comment is and, in isolation, it does not provide insight on the overall structure. We have git to see what changed when. And the code should be, in the best of all worlds ;-), always so clear and structured, that the concepts can be deduced

Don't leave commented code lying around, it is hard to say how old the comment is and, in isolation, it does not provide insight on the overall structure. We have git to see what changed when. And the code should be, in the best of all worlds ;-), always so clear and structured, that the concepts can be deduced
mslw (Migrated from github.com) reviewed 2022-07-25 14:17:12 +00:00
mslw (Migrated from github.com) commented 2022-07-25 14:17:12 +00:00

I'll go for a more explicit setAndUpdate to avoid collision with set keyword.

I'll go for a more explicit `setAndUpdate` to avoid collision with `set` keyword.
mslw commented 2022-07-25 14:30:48 +00:00 (Migrated from github.com)

Thanks for the review and the comments @christian-monch ! I made the suggested changes, and I'll merge.

Thanks for the review and the comments @christian-monch ! I made the suggested changes, and I'll merge.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sfb1451/z03-assessment-center-data-entry!30
No description provided.