Giter Club home page Giter Club logo

tonythomas01 / gdrive-to-commons Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 10.0 8.8 MB

Tool to upload pictures from Google Drive to Wikimedia Commons ⚠️ Moved to Wikimedia Gerrit, so this repo is read only.

Home Page: https://gdrive-to-commons.toolforge.org/

License: Apache License 2.0

Python 2.49% HTML 5.63% JavaScript 67.65% CSS 24.14% Shell 0.08%
django django-rest-framework google-cloud google-drive javascript oauth pyenv pyenv-virtualenv toolforge wikimedia wikimedia-commons wikimedia-developers wikimedia-tools

gdrive-to-commons's People

Contributors

abbasidaniyal avatar dependabot[bot] avatar rishikabhatia17 avatar shcherbadev avatar sonegillis avatar srish avatar tonythomas01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gdrive-to-commons's Issues

Button 'I've read and accept the privacy policy' turns completely blue when clicked

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://tools.wmflabs.org/google-drive-photos-to-commons/ '
  2. Click on 'I've read and accept the privacy policy'
  3. The button turns completely blue

Expected behavior
The button should show a tick rather than turning completely blue

Screenshots
Screenshot from 2020-03-15 18-06-45

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser [firefox]
  • Version [73.0.1 (64 bit)]

Additional context
The button works fine on Chrome

Frontend code cleanup

In addition to #9, do some more frontend code cleanup. Run HTML, JS, CSS files through relevant linters and fix corresponding issues.

Create setup guide for windows users

Is your feature request related to a problem? Please describe.
The project setup guide was created without consideration for non-linux users. while it might be easy for experienced contributors to pick up, newbies will find it harder to understand what is going on as the commands won't be working on their system and this can potentially scare them away

Describe the solution you'd like

  • create setup guide for windows users
  • rename the existing setup guide to indicate that it is only for Linux based systems

Describe alternatives you've considered
An alternative would be to combine both windows and Linux setup guides into a single file. It all depends on the most desired approach, the most important thing is windows users seeing what they could be looking at while setting up their local environment for the project

Images are not being uploaded to creative commons from google drive

To Reproduce
Steps to reproduce the behavior:
Login to Wikimedia commons with meta account
Login to google drive with google account
Select images to be uploaded from google drive
Select the "Upload to Wikimedia commons" action button

Actual Results:
After clicking on the "Upload to Wikimedia commons" button, the button gets a bit transparent but there is no action taken, that is, the images are not being uploaded to commons and also if we again click on that button it gets back to it's original state and there is no uploading happening. Hence when we click the upload button, the graphic of button is only hanged but there is nothing else happening.
image (3) (1)

Expected Results:
After clicking in the "Upload to Wikimedia commons" button, the upload should start and images should be uploaded to Wikimedia commons from google drive.

Testing done on Windows 10, Ubuntu 18.04, mac OS and Android 10(Google chrome Mobile browser)

Token error: Missing unauthorized token

While on my dev setup, I am getting "AuthTokenError at /oauth/complete/mediawiki/", precisely a missing unauthorized token error.
@tonythomas01 Is it because we are using a different MediaWiki OAuth consumer and I have some old credentials?

Document the use of Prettier in the project

git commit generated the following output for me without indicating which files are problematic and any hints for fixing the errors in them. Took some time to realize, that I've been happily ignoring the keyword "Failed" in the log and the fact that the git commit is failing.

Srish:gdrive_to_commons srish$ git commit -m "improved the main screen design"
black................................................(no files to check)Skipped
prettier.................................................................Failed
hookid: prettier

Files were modified by this hook. Additional output:

assets/css/style.css 106ms
uploader/templates/home.html 302ms

It would be useful to document the steps for using Prettier (https://prettier.io/) before pushing changes, perhaps in the README for now, but in the contribution guidelines in the future. I imagine, the steps would be:

  • npm install prettier # Install Prettier
  • prettier --check "*.html" #Run Prettier through all HTML files
  • Fix errors...

Post upload, show a better screen listing uploaded files

Right now, we have this one:
Screenshot 2020-04-04 at 11 04 08

can we change it a bit like this:

  1. Make the second column bigger, and maybe just have 2 columns there and make the name a link which opens in a new page ? Like that, we can totally avoid the 3rd column.
  2. Lets see if we can take out a link to the file instead ? for eg, https://test.wikipedia.org/wiki/File:Tail_latency_comparison_between_DS,_OS_and_FS_at_varying_latency_sleep_bxp-1515415386.png and not the upload file iteslf ?

Improve the accessibility of this tool

Is your feature request related to a problem? Please describe.
Running lighthouse audit pointed out that this tool has an accessibility rating of 74%.
that should not be so given uncomplicated this tool's dom is.

gdrive_to_commons_accessibility_failing

Describe the solution you'd like
Increase the accessibility audit rating to 100% or something close.
This will make things easy for people who temporarily or permanently finds it hard to access this tool because of some disabilities

Compress images before upload

Description

Caring about file size on internet pages it might be a good idea to compress images lossless when uploading them to Wikimedia Commons. As described on this Google site: https://web.dev/use-imagemin-to-compress-images it is fine to compress images losslessly.

Current State

Images are not uploaded compressed.

Expected State

Images should be uploaded compressed. This can be achieved with imagemin (https://github.com/imagemin/) for example. I do not know if there is a Python solution/wrapper which could be applied here.

The process would be:

  1. Selection of files
  2. Retrieve files from Google Drive
  3. Compressing of images
  4. Upload to Wikimedia Commons

Fix file thumbnails on the review screen

Currently, for all file thumbnails, we are using iconUrl returned in the Google API callback for all files. But, this is not the actual file thumbnail and URL to a default icon which is the same for all files.

After login, files are listed in a random order

The google drive to commons uploader tool has been tested thoroughly on several operating systems (Windows 10, Ubuntu 18.04 and mac OS and Android 10 (Mobile web browser))
After we sign in with our google account and when we need to select the images, files are being shown randomly and the original google drive user interface (I mean the UI which we see when we originally use google drive) is not being shown. This increases the difficulty of choosing a particular image which the user might have stored in a particular folder according to himself.

Here is the screenshot where we can only see random images(files only) only and no folders are shown.
image

Support editing of media files in Step 3

After the files have been selected from Google Drive in Step 2, we currently show them for review in Step 3. We display a thumbnail, file name, description, and edit buttons next to each file information. The edit buttons are currently not functional. It would be a nice addition to support editing of file titles and description before uploading them to Wikimedia Commons.

Button "choose photos from google drive" not working

To Reproduce
Steps to reproduce the behavior:

  1. Login to Wikimedia commons with meta account
  2. Select the "CHOOSE PHOTOS FROM GOOGLE DRIVE" action button

Actual behavior
After clicking on the "CHOOSE PHOTOS FROM GOOGLE DRIVE" button, there is no action taken, that is, it is stuck. After click on this multiple times also it is not showing any response.

Expected behavior
After clicking on the "CHOOSE PHOTOS FROM GOOGLE DRIVE" button, it should show us the photos from our google drive and should let us select the photos.

Screenshots
gdrive-to-commons

Desktop:

  • OS: Ubuntu 18.04.3 LTS
  • Browser: Firefox
  • Version: 70.0.1 (64-bit)

Not able to select multiple images

On Windows 10, Ubuntu 18.04, mac OS (Desktop Web Browsers)
The user is not able to select multiple images from google drive according to their wish. The only way to select multiple files is using the selection tool with cursor but in this way the user can select only consecutive images and they can't select random images.
image (1) (1)
On Android 10 (Mobile browser)
The user is not able to select multiple images from google drive according to their wish. They can't even select consecutive multiple files because there is no selection tool available in mobiles. Hence, the user can upload only one photo at a time.
Screenshot_20200311-041106
Users who want to upload 2 or more than 2 pictures may not like the way of uploading only one picture at a time and most probably won't like to repeat the whole process for uploading all the pictures.

See: https://phabricator.wikimedia.org/T247367

Inform the users that they can edit the details of the image and addition of details

After the user selects the pictures, they can view the list of images they have selected along with their title, description and option to unselect.
But if a normal user uses this tool, it is difficult for them to find out that they can edit the title and add the description and this might be a disadvantage for the user and the feature is not being utilised by the user.
image (2)
Also as mentioned already,
More metadata fields can be added to the image. The important metadata for a image might be:
Date image is created
Categories
Captions
License
Image type
Width and height of the image
Hashtags for the image etc.

The expected solution for the above mentioned issue is:
The user should be informed that they can edit the details of the image by giving user interface instructions and the important metadata fields can also be added.

Phab link: https://phabricator.wikimedia.org/T247369

Make the tool more responsive and mobile friendly

I tried using this tool on a mobile device and I noticed that the fonts are way too small that I basically had to pinch and zoom to be able to read the words.

I think it is important to make it mobile friendly

Upload from Google drive to wikimedia stuck at 75%

I tried using this tool on my mobile phone as well as on my laptop and in both cases, it doesn't move beyond 75%. Maybe this has something to do with my account but I would love it if someone can confirm.

To Reproduce
Steps to reproduce the behavior:

  1. Open up the tool on either your mobile phone or laptop and try uploading from Google drive to wikimedia

Expected behavior
The upload should complete successfully but it isn't

Image
gdrive_to_wikimediacommons_test_drive

Desktop (please complete the following information):

  • OS: Windows 7 (×86)
  • Browser Chrome
  • Version 80

Smartphone (please complete the following information):

  • Device: Gionee M7 power
  • OS: Android 7.1.1
  • Browser Chrome
  • Version 79

Create documentation to configure app to upload to a local test wiki

We should've done this earlier, but now that we are uploading a lot of things outside (say to test and commons), I would suggest we have this setup. One would argue:

  1. Setup a locally running medaiwiki instance with file upload capabilities. Lets use vagrant as it is easy to setup.
  2. Enable roles OAuth maybe ? Register a consumer in this dev wiki to point to your localhost:8000 so your local gdrive app can authenticate.
  3. Try uploading, and see that the file got uploaded to dev-wiki.

Would be easy to test, and quite good if we can have this documented. Thank you!

Show a loading spinner when uploading images

Problem
I'm always confused on what is happening when I click on the button "Upload to Wikimedia Common" because button is disabled and I don't see any indication that a request is actually processing

Solution
While the request to upload is being processed, display a loading spinner on the disabled button to show the user that the server is actually processing a request

Build a functional stats counter for uploads

We are storing information about the number of files uploaded by the app. it would be a nice thingy to show a counter or something like that on the home page ?

  1. Track the counts at the backend in a table.
  2. Show them up on the homepage.

POST via Ajax to uploads API fileLists

I expect something like



{
  "fileList": [
    {
      "id": "fasdfasdfa",
      "name": "file_name"
    },
    {
      "id": "fasdfasdfa",
      "name": "file_name"
    }
  ]
  "token": "1231fasdfasdf"
}

on http://localhost:8000/uploads/

You can get the fielList from data.docs (index.html:74) right now.
token is oauthToken. Just use HTTP POST and we should be good

Handle errors during upload process and show user friendly messages with modal

Description
When the user tries uploading pictures to wikimedia commons and an error occurs, nothing is shown to the user. An example of an error I experience was mwclient.errors.APIError: ('fileexists-no-change', 'The upload is an exact duplicate of the current version of [[:File:Registrar.jpg]].', 'See https://test.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.')

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://tools.wmflabs.org/google-drive-photos-to-commons/
  2. Accept privacy policy and click on the button "Start uploading"
  3. Login to wikimedia commons
  4. Click on button "Choose photos from Google Drive"
  5. Select a particular photo from your PC and upload
  6. Click on button "Upload More" and select the same photo as selected in step 5, then upload

Expected behavior
The user receives a well structured message telling him/her what the error is (in this case for example "You already uploaded file to wikimedia commons").

Actual behavior
No feedback. The user has no idea about the error

Desktop

  • OS: Windows 10
  • Browser: Mozilla firefox
  • Version: 74.0

Tool is not working in internet explorer

The bug
The tool is not working in internet explorer as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://tools.wmflabs.org/google-drive-photos-to-commons/
  2. Accept privacy policy and click on the button "Start Uploading"

Expected behavior
The user should be redirected to the "Login to Wikimedia Commons" button page

Actual Behavior
The user is being redirected to an abnormal user interface where three buttons are being displayed at same time as shown below.

image

Desktop:

  • OS: Windows 10
  • Internet Explorer
  • Version 11.657.18362.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.