There is a lot of business logic currently mixed with the UI in the Config module. This is a contributing factor to the mess that is the config module.
Steps to recreate
N/A
Solution
Separate the UI and business logic in the config module. config.newConfigFile is the most egregious example of this, however many of the methods in this module exhibit similar issues.
Should move business logic into separate, unit-testable, methods and move the UI into the UI module. See UI.standardGrading for an example of how this was done in the past.
Ideally, all user input should be handled by the uiHelpers.getUserInput method.
The other major thing for consideration is how we want to read the config. Currently, we are doing it with a single call to config.readConfig in the main method, which handles the reading and selection in the event that there are many config files. I also want to separate the business logic (getting the list of available configs, reading the selected one) and the UI (selecting the config file).
Acceptance Criteria
[ ] Business logic is broken out into separate methods as needed.
[ ] Business logic is unit testable.
Note: Don't write unit tests for this yet, that will be a separate issue once the changes are discussed in more detail.
[ ] UI is completely moved into UI module.
[ ] All user input calls utilize uiHelpers.getUserInput
Description
Issue
There is a lot of business logic currently mixed with the UI in the Config module. This is a contributing factor to the mess that is the config module.
Steps to recreate
N/A
Solution
Separate the UI and business logic in the config module.
config.newConfigFile
is the most egregious example of this, however many of the methods in this module exhibit similar issues.Should move business logic into separate, unit-testable, methods and move the UI into the UI module. See
UI.standardGrading
for an example of how this was done in the past.Ideally, all user input should be handled by the
uiHelpers.getUserInput
method.The other major thing for consideration is how we want to read the config. Currently, we are doing it with a single call to
config.readConfig
in the main method, which handles the reading and selection in the event that there are many config files. I also want to separate the business logic (getting the list of available configs, reading the selected one) and the UI (selecting the config file).Acceptance Criteria
uiHelpers.getUserInput