Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Hide textbox for resume link if resume file is uploaded in sign up form #625

Closed

Conversation

anjali-dhanuka
Copy link
Contributor

@anjali-dhanuka anjali-dhanuka commented Feb 16, 2018

Description

The textbox for resume link hides if volunteer uploads a resume file.

Fixes #624

Type of Change:

  • Code

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

screenshot from 2018-02-16 12-04-23

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@anjali-dhanuka
Copy link
Contributor Author

@tonythomas01 @tapasweni-pathak Please review.

@coveralls
Copy link

coveralls commented Feb 16, 2018

Coverage Status

Coverage remained the same at 42.435% when pulling d09ec6a on anjali-dhanuka:hide_resume into 39285b6 on systers:develop.

@anjali-dhanuka
Copy link
Contributor Author

@tapasweni-pathak @tonythomas01 Rectified the operator Please review.

@anitab-org anitab-org deleted a comment Feb 17, 2018
@@ -0,0 +1,9 @@
$(document).ready(function() {
$("input[type='file']").change(function() {
var FileLength = $("#id_vol-resume_file")[0].files.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable names in JS follows camelCase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I wouldnt name it hide_resume as its actually hide_resume_textbox - minor though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tonythomas01 Done with the changes you suggested. Can you please review.

$(document).ready(function() {
$("input[type='file']").change(function() {
var FileLength = $("#id_vol-resume_file")[0].files.length;
if (FileLength!==0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes toggle is better to use, implemented this too. Have a look.

@anjali-dhanuka
Copy link
Contributor Author

@tapasweni-pathak @tonythomas01 @prachi1210 Done with the changes.
Please review.

@abarya
Copy link
Contributor

abarya commented Mar 2, 2018

Hi @anjali-dhanuka, I was reviewing your PR. You worked really well. But, I think there is a bug that needs some fix. Here it is.
When I uploaded a file for the first time, then the webpage looks like this:

image

Then, I decide to upload a newer resume instead of this one. Now see, what happens:

image

@anjali-dhanuka, Please fix this.

@tonythomas01, Can you confirm this behaviour?

@anjali-dhanuka
Copy link
Contributor Author

@abhishekarya286 Yes I see that. I'll fix that.

@abarya
Copy link
Contributor

abarya commented Mar 11, 2018

Hi @anjali-dhanuka, Any updates?

@anjali-dhanuka
Copy link
Contributor Author

Sorry for the late response! Got busy in some other work. Will do it shortly.

@anjali-dhanuka
Copy link
Contributor Author

@abhishekarya286 @m-murad @tonythomas01 @ramitsahwney27 Sorry for the delay, I have solved the issue. Please review.

@abarya
Copy link
Contributor

abarya commented Apr 10, 2018

LGTM. Thanks for your contribution. @prachi1210 please merge this.

@ayushgarg1804
Copy link

ayushgarg1804 commented Apr 25, 2018

Please add corresponding tests.

@kamsuri
Copy link
Contributor

kamsuri commented May 12, 2018

Submitted code is working absolutely fine but the coverage is decreased, @anjali-dhanuka please look into it, write corresponding tests.

@anjali-dhanuka
Copy link
Contributor Author

@kamsuri The tests have been commented out currently, @Monal5031 needs to work on them before I can write new tests.

@Monal5031
Copy link
Contributor

@anjali-dhanuka Please check if the PRs need selenium integrated or not. If not needed i.e. they can be tested without selenium please try to do so.

@kamsuri
Copy link
Contributor

kamsuri commented May 13, 2018

Also, please squash the commits.

js file created

name of js file corrected

operator corrected

changes done

filename changed

filename url changed

reload issue solved

changes implemented

alert removed
@anjali-dhanuka
Copy link
Contributor Author

@kamsuri Done with the squashing. Please review

Copy link
Contributor

@kamsuri kamsuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is correct but as it was decided in last meeting that we won't be merging PRs wihtout tests.

@anjali-dhanuka
Copy link
Contributor Author

@Monal5031 Can u please guide me how to check that.

@Monal5031
Copy link
Contributor

@anjali-dhanuka Check if your enhancements require the verification of content of the rendered template or just loading the page headers and status codes(200,404,403) would suffice.
You will have to use selenium for first part and later can be done via unit testing.

@anjali-dhanuka
Copy link
Contributor Author

@Monal5031 It needs to check the content.

@Monal5031
Copy link
Contributor

Okay no problem, 2nd PR is in review after which you'll be able to add tests. 🎉

@@ -374,7 +374,7 @@ <h2>{% trans "Sign Up" %}</h2>
</div>
</div>
{% endif %}
<div id="div_id_resume_file" class="form-group">
<div id="div_id_resume_file" class="form-group" onchange="hide_resume_textbox()">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

js functions, please no underscores. better hideResumeTextBox() ?

if (fileLength!==0){
$("#div_id_resume").hide();}
else
{$("div_id_resume").show();}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.toggle() please.

@@ -24,6 +24,7 @@
<script src="{% static "vms/jquery-ui-1.11.4.custom/jquery-ui.min.js" %}"></script>
<script src="{% static "vms/jquery-custom/activate-datepicker.js" %}"></script>
<script src="{% static "vms/datetimepicker/bootstrap-datetimepicker.min.js" %}"></script>
<script src="{% static "vms/js/hide_resume_textbox.js" %}"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hide-reseume-textbox.js

@mayburgos mayburgos added the Program: GSOC Related to work completed during the Google Summer of Code Program. label Jul 10, 2018
@mayburgos mayburgos added Program: GSOC Related to work completed during the Google Summer of Code Program. and removed Program: GSOC Related to work completed during the Google Summer of Code Program. labels Jul 16, 2018
@mayburgos
Copy link
Contributor

@anjali-dhanuka is sending a new PR to gsoc18-code branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide textbox for resume link if resume file is uploaded in sign up form
9 participants