-
Notifications
You must be signed in to change notification settings - Fork 0
Create schedules use case completed #72
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f7c4e58
Still working on create schedule view
ingrid534 e072e87
Modified create schedule presenter and viewmodel to not include view …
ingrid534 68fe35f
separated create schedule from view group schedule presenter, state, …
ingrid534 32996ba
Adding separate presenter for group schedule view
ingrid534 1a77822
Committing for debugging
ingrid534 8d89801
Debugging again
ingrid534 37b2324
committing to debug
ingrid534 105206e
Add availability button works, committing to catch up with main.
ingrid534 78f4828
Merge remote-tracking branch 'origin' into CreateSchedules
ingrid534 ecb3dfd
Fixing bugs
ingrid534 bdfcb9e
Added group view, fixed group Shcedule presenter, debugging flow to s…
ingrid534 96733bb
Finished create schedule use case (finally)
ingrid534 dd61ee6
Got rid of 'schedule tab for group' text in schedule tab view
ingrid534 24ef9d6
Removed any commented code
ingrid534 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/main/java/interface_adapter/create_schedule/CreateScheduleState.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...main/java/interface_adapter/schedule/create_schedule/CreateScheduleControllerFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package interface_adapter.schedule.create_schedule; | ||
|
|
||
| import interface_adapter.ViewManagerModel; | ||
| import interface_adapter.schedule.view_schedule.ScheduleTabViewModel; | ||
| import interface_adapter.schedule.view_schedule.ScheduleTabPresenter; | ||
| import use_case.create_schedule.CreateScheduleGroupDataAccessInterface; | ||
| import use_case.create_schedule.CreateScheduleInputBoundary; | ||
| import use_case.create_schedule.CreateScheduleUserDataAccessInterface; | ||
| import use_case.create_schedule.CreateScheduleOutputBoundary; | ||
| import use_case.create_schedule.CreateScheduleInteractor; | ||
| import use_case.create_schedule.CreateScheduleMembershipDataAccessInterface; | ||
|
|
||
| public class CreateScheduleControllerFactory { | ||
|
|
||
| private final CreateScheduleUserDataAccessInterface userDao; | ||
| private final CreateScheduleGroupDataAccessInterface groupDao; | ||
| private final CreateScheduleMembershipDataAccessInterface membershipDao; | ||
| private final ViewManagerModel viewManagerModel; | ||
| private final CreateScheduleViewModel createScheduleViewModel; | ||
| private final ScheduleTabViewModel groupScheduleViewModel; | ||
|
|
||
| public CreateScheduleControllerFactory( | ||
| CreateScheduleUserDataAccessInterface userDao, | ||
| CreateScheduleGroupDataAccessInterface groupDao, | ||
| CreateScheduleMembershipDataAccessInterface membershipDao, | ||
| ViewManagerModel viewManagerModel, | ||
| CreateScheduleViewModel createScheduleViewModel, | ||
| ScheduleTabViewModel groupScheduleViewModel | ||
| ) { | ||
| this.userDao = userDao; | ||
| this.groupDao = groupDao; | ||
| this.membershipDao = membershipDao; | ||
| this.viewManagerModel = viewManagerModel; | ||
| this.createScheduleViewModel = createScheduleViewModel; | ||
| this.groupScheduleViewModel = groupScheduleViewModel; | ||
| } | ||
|
|
||
| /** | ||
| * Creates a fully wired CreateScheduleController for the given ScheduleTabViewModel. | ||
| * This method sets up the presenter and interactor so that the controller can | ||
| * retrieve members for a specific group and update the People tab UI. | ||
| * | ||
| * @param viewModel the view model that will be updated with retrieved member data | ||
| * @return a new RemoveMemberController wired to the appropriate interactor and presenter | ||
| */ | ||
| public CreateScheduleController create(ScheduleTabViewModel viewModel) { | ||
|
|
||
| CreateScheduleOutputBoundary presenter = | ||
| new CreateSchedulePresenter( | ||
| createScheduleViewModel, | ||
| viewManagerModel, | ||
| groupScheduleViewModel | ||
| ); | ||
|
|
||
| ScheduleTabPresenter groupSchedulePresenter = | ||
| new ScheduleTabPresenter(viewModel); | ||
|
|
||
| CreateScheduleInputBoundary interactor = | ||
| new CreateScheduleInteractor( | ||
| userDao, | ||
| groupDao, | ||
| presenter, | ||
| membershipDao, | ||
| groupSchedulePresenter | ||
| ); | ||
|
|
||
| return new CreateScheduleController(interactor); | ||
| } | ||
| } | ||
|
|
||
46 changes: 46 additions & 0 deletions
46
src/main/java/interface_adapter/schedule/create_schedule/CreateSchedulePresenter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package interface_adapter.schedule.create_schedule; | ||
|
|
||
| import interface_adapter.ViewManagerModel; | ||
| import interface_adapter.schedule.view_schedule.ScheduleTabViewModel; | ||
| import use_case.create_schedule.CreateScheduleOutputBoundary; | ||
| import use_case.create_schedule.CreateScheduleOutputData; | ||
|
|
||
| public class CreateSchedulePresenter implements CreateScheduleOutputBoundary { | ||
| private final CreateScheduleViewModel createScheduleViewModel; | ||
| private final ViewManagerModel viewManagerModel; | ||
| private final ScheduleTabViewModel groupScheduleViewModel; | ||
|
|
||
| public CreateSchedulePresenter(CreateScheduleViewModel createScheduleViewModel, ViewManagerModel viewManagerModel, | ||
| ScheduleTabViewModel groupScheduleViewModel | ||
| ) { | ||
| this.createScheduleViewModel = createScheduleViewModel; | ||
| this.viewManagerModel = viewManagerModel; | ||
| this.groupScheduleViewModel = groupScheduleViewModel; | ||
| } | ||
|
|
||
| @Override | ||
| public void prepareSuccessView(CreateScheduleOutputData response) { | ||
| createScheduleViewModel.getState().setOpenModal(false); | ||
| createScheduleViewModel.firePropertyChange("openModal"); | ||
|
|
||
| createScheduleViewModel.setState(new CreateScheduleState()); | ||
| viewManagerModel.firePropertyChange("view"); | ||
|
|
||
| } | ||
|
|
||
| @Override | ||
| public void prepareFailView(String error) { | ||
| final CreateScheduleState state = createScheduleViewModel.getState(); | ||
| state.setError(error); | ||
|
|
||
| createScheduleViewModel.setState(state); | ||
| createScheduleViewModel.firePropertyChange("state"); | ||
| } | ||
|
|
||
| @Override | ||
| public void openCreateScheduleModal() { | ||
| createScheduleViewModel.getState().setOpenModal(true); | ||
| createScheduleViewModel.firePropertyChange("openModal"); | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
minor issue: CreateScheduleController not RemoveMemberController