-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make P18 edits to corresponding wikidata entity on uploading from Nearby #1495
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
Conversation
Hi @maskaravivek , thanks for the PR! I will test this ASAP, in the meantime could you please create a feature branch and send this PR to it instead of master, as we need to have logging done before this can be merged with master. Also, it would be great if we could get Javadocs for the new methods. :) |
@misaochan I have updated the PR with requested changes. :) |
Codecov Report
@@ Coverage Diff @@
## wikidataEdits #1495 +/- ##
================================================
- Coverage 3.13% 3.1% -0.03%
================================================
Files 136 138 +2
Lines 7412 7496 +84
Branches 716 721 +5
================================================
+ Hits 232 233 +1
- Misses 7165 7248 +83
Partials 15 15
Continue to review full report at Codecov.
|
* Integrate API for displaying featured images * Add pagination and refactor code so that it can be reused for category images * Add license info to the images * Fix author view * Remove unused values * Fix minor issues with featured images * Fix null license url issue * Remove some log lines * Fix back navigation issue * fix tests * fix test inits * Gracefully handling various error situations * Added java docs
* Update pull_request_template.md * Remove Javadocs mention * Added required/optional notes
…(redundant) server calls (commons-app#1496)
Team, before testing this PR I want to make sure that, even if while we are on betaDebug, if we upload a photo via nearby, then it will be uploaded to real servers. Am I correct? So to test this we might need to take a photo of nearby place:) |
I just built (in prodDebug flavor) from https://github.com/maskaravivek/apps-android-commons/tree/wikidata then ran, opened Nearby and tapped on the pin for https://www.wikidata.org/wiki/Q30297420 then pressed "Gallery" and selected a photo of the thing, then modified slightly the prefilled description and entered metadata as usual before tapping the floppy icon. Unfortunately, the Wikidata item does not seem to have got any edit: https://www.wikidata.org/w/index.php?title=Q30297420&action=history |
* Intent to map added * Merge conflicts resolved * Added the functionality to hide FAB incase of null coordinate * Merge Conflict resolved * Improve pr quality * Improve Quality * Added nested FAB animations * Nested FAB implemented * Improve Quality * Added up arrow * Javadocs Added
@neslihanturan The image will be uploaded to the beta server I believe, but the Wikidata edit will be real. Either way, we should use prodDebug for testing. Either by taking real photos of Nearby places, or by uploading a test photo and then deleting. We discussed how to delete Wikidata edits on #252 . :) |
* Add dependency for MaterialShowcase * Add actionview class to get a reference to material showcase * Create a NearbyMaterialShowcaseSequence class * Apply sequence steps * Add first three steps of nearby showcase * Add sequence id constants to make sure they will be displayed only once * Add last step of sequence to explain plus fab * Create an object to prevent customize all sequences every time * Fix typo * Code cleanup * Add strings to strings.xml * Code cleanup * Revert irrelevant change * Revert irrelevant change * Remove showcaseview for recenter button * Use single showcaseView instead of sequence * Add single showcase view insted of sequence to be able to edit text style * Make sure it will be displayed only once * Cleanup * Update strings * Change dismiss text style
@nicolas-raoul Am sorry, that the wiki data edit didn't work for you as expected. I will also add some more logs so that debugging error cases becomes easier. |
…pp#1453) * CONTRIBUTING: fix formatting of the gist of the guidelines First level headings for a gist seems to be overkill. So, replace first level headings with an ordered-list which sounds more meaningful. * CONTRIBUTING: specify clearly that 'blame' is a feature of "Git" The contributing file specifies about the ability to know who wrote something without the need of @author javadoc tags but incorrectly attributes the feature to GitHub. Correctly attribute the feature to where it belongs, Git, and specify the name of the feature to help users easily take advantage of it.
* Implemented butterknife in MediaDetailFragment [issue commons-app#1491] * Implemented butterknife in MediaDetailPagerFragment [[issue commons-app#1491]] * post merge upstream master wip [[issue commons-app#1491]]
Hi @maskaravivek , I experienced a few strange bugs while testing this. My steps:
It is also worth noting that I am still editing anonymously, was the central auth already implemented? P.S. Nice work with the Javadocs! It is way easier to read through and understand the code now. :) |
* Bug fix commons-app#1504 * Filtered messages with ConnectException [issue commons-app#1504] * A generalised message for exceptions in Nearby Activity [issue commons-app#1504]
@misaochan Thanks for helping with testing. :)
Have yet not figured out how to add authentication for these edits. :( |
commons-app#1498) * Fix security exception crash while accessing network location provider * Added java docs
@maskaravivek Are you able to upload at all after your recent changes? All of my uploads fail with the error logs below. Both Nearby direct uploads as well as the usual uploads from the main screen, with different images. I have logged out and logged back in again twice, with neither one fixing the issue. Also, I think you may need to rebase
|
I just clone Vivek's repo, switch to the "wikidataEdits" branch, switched to prodDebug, ran the app, touched Nearby, selected a nearby pin, touched the "+", select a picture, touched the upload button, and the floppy. |
@nicolas-raoul I don't think there is any "wikidataEdits" branch in Vivek's repo. :) Are you perchance testing the wikidataEdits branch of commons-app instead? That would explain why it isn't working for you, since this PR hasn't been merged into |
@misaochan Thanks, I cloned the right repo+branch now :-) |
@neslihanturan , we need you to test and see if either my or Nicolas's problems are reproducible. :) I think it should be fine to upload a bogus picture on prodDebug and then manually delete the p18 link on Wikidata (and if the picture doesn't belong on Commons at all, nominate your own picture for deletion and mention in the comments that you are testing). But if you are really concerned about it, you can use the sandbox entity mentioned at #252 . |
e6c71cd
to
b8e213e
Compare
@misaochan I am able to make authenticated edits now. https://www.wikidata.org/w/index.php?title=Q13406268&action=history Yes, I am also facing an issue while uploading/making edits if I install this build over a previously installed version but logging out and logging in again solves it for me. Could you share some logs that might help in detecting the issue? Anyone who is testing the PR can skip the whole upload flow and check just the edits if they wish. Paste this snippet in any of the activities and trigger it on its start. Might be helpful while we are debugging various issues.
|
@nicolas-raoul I have added logs that might help us identify why the edits are failing for you. Would it be possible for you to retry and share the logs? |
Hi @maskaravivek , I just retested this on my real device running Android 7.0. It works!!! Well done!! 👍 Uploading a picture added the P18 entity appropriately to https://www.wikidata.org/wiki/Q19876257 and https://www.wikidata.org/wiki/Q14935526 (I will delete those later). The Wikidata edits are also authenticated for me. Excellent work. A few minor issues:
|
@maskaravivek I'm happy to go ahead and merge this since @neslihanturan is experiencing issues with her VPN. If there are problems later we can solve them in a different PR. Please sort out the minor changes requested, then I can merge. :) |
|
Hmm, that has never happened for me, I always need to manually reload Nearby. But I guess we can merge this PR first and then debug this issue later since it isn't a major one. Have addressed the second point in Hangouts. :) |
@misaochan I have made the change suggested by you. Yes, let's merge this first and then we can debug this issue. |
Thanks @maskaravivek ! Can't wait to release this feature. :) |
Description
Fixes part of #252 ie. "Edit P18 property in Wikidata to add the uploaded image"
Tests performed
Tested on a real android phone by uploading an image from the list of nearby places needing pictures.
Note: After performing the test I have gone back to the entity and removed the image as I used a random image for testing.
Screenshots showing what changed
The GIF was too big so had to upload elsewhere: https://imgur.com/a/qCfFgv5