edwardUL99 / StudSysCppCLI

A CLI UI for the StudSysCpp Project. This is a "dummy" project that is not used but done to practise C++ and also software engineering in terms of issues, issue tracking, issue refinement, requirements engineering, releases and also databases
GNU General Public License v3.0
0 stars 0 forks source link

For removal of major objects, issue a warning message of the consequences and ask user to confirm #86

Closed edwardUL99 closed 4 years ago

edwardUL99 commented 4 years ago

When removing objects from the database that contain a lot of information about them, e.g. modules as they contain students, grades, exams, etc. issue a warning of the consequences of that deletion action and ask the user if they still want to continue

This is going to be broken down into a number of sub-tasks for each item:

Some of these may not be allowed to be deleted if there are foreign key restrictions (this could cause crashes if not handled)

For each of these check schema, and if necessary, open new issues to resolve any issues with them that need to be handled in this repository or Libraru

edwardUL99 commented 4 years ago

An idea could be a method confirmRemoval in UIUtils which takes the message to print and number of times to confirm (possibly then an array of strings to display on each confirmation) and then return true if you definitely want to cancel, false if not. Then the caller can abort if it returns false

edwardUL99 commented 4 years ago

Added a helper function confirmRemoval where you pass it the removal message and number of times to confirm and it does the rest of the work then. This is useful for the other sub-tasks as allows you to now confirm removal for others with minimal repetition of code. Just define the message to display i.e. what removing this object will result in removal of others, and the number of times to confirm and if it returns true continue with removal, if false, abort