This week I finished up all the tests required in admin window as well as added markdown support in mscolab chat. I also did some redesigning of the chat window. I also made a new window to show the history of all the changes for mscolab.
Most of my time last week was spent on how to implement the markdown feature. I looked at various different ways of implementing it. I was able to create rich text editor buttons for common features like bold, italics, underline and lists.
However, I ran into a big issue which was that PyQt's QTextEdit widget returned a massive HTML response even for a very small message. I didn't want to store such a huge response in the database as it contained several unwanted HTML tags and inline styles. I could not find a way to reduce this output so I had to completely change my approach.
I completely scrapped the button approach and moved on to allowing markdown syntax in the chat itself. I used the python-markdown library for converting markdown to HTML on the fly. I had to spend some time figuring out how to deregister any syntax I don't want to support as I only wanted support for bold, italics and lists. After going through the library's documentation and tutorials, I was able to get it all working🥳
After adding the markdown support, I removed some existing code which was made redundant after the addition of the admin dashboard and fixed the tests which were affected by this code.
This week, I would be working on adding other chat features like edit and delete messages and hopefully, if I am able to complete these features move on to finishing up the new change history window.
Tanish19's Blog
What did I do this week?
My plans for this week was to start work on the chat window. However, my mentor had an idea about a nice feature to add in the admin dashboard, so I worked on completing that first. It was a feature to copy permissions from a different project to the selected one. This feature would save users a lot of time if they have multiple projects and are working with the same group of people. After implementing this, I worked on completing the pending tests in the admin window. After this, I started my work on the chat window but I was only able to do the new design part and some refactoring.
What is coming up next?
This week, I would be working on the chat window. I would be having a meeting with my mentors first, to finalize some features and based on their feedback I would be picking which feature to start my work on.
Did I get stuck anywhere?
Writing tests for the first time has been a bit hard for me. Deciding what feature to test, having proper seed data for testing etc are till some things I am learning. However, after writing the tests for the admin window, I feel much more confident going forward.
The coding phase of GSoC'20 finally began last week. I finished up fixing the existing bugs in mscolab and started my work on the admin window for mscolab. I have 3 major components that I am going to build during GSoC and the admin window is the first one. The admin window will allow flight campaign project admins to quickly add/modify/delete the permissions of the users working on their project.
My aim for last week was to get the UI and the server endpoints setup but I was able to finish up quite a lot more. I started with the UI in QtDesigner and wrote the necessary API endpoints. I got stuck while writing the APIs because it was my first time using the flask-SqlAlchemy library. I had used a "is None" comparison in the query filter which doesn't work in SqlAlchemy. I was stuck for quite some time before I figured out where the issue was. Finally, I realized the error and fixed it by replacing it by the "is_" function in Sql Alchemy.
After completing the APIs and connecting them to PyQt5 UI, I started my work on the search filters for the window. I added a search by username or email filter and a filter based on permission of the user. After adding the filters I added a socket event to refresh the window for other users when the permissions are updated in the admin window.
With all this, my work on the admin dashboard was mostly complete and I made a PR. After some review from my mentor and some slight refactoring, my first GSoC PR was accepted 🎉.
Now, for this week, I am going to start working on the unit tests for the admin window. I have already started working on them and will finish them up in the next couple of days. I don't have much experience in writing unit tests and the QtTest library for PyQt is also lacking some examples so I am learning most of the functions from reading the existing tests. After the tests are done, I will be moving on to the next component in my GSoC project which is the chat window. I aim to finish up the UI of the chat window and work on the markdown support.
Hey, I'm Tanish Grover. I'll be contributing to Mission Support System (MSS) under Python Software Foundation during GSoC'20. I'll be working on improving Mscolab functionalities.
What did you do this week?
I spent the last week of community bonding closing some existing issues in Mscolab to get more familiarized with the codebase. I spent some time reading the PyQt5 documentation and learning how to write better tests. I started designing the admin window and have got a good understanding of exactly what part of the existing codebase I need to update and what I need to add so I would be more efficient when I start coding.
What is coming up next?
This week I would be working on the Mscolab admin dashboard. I would be completing the UI and adding the add/modify/delete functionality.
Did you get stuck anywhere?
I got stuck while fixing an issue which required to import a different file when the test suites are running but I was able to fix it.