Skip to content

Commit

Permalink
Merge branch 'master' into ALC-CSV-Importer
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-walsh22 authored Sep 8, 2023
2 parents 9e11a2c + 4ed3b85 commit 13d77eb
Show file tree
Hide file tree
Showing 9 changed files with 710 additions and 243 deletions.
2 changes: 1 addition & 1 deletion angular/projects/admin-nrpti/src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// This is a hardcoded variable that does not come from the backend
window.__env.APPLICATION = 'NRPTI';
window.__env.FEATURE_FLAG = {
"nris-emli-importer": false
"nris-emli-importer": true
};

// Import component defaults
Expand Down
5 changes: 5 additions & 0 deletions angular/projects/common/src/app/utils/record-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,12 @@ export class Picklists {
'Park Act': {
'17': {
description: 'Park Act Order'
}, // nrpti-1085: Add new legislation description for orders
'Park, Conservancy and Recreation Area Regulation' : {
'9': {
description: 'Order to leave a park, conservancy or recreation area'
}
}
},
'Wildfire Act': {
'7': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export class RecordsTableRowComponent extends TableRowComponent implements OnIni
if (this.rowData.legislation && this.rowData.legislation[0] && this.rowData.legislation[0].offence) {
this.description = this.rowData.legislation[0].offence || '-';
}
}else {

} else {
if (this.rowData.legislation &&
this.rowData.legislation[0] &&
this.rowData.legislation[0].legislationDescription
Expand Down
900 changes: 673 additions & 227 deletions api/package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@
"reportPath": "coverage"
},
"dependencies": {
"aws-sdk": "^2.613.0",
"axios": "^0.21.1",
"body-parser": "1.19.0",
"aws-sdk": "^2.1429.0",
"axios": "^0.21.4",
"body-parser": "^1.20.2",
"cheerio": "^1.0.0-rc.3",
"clamav.js": "0.12.0",
"compression": "^1.7.4",
"csvtojson": "2.0.10",
"db-migrate": "^0.11.6",
"db-migrate": "^0.11.13",
"db-migrate-mongodb": "1.5.0",
"express": "4.17.1",
"express": "^4.18.2",
"jwks-rsa": "1.6.0",
"moment": "2.24.0",
"moment-timezone": "^0.5.32",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"mongoose": "5.7.7",
"qs": "6.9.0",
"qs": "^6.11.2",
"stream": "0.0.2",
"swagger-tools": "0.10.4",
"winston": "2.4.4",
Expand All @@ -81,7 +81,7 @@
"nock": "11.4.0",
"npm-run-all": "^4.1.5",
"prettier": "~1.19.1",
"shelljs": "0.8.3",
"shelljs": "^0.8.5",
"supertest": "^4.0.2"
}
}
4 changes: 3 additions & 1 deletion api/src/importers/alc/utils/csv-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ exports.getOutcomeDescription = function(csvRow) {
* @returns {string} the entity type.
*/
exports.getEntityType = function(csvRow) {
let options = [" Ltd.", " Ltd", " Inc.", " Inc", " Corp.", " Corp"];

let options = ["Ltd.", "Ltd", "Inc.", "Inc", "Corp.", "Corp"];


function endsWithBusinessType(value, endings){
for (const ending of endings) {
Expand Down
14 changes: 13 additions & 1 deletion api/src/importers/coors/utils/csv-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,24 @@ exports.getIssuingAgency = function(csvRow) {
return null;
}


// csv import specific business logic, see https://bcmines.atlassian.net/browse/NRPT-78
if (caseNum.toLowerCase().startsWith('p-')) {
return MiscConstants.CoorsCsvIssuingAgencies.BC_Parks;
}

let act = '';
if (csvRow['act']) {
act = csvRow['act'];
} else {
return null;
}

// Act == Water Sustainability Act, in which case Issuing Agency = BC Energy Regulator
if (act.toLowerCase() == 'water sustainability act') {
return MiscConstants.CoorsCsvIssuingAgencies.Water_Sustainability_Act;
}

// Otherwise the issuing agency defaults to Conservation Officer Service
return MiscConstants.CoorsCsvIssuingAgencies.Conservation_Officer_Service;
};

Expand Down
5 changes: 3 additions & 2 deletions api/src/utils/constants/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ exports.IssuedToEntityTypes = {

exports.CoorsCsvIssuingAgencies = {
BC_Parks: 'BC Parks',
Conservation_Officer_Service: 'BC Energy Regulator'
Conservation_Officer_Service: 'Conservation Officer Service',
Water_Sustainability_Act: 'BC Energy Regulator'
};

exports.EpicProjectIds = {
Expand Down Expand Up @@ -193,4 +194,4 @@ exports.CSV_SOURCE_DEFAULT_ROLES = {
'agri-mis-csv': [ApplicationRoles.ADMIN_AGRI],
'alc-csv': [ApplicationRoles.ADMIN_ALC],
'ams-csv': [ApplicationRoles.ADMIN_ENV_EPD]
};
};
2 changes: 1 addition & 1 deletion tools/api/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ objects:
value: 'true'
# Toggle to enable NRIS-EMLI importer
- name: NRIS_EMLI_DOCUMENT_BINARIES_ENABLED
value: 'false'
value: 'true'
- name: NRIS_EMLI_API_ENDPOINT
value: 'https://api.nrs.gov.bc.ca/nrisws-api/v1/emprInspections'
envFrom:
Expand Down

0 comments on commit 13d77eb

Please sign in to comment.