-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Tag on task using Enter #389
Conversation
…o the selected tags when user presses enter
hey @nelsonic, I notice that the Github Checks didn't pass, is there something on my end that I need to fix? |
Hey @panoramix360 . |
thanks @LuchoTurtle! Done! |
@nelsonic we're getting an error with the deploy review app script. https://github.com/dwyl/mvp/actions/runs/5488807164/jobs/10002305167
Have you stumbled upon this error before? |
We need to set |
@LuchoTurtle, is this something that I should do on the PR? |
@panoramix360 the issue is on our end, so please just give us some time so get it sorted and we'll get right back to ya with this PR and get it merged :). Meanwhile, we're getting this warning with the function you've added.
I'll create a review and request a small change from you :) |
@panoramix360 I think the CI doesn't run because you created a fork instead of a branch. 💭 |
I checked out @panoramix360 branch: git clone [email protected]:panoramix360/mvp.git && cd mvp
git checkout 'feature/add-task-with-tag-when-enter'
cp ../.env .
source .env
mix deps.get
mix c Got: Finished in 1.2 seconds (1.1s async, 0.1s sync)
118 tests, 0 failures
Randomized with seed 640070
----------------
COV FILE LINES RELEVANT MISSED
100.0% lib/api/item.ex 218 56 0
100.0% lib/api/tag.ex 101 24 0
100.0% lib/api/timer.ex 152 40 0
100.0% lib/app/color.ex 90 1 0
100.0% lib/app/item.ex 377 53 0
100.0% lib/app/item_tag.ex 12 1 0
100.0% lib/app/tag.ex 108 18 0
100.0% lib/app/timer.ex 481 90 0
100.0% lib/app_web/controllers/auth_controller. 26 4 0
100.0% lib/app_web/controllers/init_controller. 41 6 0
100.0% lib/app_web/controllers/tag_controller.e 77 25 0
94.6% lib/app_web/live/app_live.ex 441 130 7
100.0% lib/app_web/live/stats_live.ex 77 21 0
100.0% lib/app_web/router.ex 49 9 0
100.0% lib/app_web/views/error_view.ex 59 12 0
0.0% lib/app_web/views/profile_view.ex 3 0 0
0.0% lib/app_web/views/tag_view.ex 3 0 0
[TOTAL] 98.6%
----------------
Generating report... i.e. test coverage decreased by 1.4% due to the new code. Reviewing the Sadly, CI doesn't pass because @panoramix360 created a fork. The only way we can make the CI pass is to make the |
The CI error is in the Build and Test phase: https://github.com/dwyl/mvp/actions/runs/5514171282/jobs/10060694853?pr=389#step:8:66 This is because |
To write a test for this new functionality we need to emit a |
As for the failing Review App Job: https://github.com/dwyl/mvp/actions/runs/5488807164/jobs/10002305167#step:5:20 This is exactly the same issue described above, Once this is merged into |
Sadly, we still have the regression that we cannot add tags dynamically as outlined in: #221 (comment) But if I manually add a couple of tags on my And then test the feature that @panoramix360 is proposing: I cannot get the desired behaviour described by @iteles in #308 (comment) 💭 |
@iteles could you please help us with the requirements so that we can review this PR ASAP. 🙏 |
@panoramix360 meanwhile if you can add a test for the Enter keypress event I will |
hey! Thank you for inviting me to the repo, if you prefer I can create the branch on the repo and delete the fork, but as you mentioned, it's good to have that fixed for future contributions. I can create the tests, no problem, sorry for not creating it earlier, I didn't see that the project had tests. Regarding the behavior, what happened when you pressed enter? It didn't work? |
hey @nelsonic! do you have any tips on how to test it? I'm new to Phoenix LiveView and I'm thinking of using this one to test it: If you have any ideas or directions to it, it'd be helpful! |
EDIT: It's tested now, scroll through the next comment I'm trying to do something like that:
This is my code:
(Ignore the IO.inspect, is just for checking) It seems that the I believe I'm missing something |
UPDATE: I managed to test it right now :D @nelsonic review it when you can! thank you for your link, it was helpful! The test coverage is now 99.8%, feel free to let me know to add more things if needed. |
Hey @panoramix360 Awesome job on proactively working on this, it's mighty appreciated! I've pulled the remote from your forked repo and ran your branch locally and it seems to work as you've described. Screen.Recording.2023-07-12.at.17.07.13.movI've seen you've mentioned it only toggles the tag on top of the list. Although it would make more sense to get the first tag not selected, I'm aware that you've tried to make it simple. When I run the tests
Thanks for getting the test coverage back to 100%. I'm glad you've worked more on them (saw your latest commits), the assertions make more sense now and actually test if the tag is selected. I'm going to make a small comment on the review shortly :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I'll let @nelsonic have a final say.
Thanks for the PR 😄
No worries! I'll look through the next issue to complete, if you have any suggestions let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@panoramix360 great contribution. 🎉
Thanks for adding the tests. ✅
Confirmed on localhost
:
git pull
mix c
Finished in 1.3 seconds (1.2s async, 0.08s sync)
121 tests, 0 failures
Randomized with seed 811468
----------------
COV FILE LINES RELEVANT MISSED
100.0% lib/api/item.ex 218 56 0
100.0% lib/api/tag.ex 101 24 0
100.0% lib/api/timer.ex 152 40 0
100.0% lib/app/color.ex 90 1 0
100.0% lib/app/item.ex 377 53 0
100.0% lib/app/item_tag.ex 12 1 0
100.0% lib/app/tag.ex 108 18 0
100.0% lib/app/timer.ex 481 90 0
100.0% lib/app_web/controllers/auth_controller. 26 4 0
100.0% lib/app_web/controllers/init_controller. 41 6 0
100.0% lib/app_web/controllers/tag_controller.e 77 25 0
100.0% lib/app_web/live/app_live.ex 441 130 0
100.0% lib/app_web/live/stats_live.ex 77 21 0
100.0% lib/app_web/router.ex 49 9 0
100.0% lib/app_web/views/error_view.ex 59 12 0
0.0% lib/app_web/views/profile_view.ex 3 0 0
0.0% lib/app_web/views/tag_view.ex 3 0 0
[TOTAL] 100.0%
----------------
Generating report...
Saved to: cover/
mix s
@LuchoTurtle thanks for reviewing + trouble-shooting. ❤️
This PR adds the functionality to select Tags when the user presses Enter while searching for tags.
It will always pick the first tag that appears on the list, if there are no tags, nothing will be added.
The behavior is detailed on the issue.
I tried to make it simple.
Please, let me know if you guys think it's needed any changes.
I didn't like the way I managed to empty the field after the user press Enter but I tried using LiveView <.input> with no success, if you guys have any other ideas let me know, I'd love to learn since I'm new to Phoenix/LiveView.
:D