-
Notifications
You must be signed in to change notification settings - Fork 3
task/VSPC-209 #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
task/VSPC-209 #361
Conversation
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the generic class, that get parametrized with the type of object it handles and the repo doing the CRUD functionality, e.g.
abstract class ContentBlockManager<T, R> {
...
public void deleteBlockById(String id, String slideId) {
// here you get the repository via an abstract getRepository method
// that is implemented in the subclasses
getRepository().delete(...
}
...
and then the subclasses implement the getRepository method and all methods that are specific to a certain block type.
Does that make sense?
Guidelines for Pull Requests
If you haven't yet read our code review guidelines, please do so, You can find them here.
Please confirm the following by adding an x for each item (turn
[ ]into[x]).Please provide a brief description of your ticket
ContentBlockManager class needs to be separated into multiple manager classes
Description
The contentblockmanager class is getting too big. Let's separate the logic out into multiple manager classes, one for each type of content block.
There is a lot of duplicate code in there. Let’s extract a superclass with a shared delete and and get method, and an abstract getRepository method. The subclasses will then implement getRepository to return the repository for the class they manage, and create and update methods.
Additionally, contentOrder should not be a parameter for the create methods. I’m fairly certain the controllers just use the findMaxContentOrder method to get the last index and then pass that into the create methods (please check). Instead, the create methods should call the findMaxContentOrder .
VSPC-209
Anything else the reviewer needs to know?
... describe here ...