Closed cuducos closed 6 years ago
Thank @cuducos, to test this PR:
Clone the project:
$ git clone git@github.com:datasciencebr/jarbas.git
Change to its folder:
$ cd jarbas
Change to @cuducos branch:
$ git fetch origin
$ git checkout -b cuducos-backward-compatibility-layers-url origin/cuducos-backward-compatibility-layers-url
$ git merge master
Copy the .env file:
$ cp contrib/.env.sample .env
Run the project:
$ docker-compose up -d
$ docker-compose run --rm django python manage.py migrate
$ docker-compose run --rm django python manage.py reimbursements /mnt/data/reimbursements_sample.xz
$ docker-compose run --rm django python manage.py companies /mnt/data/companies_sample.xz
$ docker-compose run --rm django python manage.py suspicions /mnt/data/suspicions_sample.xz
$ docker-compose run --rm django python manage.py tweets
$ docker-compose run --rm django python manage.py searchvector
Access http://localhost:8000/#/documentId/5627913
:
It redirects fine 🎉
The dashboard works fine too:
What is the purpose of this Pull Request?
When we directed the homepage to the Dashboard we broke @RosieDaSerenata links. This PR fixes that making Jarbas backward compatible with these links.
What was done to achieve this purpose?
A JS was added to the Dashboard to check if the URL matches one of those tweeted by Rosie, if so it redirects to the proper URL.
A JS was needed because URL fragment identifiers (string after the
#
in the URL) are not passed to the server (even if some agents pass it, it's mostly considered a bug not a feature) and the Elm interface links are based on URL fragment identifiers.How to test if it really works?
Access any URL such as
http://localhost:8000/#/documentId/5627913
and check if it redirects tohttp://localhost:8000/layers/#/documentId/5627913
(there is an extralayers/
in the redirection URL path).Who can help reviewing it?
@anaschwendler
TODO
Once this is merged @Irio can finally (re)point the DNS to the new servers.