-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking PR to merge release-1.1.0 to master (#165)
* ZEVA-147: Split the Details Container into multiple containers (#168) * ZEVA-143: Create New Organization (#167) * ZEVA 145: Home page tidy up (#169) * ZEVA 142: Fixed user group not being updated (#164) * ZEVA-134 view organizations list (#153) * ZEVA-132 Fixed Automapping for Keycloak (#152) * ZEVA 108 - icbc data model (#130) * zeva 110 - upload icbc spreadsheet (front end) (#135) * ZEVA-115 UX Improvements (#132) * ZEVA-80 UX Updates (#117) * zeva-73 - credit transactions (#122) * ZEVA-73: Credit transactions (#123) * ZEVA-103: Government receives the request and issues credits (#121) * ZEVA-117 Credit saving (#138) * ZEVA-80 UX Updates (#117) * zeva-73 - credit transactions (#122) * ZEVA-73: Credit transactions (#123) * ZEVA-103: Government receives the request and issues credits (#121) * ZEVA DEV Fixes (#141) * ZEVA 111 - Back end component - parse uploaded file from ICBC (#148) * ZEVA-137: Create Manage Organization Page (#161) * ZEVA-135: Configurable modules (#160) * ZEVA 155 - vehicle form validation (#179) * ZEVA-149: Imported roles and permissions from TFRS (#172)
- Loading branch information
1 parent
2b7e6d4
commit eb82362
Showing
81 changed files
with
7,955 additions
and
1,165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ venv/ | |
db.sqlite3 | ||
package-lock.json | ||
.coverage | ||
frontend/coverage/ | ||
frontend/coverage/lcov-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
sonar.projectName=zeva | ||
|
||
# Path to sources | ||
sonar.sources=backend/api,backend/auditable,backend/db_comments,backend/zeva,frontend/src | ||
sonar.exclusions=backend/api/tests | ||
#sonar.inclusions= | ||
|
||
# Path to tests | ||
#sonar.tests=backend/api/tests | ||
#sonar.test.exclusions= | ||
#sonar.test.inclusions= | ||
|
||
# Source encoding | ||
sonar.sourceEncoding=UTF-8 | ||
|
||
# Exclusions for copy-paste detection | ||
#sonar.cpd.exclusions= | ||
|
||
# coverage reports | ||
sonar.coverageReportPaths=frontend/coverage/clover.xml | ||
sonar.javascript.lcov.reportPaths=frontend/coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
backend/api/fixtures/operational/0006_add_roles_permissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from django.db import transaction | ||
|
||
from api.management.data_script import OperationalDataScript | ||
from api.models.permission import Permission | ||
from api.models.role import Role | ||
from api.models.role_permission import RolePermission | ||
from api.authorities import REQUIRED_AUTHORITIES | ||
|
||
|
||
class AddRolesPermissions(OperationalDataScript): | ||
""" | ||
Adds the known suppliers | ||
""" | ||
is_revertable = False | ||
comment = 'Adds the Roles and Permissions in the authorities file' | ||
|
||
def check_run_preconditions(self): | ||
return True | ||
|
||
@transaction.atomic | ||
def run(self): | ||
display_order = 1 | ||
roles_added = 0 | ||
permissions_added = 0 | ||
|
||
for authority in REQUIRED_AUTHORITIES: | ||
if authority.root is None: | ||
continue | ||
|
||
(role, role_created) = Role.objects.get_or_create( | ||
role_code=authority.group, | ||
defaults={ | ||
'description': authority.group, | ||
'is_government_role': | ||
True if authority.root == 'IDIR' else False, | ||
'display_order': display_order | ||
} | ||
) | ||
|
||
(permission, perm_created) = Permission.objects.get_or_create( | ||
permission_code=authority.role.replace(' ', '_').upper(), | ||
defaults={ | ||
'name': authority.role, | ||
'description': authority.description | ||
} | ||
) | ||
|
||
RolePermission.objects.get_or_create( | ||
permission=permission, | ||
role=role | ||
) | ||
|
||
if role_created: | ||
roles_added += 1 | ||
display_order += 1 | ||
|
||
if perm_created: | ||
permissions_added += 1 | ||
|
||
print("Added {} roles.".format(roles_added)) | ||
print("Added {} permissions.".format(permissions_added)) | ||
|
||
|
||
script_class = AddRolesPermissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.db import models | ||
|
||
|
||
class PermissionManager(models.Manager): | ||
def get_by_natural_key(self, code): | ||
return self.get(code=code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.db import models | ||
|
||
|
||
class RoleManager(models.Manager): | ||
def get_by_natural_key(self, name): | ||
return self.get(name=name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.0.3 on 2020-05-08 21:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0036_auto_20200429_1327'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterUniqueTogether( | ||
name='vehicle', | ||
unique_together={('make', 'model_name', 'vehicle_zev_type', 'model_year')}, | ||
), | ||
migrations.RemoveField( | ||
model_name='vehicle', | ||
name='vehicle_class_code', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Generated by Django 3.0.3 on 2020-05-13 22:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0037_auto_20200508_1451'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='vehicleclass', | ||
name='create_user', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehicleclass', | ||
name='update_user', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehiclemakeorganization', | ||
name='create_user', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehiclemakeorganization', | ||
name='organization', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehiclemakeorganization', | ||
name='update_user', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehiclemakeorganization', | ||
name='vehicle_make', | ||
), | ||
migrations.RemoveField( | ||
model_name='vehiclechangehistory', | ||
name='make_id', | ||
), | ||
migrations.AlterField( | ||
model_name='icbcvehicle', | ||
name='make', | ||
field=models.CharField(max_length=250, unique=True), | ||
), | ||
migrations.AlterField( | ||
model_name='vehicle', | ||
name='make', | ||
field=models.CharField(max_length=250, unique=True), | ||
), | ||
migrations.DeleteModel( | ||
name='Make', | ||
), | ||
migrations.DeleteModel( | ||
name='VehicleClass', | ||
), | ||
migrations.DeleteModel( | ||
name='VehicleMakeOrganization', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 3.0.3 on 2020-05-14 16:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0038_auto_20200513_1500'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='vehiclechangehistory', | ||
name='vehicle_class_code_id', | ||
), | ||
migrations.AddField( | ||
model_name='vehiclechangehistory', | ||
name='make', | ||
field=models.CharField(blank=True, max_length=250, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.0.3 on 2020-05-15 21:11 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0039_auto_20200514_0900'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='icbcvehicle', | ||
name='make', | ||
field=models.CharField(max_length=250), | ||
), | ||
migrations.AlterField( | ||
model_name='vehicle', | ||
name='make', | ||
field=models.CharField(max_length=250), | ||
), | ||
] |
Oops, something went wrong.