Skip to content
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

Send thanks button in more details fragment #5424

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

srishti-R
Copy link
Contributor

Description (required)

Fixes #5421

What changes did you make and why?
Send thank button will appear only when the image is not uploaded by author.
Screenshot_20240108-203814_Commons
Screenshot_20240108-203825_Commons
Screenshot_20240108-203826_Commons
Screenshot_20240108-203859_Commons

Tests performed (required)

Tested prodDebug on Samsung galaxy M31 with API level 31.

Screenshots (for UI changes only)

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

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.

Working great!
I checked all places I could think of where images are visible, then checked that the thanks were correctly sent (at https://commons.wikimedia.org/wiki/Special:Log?type=thanks&user=Syced&page=&wpdate=&tagfilter=&wpFormIdentifier=logeventslist)

@@ -431,6 +447,12 @@ public void onResume() {
enableProgressBar();
}

if (AccountUtil.getUserName(getContext()) != null && media != null && AccountUtil.getUserName(getContext()).equals(media.getAuthor())) {
Copy link
Member

Choose a reason for hiding this comment

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

How about splitting this very long line?

@@ -784,6 +784,8 @@ Upload your first media by tapping on the add button.</string>
<string name="storage_permissions_denied">Storage Permissions Denied</string>
<string name="unable_to_share_upload_item">Unable to share this item</string>
<string name="permissions_are_required_for_functionality">Permissions are required for functionality</string>
<string name="send_thanks_to_author">Send thanks to author</string>
Copy link
Member

Choose a reason for hiding this comment

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

How about a shorter "Thank the author"?

@nicolas-raoul
Copy link
Member

In order to fix the unit tests, would you mind rebasing (or pulling) from main? Thanks :-)

@srishti-R
Copy link
Contributor Author

@nicolas-raoul made the changes, sorry for the delay

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 for the delay, it somehow escaped my attention.

It works great and the code looks good. Thanks a lot! :-)

@nicolas-raoul nicolas-raoul merged commit 495d001 into commons-app:main Jan 23, 2024
1 check passed
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.

Button to thank the uploader, in Media Details
2 participants