Add tests and improve new tasks typing#582
Open
correct-horse-battery-bench wants to merge 6 commits intohashtopolis:masterfrom
Open
Add tests and improve new tasks typing#582correct-horse-battery-bench wants to merge 6 commits intohashtopolis:masterfrom
correct-horse-battery-bench wants to merge 6 commits intohashtopolis:masterfrom
Conversation
…tValueFrom for route params as this is done for data as well anyways
ef4c6c9 to
5961e77
Compare
|
|
||
| @if (!isLoading) { | ||
| <div fxLayout="column" fxLayoutAlign="start start"> | ||
| @if ((copyMode && isCopyHashlistId) || (!copyMode && !isCopyHashlistId)) { |
There was a problem hiding this comment.
Riskiest change of the pr and worth to have a look at.
When copying a pretask the value '9999' was used as placeholder there so that the input-multiselect is still shown when copying a pretask which is semantically incorrect as pre tasks do not seem to have an assigned hashlist.
Generally:
If new task -> always show this (!copyMode)
If we copy a pretask/task we still want to show this input as all tasks seem to need one
The !isCopyHashlistId seems to just check if we load a task that the hashlistId of it seems to be loaded (as default null). But the form is patched anyways so it seems to me that this check is not needed anymore...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During manual testing and writing tests I noticed a few dead code paths and typing improvements which allowed to remove / simplify some redundant code. Regarding typing, some things here I think are essential and some changes are opiniated. Happy to discuss with whoever reviews this pr.
Main Changes:
form.controls.<name>instead ofform.getin order to have stricter typingwhichViewandcopyType,isCopyHashlistdead variables not used anymore in any code path,whichViewpreviously was 'create' or 'edit' but there seems to exist now an edit-task page dedicated for that. Type thekindpassed by the router as datatakeUntilDestroyedinstead of UnsubscriptionServicefirstValueFromandawaitif possible