patsonluk / airline

Apache License 2.0
109 stars 71 forks source link

FOD's alliance rejection message suggestion #560

Open bleu0 opened 1 year ago

bleu0 commented 1 year ago

Instead of showing a Cannot Join Alliance error for applying to other alliances if you're already in one, show the following checklist:

✅ Not in another alliance | ❌ In another alliance. Leave My First Alliance first before applying. ✅ No overlapping bases | ❌ Following bases overlap: JFK JFK. Remove overlapping bases first before applying. ✅ Alliance has open spots | ❌ Alliance is full. Remove an existing member first before applying.

patsonluk commented 1 year ago

Thanks for giving it a try ! 😊 i think this is a good start!

The piece you are modifying is on server end so changing the messages themselves might not be not enough.

the signature is def getApplyRejection(airline : Airline, alliance : Alliance) : Option[String] which means it expects an scala Option . Some for failures, and None when it's okay, There are logic to read the result of that and determine whether the action is acception (ie no rejection), and then that would affect how the front-end reacts (gray out buttons etc)

Therefore if we want to return a list (and for both success and failures), we will have to:

  1. Return a list of string, and have some way to tell if the list means success or failures
  2. Modify the front-end code such that it understands such list, display the items and disable/enable the button accordingly :)