QueryJane | Development Update

in #utopian-io6 years ago

Repository
https://github.com/roadhousestudio/queryjane_app

QueryJane is a web application developed with Django that allows to connect with companies and experts in different sectors of the cannabis industry. Beta version is available here.


Screen Shot 2018-05-28 at 8.37.05 PM.png

New Features

I have been working in a new flow to manage the legal pages: User agreement and privacy policy.

Before, this information was written in flat pages, and the only way to update it was editing the html files directly. Now, users with administration permissions in the platform can update the information in pages like user agreement, privacy policy and cookies policy.

When a platform administrator user visits a page like the user agreement, the button Edit will be available:


Screen Shot 2018-05-28 at 9.17.42 PM.png

When an administrator user clicks this button, the page content switches to a form with the following fields:

  • English description.
  • Spanish description.
  • notify users.


Screen Shot 2018-05-28 at 9.30.54 PM.png

The application is available in English and in Spanish, for this reason, there are available two text fields. Administrator users can update the information and fix some bugs, make redaction improvements, etc. If the change is not important, administrator users should not check the field called Notify users.

The Notify users field must be checked only if the change is an important change. Why?

If the Notify users field is checked, the application will create a notification for all users. This notification will be available in the main notifications section in the header bar:


Screen Shot 2018-05-28 at 9.41.26 PM.png

Also, the user model has two attributes: accepted_terms and accepted_privacy_policy. These are boolean fields. If the "Notify users" field is checked, and if the administrator user has edited the user agreement, the accepted_terms will be changed to False. In the same way, if the administrator user has edited the privacy policy, the accepted_privacy_policy attribute will be changed to False. It means, that user has not accepted the new user agreement or the new privacy policy.

When a user authenticates in the application, and he has not accepted the new user agreement, he will be notified:


Screen Shot 2018-05-28 at 9.54.19 PM.png

In the same way with the privacy policy:


Screen Shot 2018-05-28 at 9.55.11 PM.png

These messages will be displayed in all application pages. To hide them, user must accept the new user agreement and the new privacy policy.

User can accept new privacy policy or the new agreement following the link displayed in the messages above, or following the new notification available en the header bar.

If user click the link "Check it out" displayed in the images above, he will be redirected to the user agreement or the privacy policy page. At the end of these pages, will be available the button "I'm agree":


Screen Shot 2018-05-28 at 9.58.50 PM.png

By clicking this button, the user will accept the document changes.

If user clicks the notification in the header bar, the new content of the user agreement or of the privacy policy will be displayed in the notifications modal:


Screen Shot 2018-05-28 at 10.01.08 PM.png

The "I'm agree" button will be available at the modal footer.

Code changes related to this new features can be found in this PULL REQUEST.


I have also taken the opportunity to work on cleaning the project migrations. Each time that a change is make in the models (the database columns), Django creates a migration file. This project is really big, then, we have more than 30 migrations in some applications, and it is not necessary now. Then, we can clean these files following the next steps:

  • 1. Create a database backup.

The database engine used in this project is Postgres. Create a backup of your database by running the following command:

Using virtualenv:

pg_dump -U <database user> -h localhost <database name> -f <backup.sql>

Using Docker:

docker exec -t queryjaneapp_db_1 pg_dumpall -c -U postgres > dump_sql

This step is only for security, if there is some bug, we want to have a db backup.

  • 2. Remove all files from migration folder, except the __init__.py file.

  • 3. Generate new migrations by running the following command.

Using virtualenv:

./manage.py makemigrations

using Docker:

docker-compose exec web python manage.py makemigrations

  • 4. Run migration using the --fake option.

Using virtualenv:

./manage.py migrate --fake

using Docker:

docker-compose exec web python manage.py migrate --fake

In this way, we will mark the new migrations as executed, but our db structure will not be changed.

In this pull request we can find a lot of removed migration files.

GitHub Account

https://github.com/aaquirogal

PR1
PR2



Screen Shot 2018-05-28 at 8.37.05 PM.png


How to contribute

QueryJane has been developed using the Django framework. You can fork the project, and run it locally is very easy. Follow the steps described in the open source repository installation guide. The project has been configured using Docker. you only need to install Docker and follow these steps.

Future work.

Take a look to our public trello board. This is the easiest way to know our roadmap.

If you want to contribute, please join my Discord.


Sort:  

Nice work @kit.andres I had a look at the repository and beta link, you have put a bit of work into this. I think you should definitely consider maybe giving the UI a little overhaul once you've crossed off a few items on the feature roadmap, but for now you've got a nice functional beta.

Hi sr. Yes, you're totally right. We have implemented an important group of functionalities, but the application design, UI and UX are priority now. Now, we are working in the homepage redesign, and we are searching resources to integrate an UI/UX designer. Thank you for your feedback.

interesting

Thanks for you sir... very amazing

Hello @kit.andres My name is Nataly, I'm new in Steemit and I did see your project and I think it's amazing and see a big opportunity for that. I'm a Graphic designer an UX specialist and I would like participate and contribute in you project with topics about usability and design.

Thanks for the contribution!

Very detailed and well written post! Also great timing implementing something that can notify everyone if you update your privacy policy, haha.

One tiny thing: I would recommend adding some more comments to your code, as I couldn't find a single comment anywhere.

Keep up the good work!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @kit.andres
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 14 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 19 SBD worth and should receive 34 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.029
BTC 57020.43
ETH 3081.72
USDT 1.00
SBD 2.41