EDAssets icon indicating copy to clipboard operation
EDAssets copied to clipboard

Add/Edit Assets Feature

Open Venefilyn opened this issue 7 years ago • 3 comments

We want to make it easier for people to add new assets. Having an add/edit assets feature that either generates the JSON and asset formats to download and add onto the repository, or directly accessing GitHub API through OAuth2 to create a PR with generated data.

  1. Navigate to add/edit assets feature
  2. Select new asset button or dropdown of all assets within a selected category
  3. Display all items in a category as a list on left side, click to select an item to be edited that will be display on right side
  4. Right component has fields for title, description, image/asset upload field, checkbox for fan-made (pre-checked by default)
  5. There should be two buttons displayed, "Push to GitHub" and "Download feature"

The Download Feature should generate a zip with the edited or added assets in the right categories as well as adding it to the types.json to be discoverable by EDAssets. This way you can drop it into repo and commit right away.

Venefilyn avatar Aug 07 '18 11:08 Venefilyn

This would be possible using a Node GitHub APIv3 client as a non-web application. pksunkara/octonode exists which should work just fine with managing everything.

There is only one workflow we can utilize to make this happen:

  1. Request the user's username and password
  2. Request authorization with GitHub
  3. If user has TOTP GitHub will respond with missing OTP
  4. Request a user's TOTP key
  5. Create an application key and store it and the username in localStorage
  6. Use the application key and username to be RESTful with managing forks, commits, and branches

If anything seems off feel free to look into it. This is just what I've gathered from a quick glance

Venefilyn avatar Feb 13 '19 13:02 Venefilyn

Github's current API is at V4. And seemingly it is very different from V3. I will look into this in the upcoming days.

SayakMukhopadhyay avatar Feb 13 '19 14:02 SayakMukhopadhyay

V4 is using GraphQL instead of a REST API. Vastly different and more difficult to work with for our project. Though there is no indication that V3 will disappear anytime soon and they are maintaining both V3 and V4.

I would presume that V3 will persist for many years to come due to the infancy of GraphQL

Venefilyn avatar Feb 13 '19 15:02 Venefilyn