-
Notifications
You must be signed in to change notification settings - Fork 0
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
Category Manager #52
Comments
I will start this task tomorrow, during the day :) |
I'm handling this task right now. |
I have adjusted jUnit tests for SQL db which was missing in feature #35 |
I have just created pop-up window for Category manager. |
I have just refactored project's "Window" class into "AppWindow". Hence, it won't collide with standard library of JavaFX. |
I have added ObservableList of categories, which is populated by loaded db. Also, I have established "Add" button and implemented it's functionality to show small dialog window with name's field to add new category. All works and tested on dummy data. Hence, I will proceed with the rest of tasks tomorrow. |
For the duplicated code in controllers, check this - https://softwareengineering.stackexchange.com/questions/264392/is-a-good-practice-to-call-a-controller-function-from-another-controller Also, consider this for MainApp/AppWindow duplicated code and take a decision if this is good to leave this duplicated code. Potential solution: consider to create separated class which may be used to create dialogs. |
I have just reduced duplicated code by creating new class "DialogWindow" which is to create any dialog windows. It takes parameters of fxmlLoader, Window type object, title, header, required buttons etc. |
I have reduced duplicated code for ManagerController (File -> Close closure's confirmation code) and AppWindow.showExitConfirmationDialog() (which is now static method and is used in ManagerController). |
Established "Delete button" for Manager View for orders (additionally, this will be confirmed in #42 ), will do the same for Category Manager. Additionally, added listener for selected order, will do the same for Category Manager (Jeez, I have made such an offtopic here - need to focus on Category Manager :) ) |
Established EDIT button, it is now working 👍 |
I have established DELETE button + adjusted DELETE button in Order's list. OLD VERSION:
NEW VERSION:
It was required because there were bugs in the Category Manager (and potential bug in the Order List) as first I was removing position from the list (which set up was based on orderData's observable list) and afterwards I was updating actual observable list from orderData's. This was causing that controller's list was updated twice (first when I removed old position, second when observableList was updated) and this causes a bug. It is fixed now so it should be ok :) |
I have changed category selection into ComboBox (dropdown list), populated by observable List. So, Order class object is created with the STRING name of category but still, thru controllers, selected category's object is passed to addOrderToSqlDB and over there we are using category.getId() method to provide only id of the category. This will allow to keep consistent and clear data in SQL database where we are using category's ids for category field in orders table. tldr: Handled dropdown list and adjusted SQL INSERT method for orders. |
Last task, to ensure that in Edit window the same dropdown list is going to be applied... Well, this is going to be handled in feature #40 . |
As we already have Category class (for orders), we need to create small pop-up window which will be Category Manager.
Hence, it is going to be list with simple buttons (add, edit, delete).
Additional tasks:
The text was updated successfully, but these errors were encountered: