Cloud-CV / EvalAI-ngx

Revamped codebase of EvalAI Frontend
BSD 3-Clause "New" or "Revised" License
33 stars 61 forks source link

Adresses #211: Reset form after submitting #238

Closed drepram closed 4 years ago

drepram commented 4 years ago

I don't know, I guess in a way this PR addresses #211? What do I put here LoL @pushkalkatara

Changes proposed in this pull request:

codecov-io commented 4 years ago

Codecov Report

Merging #238 into master will decrease coverage by 0.07%. The diff coverage is 14.28%.

@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
- Coverage   51.73%   51.66%   -0.08%     
==========================================
  Files          66       66              
  Lines        3659     3666       +7     
  Branches      413      414       +1     
==========================================
+ Hits         1893     1894       +1     
- Misses       1671     1677       +6     
  Partials       95       95
Impacted Files Coverage Δ
...ponents/publiclists/teamlist/teamlist.component.ts 36.97% <14.28%> (-0.86%) :arrow_down:
Impacted Files Coverage Δ
...ponents/publiclists/teamlist/teamlist.component.ts 36.97% <14.28%> (-0.86%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b03bdc4...c032a3c. Read the comment docs.

Sanji515 commented 4 years ago

@drepram After hitting Create Team button, team gets created but also it shows message Team is required. Can you please check this?

Sanji515 commented 4 years ago

Also @drepram After resetting the form it should also focus-out of the input.

drepram commented 4 years ago

I've managed to figure out how to bypass the form's validity.

The logic in the Team Name Required label is valid, we just need to figure out how to make the valueless input becomes valid. The solution that I've come to is that we should create a temporary value, in this case, a space character (" ").

When the input is clicked, there will be a ternary operator that would reset the input to no value ("") if it's only value is a space character (" "). If the value is not a space character, the input's value will stick to that value and would not reset it.

And on my machine, the input focuses out when I submit them. I can't reproduce the issue that you've stated to me, Hence, I declare it fixed.

Feedbacks are wanted.

PS: Can anyone approve https://github.com/Cloud-CV/CloudCV/pull/116/files? It's been 3 days and no one has left a single comment on it.

Sanji515 commented 4 years ago

When the input is clicked, there will be a ternary operator that would reset the input to no value ("") if it's only value is a space character (" "). If the value is not a space character, the input's value will stick to that value and would not reset it.

This looks hacky, can you please think of some other solution? You can remove the current team name required validation and can add a new one when the Create Team function gets called from the typescript.

And on my machine, the input focuses out when I submit them. I can't reproduce the issue that you've stated to me

Please look closely, when you submit then placeholder team name remains smaller on some height. Hint: https://github.com/Cloud-CV/EvalAI-ngx/blob/master/src/app/components/publiclists/teamlist/teamlist.component.ts#L21 Please take a look at these (^).

drepram commented 4 years ago

I have done the following things:

Please take a look, feedbacks are requested.

drepram commented 4 years ago

I've change the validation message and changed back isTeamNameRequired to false when form has been submitted successfully. Please take a look.

drepram commented 4 years ago

Ah okay, I just hope it wouldn't take long for someone to merge this so I can work on another task. Cheers!

drepram commented 4 years ago

Oh, and don't forget to approve the task on Google Code-in!

RishabhJain2018 commented 4 years ago

LGTM :) Thanks @drepram and @Sanji515 🎉