bharbron / hexbook-semantic

An Electron-React-Redux-Semantic-UI application for automatically generating a hexcrawl campaign notebook from random tables.
5 stars 3 forks source link

Make terrain required and territory optional for hexes #30

Open bharbron opened 6 years ago

bharbron commented 6 years ago

For the various places where terrain and territory can be input for a hex (adder at the bottom of the Hexes screen, modal for bulk inputting hexes, editing a single hex), make it so that terrain is a required field and territory is an optional field.

This will require updating related handleChange validation, handleSubmit validation, etc.

We will also need to update reducers for tableEntries so that they only store a value in addTags if the value was given. (Note that addTags[0] corresponds to terrain, addTags[1] to territory).

In addition to just making more sense (ever hex should have a terrain, but isn't necessarily going to be part of anybody's territory) it also simplifies how we work with tableEntries.addTags. We'll no longer need to keep placeholder undefined values in that array if terrain was empty.

bharbron commented 5 years ago

As part of this, split the input widget into separate "coordinate", "terrain", and "territory" fields, rather than expecting the user to input a single, comma-separated line.

Can keep the comma-separated input for the "bulk hex adder".