Skip to content

Commit 795ccbd

Browse files
committed
Rename Accident to Incident thru app
1 parent 6b4d784 commit 795ccbd

28 files changed

+114
-432
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ telling it to communicate with the Docker daemon on the `app` virtual machine.
5959

6060
## Testing Data
6161

62-
A CSV of historical data can be downloaded from the project /data folder (accidents_and_sites.csv).
62+
A CSV of historical data can be downloaded from the project /data folder (incidents_and_sites.csv).
6363

6464
Once the app has been built, this data can be loaded.
6565

@@ -68,7 +68,7 @@ Then open the network tab in web developer tools and reload the page. Inspect th
6868
from an API request and pull out the value of the `Authorization` header, for example
6969
`Token f1acac96cc79c4822e9010d23ab425231d580875`.
7070

71-
Run `python scripts/load_accidents_v3.py --authz 'Token YOUR_AUTH_TOKEN' /path/to/accident_csvs`.
71+
Run `python scripts/load_incidents_v3.py --authz 'Token YOUR_AUTH_TOKEN' /path/to/incident_csvs`.
7272
Note that the import process will take roughly two hours for the full data set; you can cut down the
7373
number of records with `head` on the individual CSVs.
7474

app/data/tests/test_serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def setUp(self):
2626

2727
def test_transform_details_only(self):
2828
"""Test that non-read-only keys are removed from 'properties' and 'definitions'"""
29-
test_value = {'Accident Details': {}, 'Related Info 1': {}, 'Related Info 2': {}}
30-
self.assertEqual(('definitions', {'Accident Details': {}}),
29+
test_value = {'Incident Details': {}, 'Related Info 1': {}, 'Related Info 2': {}}
30+
self.assertEqual(('definitions', {'Incident Details': {}}),
3131
self.serializer.make_read_only_schema('definitions', test_value))
32-
self.assertEqual(('properties', {'Accident Details': {}}),
32+
self.assertEqual(('properties', {'Incident Details': {}}),
3333
self.serializer.make_read_only_schema('properties', test_value))
3434
self.assertEqual(('no_transform', test_value),
3535
self.serializer.make_read_only_schema('no_transform', test_value))

app/data/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def test_audit_log_creation(self):
176176
post_data = {
177177
'data': {
178178
'Person': [],
179-
'Accident Details': {
179+
'Incident Details': {
180180
'Num passenger casualties': '',
181181
'Num driver casualties': '',
182182
'Num pedestrian casualties': '',

app/data/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def crosstabs(self, request):
229229
- row_boundary_id: Id of a Boundary whose BoundaryPolygons should be used as rows
230230
- row_choices_path: Path components to a schema property whose choices should be used
231231
as rows, separated by commas
232-
e.g. &row_choices_path=accidentDetails,properties,Collision%20type
232+
e.g. &row_choices_path=incidentDetails,properties,Collision%20type
233233
Note that ONLY properties which have an 'enum' key are valid here.
234234
- Exactly one column specification parameter chosen from:
235235
- col_period_type
@@ -532,7 +532,7 @@ def _make_choices_case(self, schema, path):
532532
filter_rule = dict(_rule_type='containment', contains=[choice])
533533
for component in filter_path:
534534
# Nest filter inside itself so we eventually get something like:
535-
# {"accidentDetails": {"severity": {"_rule_type": "containment"}}}
535+
# {"incidentDetails": {"severity": {"_rule_type": "containment"}}}
536536
tmp = dict()
537537
tmp[component] = filter_rule
538538
filter_rule = tmp

deployment/ansible/group_vars/all.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ web_js_nominatim_key: ""
4040
web_js_html5mode: "true"
4141
web_js_html5mode_prefix: "!"
4242
web_js_record_type_visible: "false"
43-
web_js_record_type_primary_label: "Accident"
43+
web_js_record_type_primary_label: "Incident"
4444
web_js_record_type_secondary_label: "Intervention"
4545
editor_js_html5mode: "true"
4646
editor_js_html5mode_prefix: "!"

schema_editor/app/scripts/views/recordtype/add-edit-partial.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h2 ng-show="rt.recordType.uuid">Edit Record Type</h2>
1010
<div class="form-group col-sm-6">
1111
<label for="single-title">Single Title</label>
1212
<input required type="text" name="label" ng-model="rt.recordType.label"
13-
class="form-control" id="single-title" placeholder="Accident"
13+
class="form-control" id="single-title" placeholder="Incident"
1414
ng-minlength="3" ng-maxlength="64" />
1515
<p ng-show="rtForm.label.$invalid && !rtForm.label.$pristine" class="help-block">
1616
Single Title is required
@@ -21,7 +21,7 @@ <h2 ng-show="rt.recordType.uuid">Edit Record Type</h2>
2121
<div class="form-group col-sm-6">
2222
<label for="plural-title">Plural Title</label>
2323
<input required type="text" name="plural_label" ng-model="rt.recordType.plural_label"
24-
class="form-control" id="plural-title" placeholder="Accidents"
24+
class="form-control" id="plural-title" placeholder="Incidents"
2525
ng-minlength="3" ng-maxlength="64" />
2626
<p ng-show="rtForm.plural_label.$invalid && !rtForm.plural_label.$pristine" class="help-block">
2727
Plural Title is required

schema_editor/app/scripts/views/recordtype/related-add-edit-partial.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2 ng-show="rtRelated.schemaKey">Edit Related Content</h2>
1212
<label for="single-title">Single Title</label>
1313
<input required type="text" name="label" ng-model="rtRelated.definition.title"
1414
ng-readonly="!!rtRelated.schemaKey"
15-
class="form-control" id="single-title" placeholder="Accident"
15+
class="form-control" id="single-title" placeholder="Incident"
1616
ng-minlength="3" ng-maxlength="64" />
1717
<p ng-show="rtForm.title.$invalid && !rtForm.title.$pristine" class="help-block">
1818
Single Title is required
@@ -23,7 +23,7 @@ <h2 ng-show="rtRelated.schemaKey">Edit Related Content</h2>
2323
<div class="form-group col-sm-6">
2424
<label for="plural-title">Plural Title</label>
2525
<input required type="text" name="plural_label" ng-model="rtRelated.definition.plural_title"
26-
class="form-control" id="plural-title" placeholder="Accidents"
26+
class="form-control" id="plural-title" placeholder="Incidents"
2727
ng-minlength="3" ng-maxlength="64" />
2828
<p ng-show="rtForm.plural_title.$invalid && !rtForm.plural_title.$pristine" class="help-block">
2929
Plural Title is required

schema_editor/test/mock/resources/resources-mocks.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
'title': '',
6262
'plural_title': '',
6363
'definitions': {
64-
'Accident Details': {
65-
'description': 'Details of accident',
66-
'title': 'Accident Details',
67-
'plural_title': 'Accident Details',
64+
'Incident Details': {
65+
'description': 'Details of incident',
66+
'title': 'Incident Details',
67+
'plural_title': 'Incident Details',
6868
'definitions': {},
6969
'type': 'object',
7070
'properties': {
@@ -89,8 +89,8 @@
8989
},
9090
'type': 'object',
9191
'properties': {
92-
'Accident Details': {
93-
'$ref': '#/definitions/Accident Details'
92+
'Incident Details': {
93+
'$ref': '#/definitions/Incident Details'
9494
},
9595
'Firearm': {
9696
'$ref': '#/definitions/Firearm'
@@ -116,9 +116,9 @@
116116
'current_schema':'80c10057-2cfc-4a32-8e3c-0573e8bf8f3f',
117117
'created':'2015-05-13T21:43:29.227598Z',
118118
'modified':'2015-05-13T21:43:29.227639Z',
119-
'label':'Accident',
120-
'plural_label':'Accidents',
121-
'description':'An accident.',
119+
'label':'Incident',
120+
'plural_label':'Incidents',
121+
'description':'An incident.',
122122
'active':true
123123
},
124124
{
@@ -150,11 +150,11 @@
150150

151151
var RecordSchemaRequest = angular.extend({}, RecordType, {
152152
definitions: {
153-
'Accident Details': {
153+
'Incident Details': {
154154
type: 'object',
155-
title: 'Accident Details',
156-
plural_title: 'Accident Details',
157-
description: 'Details for Accident',
155+
title: 'Incident Details',
156+
plural_title: 'Incident Details',
157+
description: 'Details for Incident',
158158
multiple: false,
159159
propertyOrder: 0,
160160
details: true

schema_editor/test/spec/views/recordtype/add-controller.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ describe('ase.views.recordtype: AddController', function () {
3535

3636
/* jshint camelcase: false */
3737
var recordType = {
38-
label: 'Accident',
39-
plural_label: 'Accidents',
40-
description: 'An Accident'
38+
label: 'Incident',
39+
plural_label: 'Incidents',
40+
description: 'An Incident'
4141
};
4242

4343
var recordSchema = {
@@ -48,19 +48,19 @@ describe('ase.views.recordtype: AddController', function () {
4848
plural_title: '',
4949
description: '',
5050
properties: {
51-
'accidentDetails': {
52-
$ref: '#/definitions/accidentDetails',
51+
'incidentDetails': {
52+
$ref: '#/definitions/incidentDetails',
5353
options: {
5454
collapsed: true
5555
}
5656
}
5757
},
5858
definitions: {
59-
'accidentDetails': {
59+
'incidentDetails': {
6060
type: 'object',
61-
title: 'Accident Details',
62-
plural_title: 'Accident Details',
63-
description: 'Details for Accident',
61+
title: 'Incident Details',
62+
plural_title: 'Incident Details',
63+
description: 'Details for Incident',
6464
multiple: false,
6565
propertyOrder: 0,
6666
properties: {},

schema_editor/test/spec/views/recordtype/add-directive.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ describe('ase.views.recordtype: RTAdd', function () {
3838

3939
// Save button should be disabled until all the required fields are entered
4040
checkSaveButtonDisabled(true);
41-
element.find('#single-title').val('Accident').change();
41+
element.find('#single-title').val('Incident').change();
4242
checkSaveButtonDisabled(true);
43-
element.find('#plural-title').val('Accidents').change();
43+
element.find('#plural-title').val('Incidents').change();
4444
checkSaveButtonDisabled(true);
45-
element.find('#description').val('An accident').change();
45+
element.find('#description').val('An incident').change();
4646
checkSaveButtonDisabled(false);
4747

4848
// All required fields are entered, press Save and verify it's submitted

0 commit comments

Comments
 (0)