on3iro / aeons-end-randomizer

🧙🏻‍♀️Awesome Companion App for Aeons End: https://aeons-end-randomizer.de 🧙🏽‍♂️
MIT License
43 stars 25 forks source link

Expedition Import won't allow 'ANY' as valid supply tile type #366

Closed Quicksav closed 4 years ago

Quicksav commented 4 years ago

Describe the bug When importing an expedition, if the expedition has a supply tile with the type 'ANY' the importer throws an error. The code to handle the 'ANY' case is already in place, the validation message just needs to be removed so that the import can succeed.

Screenshots image

on3iro commented 4 years ago

@Quicksav thanks for the bug report. There might be an issue with the json-schema. It might be enough to simply rebuild the schema (src/components/pages/Expeditions/CreationDialog/ConfigImport/expeditionJsonSchema.ts)

I am not quite sure I understand your proposed solution. What do you mean by

the validation message just needs to be removed ?

Edit: Just had a quick glance over the schema. It indeed looks like Any is missing from the cardtype

To fix this, changing the following should work:

From

    CardType: {
      enum: ['EMPTY', 'Gem', 'Relic', 'Spell'],
      type: 'string',
    },

to this

    CardType: {
      enum: ['EMPTY', 'Gem', 'Relic', 'Spell', 'ANY'],
      type: 'string',
    },
Quicksav commented 4 years ago

That was what I had meant, just explained it rather poorly. The schema was causing the validation error to be thrown, fixing the schema = removing the validation error (sorta). The above fix is exactly the one I used to get it working locally.

If possible I'd like to try to create a pull request for this. I know its a simple issue that you could fix locally very easily but I'm trying to get used to working with Git still. From what I understand I want to create a local branch for the bug, then push it to the remote, then create a pull request for the branch I created into dev. Is that understanding correct?

on3iro commented 4 years ago

Awesome :)

Regarding the pull request:

  1. You need to fork the repository on github (so you basically have your own version). This is necessary, because you are not a direct contributor listed in this repository (totally normal - usually only main contributors and maintainers have direct access to a repository)
  2. Now you check out your fork locally
  3. Create a feature branch (locally)
  4. Make your fix
  5. Commit
  6. Push your feature branch to your remote (which is the fork)
  7. Create a pull request:
    • iirc github will ask you, if you would like to create the PR agains the real repository instead of your fork -> do that and target our dev branch
    • that should do the trick
    • (haven't done a fork PR in a while - so these are just the steps out of my head ;) )
on3iro commented 4 years ago

@Quicksav FYI: I just recently merged another feature which causes an additional error. However to actually properly fix this, I need to update our aer-types package and re-create the whole schema. It wouldn't make sense to fix this bug twice. Therefore it would probably be better if you'd just tackle one of your other proposed issues :/ Sorry for the inconvenience!

If you need any help just reach out to me :) :+1:

on3iro commented 4 years ago

Closing this, because I fixed the issue with #369