Page MenuHomePhabricator

Rethink the license, source and author fields in Upload view
Closed, ResolvedPublic


So, we have the license dropdown now at the uploader. However, this is still not in sync with sadly. Some issues I see:

  1. Selecting the license to own source still requires source and author
  2. UploadWizard lets you chose the license string when you own the object, for eg:

Screenshot 2020-07-17 at 11.38.18.png (385×1 px, 77 KB)

This might be a bit more tricky task, but lets iterate like this ?

  1. Make source and author not mandatory for starters. You can still throw an error from the backend when the license is not "my own work" and these fields are missing. We need to get T258247 in there first
  2. Make "Source and Author" only show up when you select one of those licenses that are not part of "My own work" at the front-end.
  3. Add an extra field to the serializer and collect the custom license string when you select "My own work"

Event Timeline

Won't it be better if we tackle with "my own work" at the frontend itself?
If the user selects "my own work", we can auto-fill the source to {{own}} and author to the username ({{user.username}}).
I think this will help us not to modify and backend logic and we can handle the validation on the frontend.
Thoughts? @01tonythomas

function ownWork(userSelection) {
      var isTrueSet = (userSelection.value == 'true');
      if (isTrueSet){
          document.getElementById("author"+id).value = "{{ user.username }]";
          document.getElementById("author-block"+id).style.display = "none";

          document.getElementById("source"+id).value = "{{own}}";
          document.getElementById("source-block"+id).style.display = "none";
      } else {

         document.getElementById("author"+id).value = "";
          document.getElementById("author-block"+id).style.display = "block";

          document.getElementById("source"+id).value = "";
          document.getElementById("source-block"+id).style.display = "block";

I have implemented this and it seems to work fine. Just need to clean up the code a little bit. Let me know if I should try the other approach?

Change 615589 had a related patch set uploaded (by Abbasidaniyal; owner: Abbasidaniyal):
[labs/tools/gdrive-to-commons@master] add: Input Validation and Release Rights Selection

Change 615589 merged by jenkins-bot:
[labs/tools/gdrive-to-commons@master] add: Input Validation and Release Rights Selection