Skip to content

Conversation

@gouri-panda
Copy link
Contributor

@gouri-panda gouri-panda commented Nov 7, 2020

Fixes #4005

What changes did you make and why?
Created a variable for storing if the user selected multiple images or not in UploadActivity then it will access by the fragment
and then it will set the text depends on the variable.

@gouri-panda
Copy link
Contributor Author

Ping @nicolas-raoul for review.

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Looks good, only minor changes to perform.

private Place place;
private List<UploadableFile> uploadableFiles = Collections.emptyList();
private int currentSelectedPosition = 0;
private boolean isMultipleItemSelected = false;
Copy link
Member

Choose a reason for hiding this comment

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

"Item" has a different meaning in our app. Please rename to isMultipleFilesSelected thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

.subscribe(filter -> searchForCategory(filter.toString()), Timber::e);
}
private void setTvSubTitle() {
Log.d("gouri", "setTvSubTitle: in uploadfragments");
Copy link
Member

Choose a reason for hiding this comment

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

Not needed I guess? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

D'oh! sorry I was debugging something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@gouri-panda
Copy link
Contributor Author

@nicolas-raoul Is there something wrong with PR?

@nicolas-raoul
Copy link
Member

@gouri-panda It looks great but I have been super busy and almost no time for this app reecently :'-(

Could anyone test this PR? Thanks a lot!

@gouri-panda
Copy link
Contributor Author

@nicolas-raoul No rush take your time.

@nicolas-raoul
Copy link
Member

@gouri-panda Very sorry for the delay, I now have time to review your PRs :-)
The change looks good, but would you mind rebasing on the latest master? Thanks!

@gouri-panda
Copy link
Contributor Author

@nicolas-raoul sure!

@gouri-panda
Copy link
Contributor Author

@nicolas-raoul @neslihanturan This PR is ready now.

@nicolas-raoul
Copy link
Member

I tried compiling but could not: MediaLicenseFragment.java:81: error: ';' expected

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Probably need to fix syntax?

@codecov-io
Copy link

codecov-io commented Feb 23, 2021

Codecov Report

Merging #4022 (355fe0a) into master (0ec6217) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4022      +/-   ##
============================================
- Coverage     10.41%   10.37%   -0.04%     
  Complexity      474      474              
============================================
  Files           343      342       -1     
  Lines         13063    13118      +55     
  Branches       1051     1067      +16     
============================================
+ Hits           1360     1361       +1     
- Misses        11635    11688      +53     
- Partials         68       69       +1     
Impacted Files Coverage Δ Complexity Δ
...ava/fr/free/nrw/commons/upload/UploadActivity.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ns/upload/categories/UploadCategoriesFragment.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ee/nrw/commons/upload/depicts/DepictsFragment.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...w/commons/upload/license/MediaLicenseFragment.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...mons/contributions/ContributionBoundaryCallback.kt 95.45% <0.00%> (-4.55%) 6.00% <0.00%> (ø%)
...earby/presenter/NearbyParentFragmentPresenter.java 58.52% <0.00%> (-1.02%) 36.00% <0.00%> (ø%)
...ava/fr/free/nrw/commons/utils/PermissionUtils.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...va/fr/free/nrw/commons/campaigns/CampaignView.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...va/fr/free/nrw/commons/nearby/model/ResultTuple.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...va/fr/free/nrw/commons/upload/UploadMediaDetail.kt 45.45% <0.00%> (ø) 3.00% <0.00%> (ø%)
... and 11 more

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 0ec6217...355fe0a. Read the comment docs.

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Tested with both a single picture and multiple pictures, it works as intended.
Thanks a lot!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Sorry a few minor things

private Place place;
private List<UploadableFile> uploadableFiles = Collections.emptyList();
private int currentSelectedPosition = 0;
private boolean isMultipleFilesSelected = false;
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I forgot! We need javadoc for each new method/member.
After that I will merge.

Copy link
Contributor Author

@gouri-panda gouri-panda Feb 25, 2021

Choose a reason for hiding this comment

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

@nicolas-raoul Should we add Javadoc here or in getter fields?

Copy link
Member

Choose a reason for hiding this comment

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

Both methods and members, actually. Sorry for the hassle, but documentation is usually written once, read many times, so it is a good investment :-)

Copy link
Member

Choose a reason for hiding this comment

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

Javadoc must use this format for members too:

/**
 * Example javadoc
 */

Thanks!

place = intent.getParcelableExtra(PLACE_OBJECT);
resetDirectPrefs();
}
public boolean getIsMultipleFilesSelected() {
Copy link
Member

Choose a reason for hiding this comment

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

javadoc

.observeOn(AndroidSchedulers.mainThread())
.subscribe(filter -> searchForCategory(filter.toString()), Timber::e);
}
private void setTvSubTitle() {
Copy link
Member

Choose a reason for hiding this comment

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

javadoc, and also one empty line before the method, to make it easier to see.

private Place place;
private List<UploadableFile> uploadableFiles = Collections.emptyList();
private int currentSelectedPosition = 0;
private boolean isMultipleFilesSelected = false;
Copy link
Member

Choose a reason for hiding this comment

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

Both methods and members, actually. Sorry for the hassle, but documentation is usually written once, read many times, so it is a good investment :-)

@gouri-panda
Copy link
Contributor Author

@nicolas-raoul Sorry for the delay. You can check now ;)

Copy link
Collaborator

@neslihanturan neslihanturan left a comment

Choose a reason for hiding this comment

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

Some minor fixes on comments :)

}

/**
* Sets the Tv Subtitle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @gouri-panda , since the purpose of the last review was adding javadocs could you please be more specific with javadocs instead of just writing the name of the method. Ie. this one could be something like:
"If multiple file is not selected, makes the visibility of subtitle text view gone."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @neslihanturan .From now on I'll keep this in my mind.

}

/**
* Sets the Depicts subtitle
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, could be more definitive. "Sets the Depict subtitle" is not actually what the method does. It decides the visibility of depics text view if multiplefile is not selecred as far as I can understand.

private Place place;
private List<UploadableFile> uploadableFiles = Collections.emptyList();
private int currentSelectedPosition = 0;
private boolean isMultipleFilesSelected = false;
Copy link
Member

Choose a reason for hiding this comment

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

Javadoc must use this format for members too:

/**
 * Example javadoc
 */

Thanks!

private List<UploadableFile> uploadableFiles = Collections.emptyList();
private int currentSelectedPosition = 0;
// Checks for if multiple files selected
/*
Copy link
Member

Choose a reason for hiding this comment

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

Needs one more star here and another on the next line :-)
Must look like this:

/**
 * Example javadoc
 */

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that!

@gouri-panda gouri-panda force-pushed the Remove_For_all_images_set_in_set_from_upload branch from 2589389 to 97dfe30 Compare March 10, 2021 05:40
@neslihanturan
Copy link
Collaborator

Hey, this changes looks okay to me to merge, for some reason tests are failing. Do you have any estimation @gouri-panda ?

@gouri-panda
Copy link
Contributor Author

@neslihanturan Thanks for reviewing files but I can't find build logs. Perhaps you can try with a new build tests. Thanks :)

@neslihanturan
Copy link
Collaborator

I can't see any point in this PR where Travis can fail. I can not see the build either. So merging this one for now to see if the build will fail or not. If so, we can always revert the commit.

@neslihanturan neslihanturan merged commit d0df2ff into commons-app:master Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"(For all images in set)" appears even when I am not uploading a set but rather a single image

4 participants