Closed edwardUL99 closed 4 years ago
Adding test and regression labels as refactoring is done but this needs to be tested using regression to ensure functionality remains the same
Regression is covered by issue #63, so closing out this issue as it is now a duplicate issue
An example of code that had to be refactored was ModuleHomePage::editAnnouncement(const Announcement &announcement). As before refactoring it, it was one huge method with a lot of duplicated code for commands like <!goto> and <!delete>. Therefore it has been pulled apart and into different subroutines handling some of the more involved commands <!goto> and <!insert> and <!delete> are examples into their own subroutines, different editing subroutines for normal editing and end of announcement etc. The code is still there just split to more clearer and readable subroutines. You could say, the editAnnouncement method is now the driver for the announcement editor.
REFACTORING IDEA: Maybe it would be best to pull all announcement stuff into an announcement page, and then do everything from there. As, currently the ModuleHomePage is cluttered with announcement stuff also, This will shorten the show method too when you are refactoring that. I will raise an issue about it