At the start of this week I added a services folder and shifted all the backend API calls occurring in the Vuex store to pass through this services folder instead. It comprises of two files, the first of which holds all of the database methods called in our Vuex store, and the second contains global variables and functions that are used throughout different components in the code. This makes code management easier because instead of editing multiple copies of the same code you can simply change the code at the single source instead and have the change reflected everywhere else.

The last part of our interface involves developing a tracking mechanism for the Emcee to remember which prizes have been announced and which prizes are yet to be announced respectively. I managed to make some progress on this component by adding in the relevant data fetching and action methods. For the visual queue we decided to use a white background on the list component to indicate that a given prize has already been announced. This was implemented using Vue’s v-bind directive that allows you to use dynamic styling for your components based on a particular key value in the object property. Since the prizes are sorted in a custom order, rather than the builtin alphanumeric or alphabetical order supported in Javascript, a custom sort function had to be written as well based on our available prize listing. Once this was done the Bouncer interface was modified to incorporate the prize collection by players as well for the award ceremony.

Afterwards, I went back to working on Cordova itself and added the inAppBrowser plugin to replace the deprecated method. This allowed the opening of the YouTube link in the native device YouTube app but I still had difficulty opening up the PDF as it was retrieved from the database as a Base64 encoded string. After some research, I discovered that I would need to store the pdf locally in the device first and then open it up in a Cordova Window by pointing to the file location in the device directory so I added in the Cordova file plugin and successfully managed to open up the PDF in the default PDF viewer for the device.

Having finalised most of the additional features I hope to complete reorganisation of the code this coming week and make whatever additional changes are seen as necessary so I may call this project a wrap and move on to my next one.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.