Skip to content
Snippets Groups Projects
Commit d95087e2 authored by Gael Yvert's avatar Gael Yvert
Browse files

update application setings; update functionality seeders and corresponding doc for developers

parent 7b7f6aca
No related branches found
No related tags found
No related merge requests found
...@@ -182,7 +182,7 @@ return [ ...@@ -182,7 +182,7 @@ return [
| |
*/ */
'primary_color' => '#22A7F0', 'primary_color' => '#24bec7',
'show_dev_tips' => true, // Show development tip "How To Use:" in Menu and Settings 'show_dev_tips' => true, // Show development tip "How To Use:" in Menu and Settings
......
...@@ -67,31 +67,35 @@ We build relationships by editing the models and adding optional details in voya ...@@ -67,31 +67,35 @@ We build relationships by editing the models and adding optional details in voya
Voyager offers the possibility to create, modify and delete tables of the database. However, when doing so, there is no versioning/history records of these modifications. Therefore, **DO NOT MODIFY TABLES FROM WITHIN VOYAGER**. Please work exclusively with migrations as described above when creating/modifying tables. Voyager offers the possibility to create, modify and delete tables of the database. However, when doing so, there is no versioning/history records of these modifications. Therefore, **DO NOT MODIFY TABLES FROM WITHIN VOYAGER**. Please work exclusively with migrations as described above when creating/modifying tables.
When using voyager to develop MyLabStocks, BREADs and MENUs informations are not naturally tracked in the git repository. This is a source of confusion across versions: tables, as defined in migrations and seeders, can become disconnected to BREADs. This issue is discussed by voyager's developers themselves [here](https://github.com/the-control-group/voyager/issues/1030). ## Git Functionalities Tables
We propose a solution to this, which is based on [iseed](https://github.com/orangehill/iseed). Voyager writes BREADs informations in two tables: `data_types` and `data_rows`, and it writes the permissions to these BREADs in tables `permissions` and `permission_role`. Similarly, Voyager writes MENUs informations in two tables: `menus` and `menu_items` and also stores menu-related permissions in tables `permissions` and `permission_role`. Our solution is to create seeders for these tables and git them. When using voyager to develop MyLabStocks, a number of application functionalities are recorded in tables of the database. For example, BREADs are stored in `data_types` and `data_rows`.
An important consequence of this is that these functionalities are not tracked by git, because we git the code but we will never git the database of course. So, how are we going to keep track of th functionalities stored in the database tables?? This issue is discussed by voyager's developers themselves [here](https://github.com/the-control-group/voyager/issues/1030).
We propose a solution to this, which is based on [iseed](https://github.com/orangehill/iseed). The idea is simple: we create seeders of the functionality tables, and we git these seeders.
We therefore ask you to follow the procedure described in this example: We therefore ask you to follow the procedure described in this example:
- let's assume you are currently in branch master - let's assume you are currently in branch master
- After you have edited BREADs in voyager and you are happy with these edits, run - After you have edited some functionality in Voyager, for example BREADs, and you are happy with these edits, run
```sh ```sh
git add * git add *
git commit git commit
./gitbreadandmenus.sh ./gitfunctionalitytables.sh
``` ```
- Let's assume now that you want to start doing some tasks in a new branch called dev: - Let's assume now that you want to start doing some tasks in a new branch called dev:
```sh ```sh
git chekout -b dev git chekout -b dev
do some work on files and/or BREADs and/or MENUs do some work on files and/or BREADs and/or MENUs ...
git add * git add *
git commit -m "I did some dev tasks" git commit -m "I did some dev tasks"
./gitbreadandmenus.sh ./gitfunctionalitytables.sh
``` ```
- And now you want to go back to branch master and retrieve not only the files but also the BREADs and MENUs - And now you want to go back to branch master and retrieve not only the files but also the BREADs and MENUs
```sh ```sh
git checkout master git checkout master
./restorebreadmenus.sh ./restorefunctionalitytables.sh
``` ```
So, what happened? So, what happened?
- Your BREADs should be functional as they were prior to your edits on the dev branch. - Your BREADs should be functional as they were prior to your edits on the dev branch.
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
cp database/seeds/DatabaseSeeder.php /tmp/DatabaseSeeder.php cp database/seeds/DatabaseSeeder.php /tmp/DatabaseSeeder.php
# Inverse-seed BREAD's content # Inverse-seed BREAD's content
php artisan iseed data_types,data_rows,menus,menu_items,permissions,permission_role --force --classnameprefix=BreadAndMenuTrackingByIseed php artisan iseed data_types,data_rows,menus,menu_items,permissions,permission_role,settings --force --classnameprefix=BreadAndMenuTrackingByIseed
# Restore original DatabaseSeeder # Restore original DatabaseSeeder
mv /tmp/DatabaseSeeder.php database/seeds/DatabaseSeeder.php mv /tmp/DatabaseSeeder.php database/seeds/DatabaseSeeder.php
...@@ -33,8 +33,9 @@ git add database/seeds/BreadAndMenuTrackingByIseedMenusTableSeeder.php ...@@ -33,8 +33,9 @@ git add database/seeds/BreadAndMenuTrackingByIseedMenusTableSeeder.php
git add database/seeds/BreadAndMenuTrackingByIseedMenuItemsTableSeeder.php git add database/seeds/BreadAndMenuTrackingByIseedMenuItemsTableSeeder.php
git add database/seeds/BreadAndMenuTrackingByIseedPermissionsTableSeeder.php git add database/seeds/BreadAndMenuTrackingByIseedPermissionsTableSeeder.php
git add database/seeds/BreadAndMenuTrackingByIseedPermissionRoleTableSeeder.php git add database/seeds/BreadAndMenuTrackingByIseedPermissionRoleTableSeeder.php
git add database/seeds/BreadAndMenuTrackingByIseedSettingsTableSeeder.php
git commit -m "Updated BREADs and MENUs seeders" git commit -m "Updated BREADS, MENUS, PERMISSIONS and SETTINGS seeders"
## Restore instructions: ## Restore instructions:
# After git checkout # After git checkout
......
...@@ -14,3 +14,4 @@ php artisan db:seed --class=BreadAndMenuTrackingByIseedMenusTableSeeder ...@@ -14,3 +14,4 @@ php artisan db:seed --class=BreadAndMenuTrackingByIseedMenusTableSeeder
php artisan db:seed --class=BreadAndMenuTrackingByIseedMenuItemsTableSeeder php artisan db:seed --class=BreadAndMenuTrackingByIseedMenuItemsTableSeeder
php artisan db:seed --class=BreadAndMenuTrackingByIseedPermissionsTableSeeder php artisan db:seed --class=BreadAndMenuTrackingByIseedPermissionsTableSeeder
php artisan db:seed --class=BreadAndMenuTrackingByIseedPermissionRoleTableSeeder php artisan db:seed --class=BreadAndMenuTrackingByIseedPermissionRoleTableSeeder
php artisan db:seed --class=BreadAndMenuTrackingByIseedSettingsTableSeeder
* *
!settings/
!blast/ !blast/
!.gitignore !.gitignore
*
!May2020/
!.gitignore
*
!.gitignore
!kk7wJ1UfaDU67RMVpqE9.jpg
storage/app/public/settings/May2020/kk7wJ1UfaDU67RMVpqE9.jpg

660 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment