Skip to content

Commit 4e56f96

Browse files
authored
NRPT-143: Fix misaligned LNG / CGL ID's (#391)
1 parent 2ee714c commit 4e56f96

File tree

7 files changed

+119
-54
lines changed

7 files changed

+119
-54
lines changed

angular/projects/admin-nrpti/src/app/news/news-add-edit/news-add-edit.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export class NewsAddEditComponent implements OnInit, OnDestroy {
3333
// Pick lists
3434
public projects = [{
3535
id: '588510cdaaecd9001b815f84',
36-
name: 'Coastal Gaslink'
36+
name: 'LNG Canada'
3737
},
3838
{
3939
id: '588511c4aaecd9001b825604',
40-
name: 'LNG Canada'
40+
name: 'Coastal Gaslink'
4141
}];
4242

4343
constructor(

angular/projects/common/src/app/utils/record-constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Utils } from './utils';
22
import { Legislation } from '../models/master/common-models/legislation';
33

44
export class EpicProjectIds {
5-
public static readonly lngCanadaId = '588511c4aaecd9001b825604';
6-
public static readonly coastalGaslinkId = '588510cdaaecd9001b815f84';
5+
public static readonly lngCanadaId = '588510cdaaecd9001b815f84';
6+
public static readonly coastalGaslinkId = '588511c4aaecd9001b825604';
77
}
88

99
/**

angular/projects/public-lng/src/app/project/overview/overview.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
5555
'-date', // tableObject.sortBy,
5656
{
5757
// Select either LNG Canada or Coastal Gaslink based on route.
58-
_epicProjectId: this.id === '1' ? '588511c4aaecd9001b825604' : '588510cdaaecd9001b815f84'
58+
_epicProjectId: this.id === '1' ? '588510cdaaecd9001b815f84' : '588511c4aaecd9001b825604'
5959
},
6060
false
6161
)

angular/projects/public-lng/src/app/services/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export class ApiService {
4848
getProjectObjectId(value: string) {
4949
try {
5050
if (value === '1') {
51-
return '588511c4aaecd9001b825604'; // LNG Canada
51+
return '588510cdaaecd9001b815f84'; // LNG Canada
5252
} else {
53-
return '588510cdaaecd9001b815f84'; // Coastal Gaslink
53+
return '588511c4aaecd9001b825604'; // Coastal Gaslink
5454
}
5555
} catch (e) {
5656
console.log('error:', e);

api/migrations/20200109220142-projectData.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ exports.up = async function (db) {
4242
for (const item of activities) {
4343
// Which project?
4444
if (item.url.startsWith('/project/1')) {
45-
promises.push(createActivityRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
46-
} else {
4745
promises.push(createActivityRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
46+
} else {
47+
promises.push(createActivityRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
4848
}
4949
}
5050

@@ -53,10 +53,10 @@ exports.up = async function (db) {
5353
case 'Letter':
5454
case 'Report':
5555
case 'Certificate':
56-
promises.push(createCertificateRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
56+
promises.push(createCertificateRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
5757
break;
5858
case 'Permit':
59-
promises.push(createPermitRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
59+
promises.push(createPermitRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
6060
break;
6161
default:
6262
console.log('-------------------')
@@ -69,21 +69,21 @@ exports.up = async function (db) {
6969
for (const item of project1Compliances) {
7070
switch (item.complianceDocumentType) {
7171
case 'Inspection':
72-
promises.push(createInspectionRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
72+
promises.push(createInspectionRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
7373
break;
7474
case 'Memo':
7575
case 'Letter':
7676
case 'Self Report':
7777
case 'Compliance Self-Report':
78-
promises.push(createComplianceSelfReportRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
78+
promises.push(createComplianceSelfReportRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
7979
break;
8080
case 'Enforcement Action':
8181
case 'Order':
82-
promises.push(createOrderRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
82+
promises.push(createOrderRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
8383
break;
8484
case 'Warning Letter':
8585
case 'Warning':
86-
promises.push(createWarningRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
86+
promises.push(createWarningRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
8787
break;
8888
default:
8989
console.log('-------------------')
@@ -94,18 +94,18 @@ exports.up = async function (db) {
9494
}
9595

9696
for (const item of project1Nations) {
97-
promises.push(createAgreementRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
97+
promises.push(createAgreementRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
9898
}
9999

100100
for (const item of project1Plans) {
101101
switch (item.complianceDocumentType || item.type) {
102102
case 'Construction':
103103
case 'Construction Plan':
104-
promises.push(createConstructionPlanRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
104+
promises.push(createConstructionPlanRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
105105
break;
106106
case 'Management':
107107
case 'Management Plan':
108-
promises.push(createManagementPlanRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
108+
promises.push(createManagementPlanRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
109109
break;
110110
default:
111111
console.log('-------------------')
@@ -120,10 +120,10 @@ exports.up = async function (db) {
120120
case 'Letter':
121121
case 'Report':
122122
case 'Certificate':
123-
promises.push(createCertificateRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
123+
promises.push(createCertificateRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
124124
break;
125125
case 'Permit':
126-
promises.push(createPermitRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
126+
promises.push(createPermitRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
127127
break;
128128
default:
129129
console.log('-------------------')
@@ -136,21 +136,21 @@ exports.up = async function (db) {
136136
for (const item of project2Compliances) {
137137
switch (item.complianceDocumentType) {
138138
case 'Inspection':
139-
promises.push(createInspectionRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
139+
promises.push(createInspectionRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
140140
break;
141141
case 'Memo':
142142
case 'Letter':
143143
case 'Self Report':
144144
case 'Compliance Self-Report':
145-
promises.push(createComplianceSelfReportRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
145+
promises.push(createComplianceSelfReportRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
146146
break;
147147
case 'Enforcement Action':
148148
case 'Order':
149-
promises.push(createOrderRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
149+
promises.push(createOrderRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
150150
break;
151151
case 'Warning Letter':
152152
case 'Warning':
153-
promises.push(createWarningRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
153+
promises.push(createWarningRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
154154
break;
155155
default:
156156
console.log('-------------------')
@@ -161,19 +161,19 @@ exports.up = async function (db) {
161161
}
162162

163163
for (const item of project2Nations) {
164-
promises.push(createAgreementRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
164+
promises.push(createAgreementRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
165165
}
166166

167167
for (const item of project2Plans) {
168168
switch (item.complianceDocumentType || item.type) {
169169
case 'Permit':
170170
case 'Construction':
171171
case 'Construction Plan':
172-
promises.push(createConstructionPlanRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
172+
promises.push(createConstructionPlanRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
173173
break;
174174
case 'Management':
175175
case 'Management Plan':
176-
promises.push(createManagementPlanRecord(item, '588510cdaaecd9001b815f84', nrptiCollection));
176+
promises.push(createManagementPlanRecord(item, '588511c4aaecd9001b825604', nrptiCollection));
177177
break;
178178
default:
179179
console.log('-------------------')
@@ -207,7 +207,7 @@ let createActivityRecord = async function (item, project, nrptiCollection) {
207207
title: item.title,
208208
url: item.url,
209209
description: item.description,
210-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
210+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
211211
// Prefer to store dates in the DB as ISO, not some random format.
212212
date: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null
213213
}
@@ -236,7 +236,7 @@ let createAgreementRecord = async function (item, project, nrptiCollection) {
236236
// Prefer to store dates in the DB as ISO, not some random format.
237237
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
238238
nationName: item.nation,
239-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
239+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
240240
documents: documents,
241241

242242
description: item.description,
@@ -272,7 +272,7 @@ let createAgreementRecord = async function (item, project, nrptiCollection) {
272272
// Prefer to store dates in the DB as ISO, not some random format.
273273
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
274274
nationName: item.nation,
275-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
275+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
276276
documents: documents,
277277

278278
dateAdded: new Date(),
@@ -310,7 +310,7 @@ let createManagementPlanRecord = async function (item, project, nrptiCollection)
310310
// Prefer to store dates in the DB as ISO, not some random format.
311311
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
312312
issuingAgency: item.agency,
313-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
313+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
314314
documents: documents,
315315

316316
relatedPhase: item.phase || item.complianceDocumentSubtype,
@@ -347,7 +347,7 @@ let createManagementPlanRecord = async function (item, project, nrptiCollection)
347347
// Prefer to store dates in the DB as ISO, not some random format.
348348
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
349349
issuingAgency: item.agency,
350-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
350+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
351351
documents: documents,
352352

353353
dateAdded: new Date(),
@@ -385,7 +385,7 @@ let createConstructionPlanRecord = async function (item, project, nrptiCollectio
385385
// Prefer to store dates in the DB as ISO, not some random format.
386386
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
387387
issuingAgency: item.agency,
388-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
388+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
389389
documents: documents,
390390

391391
relatedPhase: item.phase || item.complianceDocumentSubtype,
@@ -423,7 +423,7 @@ let createConstructionPlanRecord = async function (item, project, nrptiCollectio
423423
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
424424
issuingAgency: item.agency,
425425
documents: documents,
426-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
426+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
427427

428428
dateAdded: new Date(),
429429
dateUpdated: new Date(),
@@ -461,7 +461,7 @@ let createWarningRecord = async function (item, project, nrptiCollection) {
461461
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
462462
issuingAgency: item.agency,
463463
author: item.author,
464-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
464+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
465465
documents: documents,
466466

467467
description: item.description,
@@ -500,7 +500,7 @@ let createWarningRecord = async function (item, project, nrptiCollection) {
500500
issuingAgency: item.agency,
501501
documents: documents,
502502
author: item.author,
503-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
503+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
504504

505505
dateAdded: new Date(),
506506
dateUpdated: new Date(),
@@ -538,7 +538,7 @@ let createComplianceSelfReportRecord = async function (item, project, nrptiColle
538538
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
539539
issuingAgency: item.agency,
540540
author: item.author,
541-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
541+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
542542
documents: documents,
543543

544544
relatedPhase: item.phase,
@@ -577,7 +577,7 @@ let createComplianceSelfReportRecord = async function (item, project, nrptiColle
577577
issuingAgency: item.agency,
578578
documents: documents,
579579
author: item.author,
580-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
580+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
581581

582582
dateAdded: new Date(),
583583
dateUpdated: new Date(),
@@ -615,7 +615,7 @@ let createCertificateRecord = async function (item, project, nrptiCollection) {
615615
// Prefer to store dates in the DB as ISO, not some random format.
616616
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
617617
issuingAgency: item.agency,
618-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
618+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
619619
documents: documents,
620620

621621
description: item.description,
@@ -653,7 +653,7 @@ let createCertificateRecord = async function (item, project, nrptiCollection) {
653653
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
654654
issuingAgency: item.agency,
655655
documents: documents,
656-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
656+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
657657

658658
dateAdded: new Date(),
659659
dateUpdated: new Date(),
@@ -691,7 +691,7 @@ let createPermitRecord = async function (item, project, nrptiCollection) {
691691
// Prefer to store dates in the DB as ISO, not some random format.
692692
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
693693
issuingAgency: item.agency,
694-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
694+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
695695
documents: documents,
696696

697697
description: item.description,
@@ -729,7 +729,7 @@ let createPermitRecord = async function (item, project, nrptiCollection) {
729729
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
730730
issuingAgency: item.agency,
731731
documents: documents,
732-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
732+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
733733

734734
dateAdded: new Date(),
735735
dateUpdated: new Date(),
@@ -768,7 +768,7 @@ let createOrderRecord = async function (item, project, nrptiCollection) {
768768
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
769769
issuingAgency: item.agency,
770770
author: item.author,
771-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
771+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
772772
documents: documents,
773773

774774
description: item.description,
@@ -807,7 +807,7 @@ let createOrderRecord = async function (item, project, nrptiCollection) {
807807
issuingAgency: item.agency,
808808
documents: documents,
809809
author: item.author,
810-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
810+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
811811

812812
dateAdded: new Date(),
813813
dateUpdated: new Date(),
@@ -844,7 +844,7 @@ let createInspectionRecord = async function (item, project, nrptiCollection) {
844844
dateIssued: item.date && moment(item.date, 'DD-MM-YYYY').toDate() || null,
845845
issuingAgency: item.agency,
846846
author: item.author,
847-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
847+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
848848
documents: documents,
849849

850850
description: item.description,
@@ -882,7 +882,7 @@ let createInspectionRecord = async function (item, project, nrptiCollection) {
882882
issuingAgency: item.agency,
883883
documents: documents,
884884
author: item.author,
885-
projectName: project === '588511c4aaecd9001b825604' ? 'LNG Canada' : 'Coastal Gaslink',
885+
projectName: project === '588511c4aaecd9001b825604' ? 'Coastal Gaslink' : 'LNG Canada',
886886

887887
dateAdded: new Date(),
888888
dateUpdated: new Date(),

0 commit comments

Comments
 (0)