Updates we completed for the final milestone of our open source application PlayWithMagic.org:
- Improved authorization awareness of the application.
- Updated authorization to prevent unauthorized users from editing or deleting routines or magicians.
- Displayed navigation elements based on your logged-in state and whether you are the owner of an item or not.
- Added the Set Notes feature
- A Magician may input desired information about a Set, and then get an analysis of the Routines they’ve chosen for the Set.
- Resolved the https issues to the best of our ability with Heroku.
- Used FontAwesome icons for placeholder images in newly created Profiles, Routines, and Materials that do not have uploaded images.
- Fixed image upload issue when deployed on Heroku.
- Evolutions were not being applied in Heroku.
- Cleaned up dead branches.
Download the Milestone-4 release of PlayWithMagic.org on Github.
Feedback on Milestone 3
The PWM team got feedback from our professor after we demoed Milestone 3. Our professor gave us the following feedback:
- Probably not good for unlogged-in users to edit/delete all content.
- Maybe only allow “creator” of content to be able to delete it?
- Implement first pass at Magic Checkstyle.
Plan of Attack for Milestone 4
- Patrick noticed that I had not normalized the imageId field that defines the “one to one” relationship between the Magician’s profile image and the Image entity I had created in the code to allow the user to upload images. After looking into the problem I noticed that I had also neglected to establish the one to one relationship in the Routines and Materials imageIds as well. I added this bug as an issue on Github. I focused on updating the image upload code I had written.
- Mark worked on implementing the Set Checker feature for our application.
- And Patrick worked on finalizing the User Authentication issues we had encountered in our demo of Milestone 3.
We met on Skype for a few hours and each worked on the issues that had been assigned to us. Our longest stretch of programming was around 3 hours. Here’s a screenshot I took while I was running the tests on the code.
Github Issues I fixed
Issue #189: Set up default images for Profile, Routines, and Materials:
I created a new branch called fixImageUploads-1 off of the Milestone 3 branch and started updating Magician.java, Routine.java, and Material.java to note the “one to one” relationship between the entities. Once I had updated the java files, I spoke with Mark and learned that we had created a new branch called Milestone-4. The branch I had merged off of was out of date.
I abandoned the fixImageUploads-1 branch and created a new branch off of the Milestone-4 branch and redid my corrections.
Then I noticed that now I had 2 branches with the same name. I did an easy fix and created a new branch off of fixImageUploads-1 called fixImageUploads-2. Then I spoke with Patrick and gave him the name of the correct branch name and he merged it with the master branch.
Issue #209: Images are referred to by their ids instead of a database relation
There was an issue with images not being associated with the correct Magician/Routine/Material. When we checked the edit and view pages for Magician, Routine, and Material, the pages were querying the database for images that were not there. We had added Magicians, Routines, and Materials to the in-memory database. Now when we were loading the view or edit pages, they were looking for images that had not been ported to the Postgres database.
I updated the code to check for the imageId associated with each Magician, Routine, and Material to validate the imageId. If the imageId was not a valid number the code did not attempt to load the image.
Issue #211: Image Uploads do not work on Heroku
Another issue that came up with the addition of the image uploads was located when Mark and Patrick ran Mark’s Chromium tests on the codebase. I fixed this issue by removing all tests that referred to deleting Magicians, Routines, and Materials.
This was an easy fix that involved opening the code in IntelliJ and running a search all files operation with the keyboard shortcut Shift+Command+f. I searched for the keyword “delete” and commented all references to methods to delete the Magician, Routine, or Materials in the Postgres database.
We collectively decided to leave the delete code in to allow for future updates that will allow the site administrators to delete Magicians, Routines, and Materials in the future once the Site Admin accounts can be created.
Issue #223: Fails tests in Milestone-4
Once I had removed all references to delete Magicians, Routines, and Materials in PWN, the tests started to fail. 5 out of 15 tests were failing. This was a good thing. This allowed me to dig into the Chromium tests that Mark had written to remove the test code that was testing against the Postgres database.
Once I had removed the tests that checked the delete functions the tests all passed. I confidently merged my changes into the Milestone-4 branch.
Created Set Notes wiki page
I created a wiki page for the Set Notes that explains how to use the feature on our site. In order to accomplish this I reviewed the Set Notes Design in the Developer Guide and updated it to show what was actually implemented in the code. I also took screenshots on desktop and mobile versions of the site and added them to the docs/images folder on the master branch of our code. I pushed the repo and linked the images in the Set Notes to the images in the code.