Skip to content

Commit 7b25f67

Browse files
authored
Change from incidentLabel to incidentGuid (#2209)
1 parent fae9dc7 commit 7b25f67

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

client/wfnews-war/src/main/angular/src/app/components/public-incident-page/incident-gallery-panel/incident-gallery-panel-mobile/incident-gallery-panel-mobile.component.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
2-
import { AppConfigService } from '@wf1/core-ui';
3-
import { PublishedIncidentService } from '../../../../services/published-incident-service';
42
import { ActivatedRoute } from '@angular/router';
3+
import { AppConfigService } from '@wf1/core-ui';
4+
import { InitDetail } from 'lightgallery/lg-events';
55
import { LightGallery } from 'lightgallery/lightgallery';
6+
import { PublishedIncidentService } from '../../../../services/published-incident-service';
67
import { convertToMobileFormat, convertToYoutubeId } from '../../../../utils';
7-
import { InitDetail } from 'lightgallery/lg-events';
88

99
@Component({
1010
selector: 'incident-gallery-panel-mobile',
@@ -35,7 +35,7 @@ export class IncidentGalleryPanelMobileComponent implements OnInit {
3535
private appConfigService: AppConfigService,
3636
private cdr: ChangeDetectorRef,
3737
private router: ActivatedRoute,
38-
) {}
38+
) { }
3939

4040
ngAfterViewChecked(): void {
4141
if (this.refreshGallery && this.lightGallery) {
@@ -69,7 +69,7 @@ export class IncidentGalleryPanelMobileComponent implements OnInit {
6969
this.allImagesAndVideosStub = [];
7070
// fetch the Videos
7171
this.publishedIncidentService
72-
.fetchExternalUri(this.incident.incidentNumberLabel)
72+
.fetchExternalUri(this.incident.incidentGuid)
7373
.toPromise()
7474
.then((results) => {
7575
if (results?.collection && results.collection.length > 0) {
@@ -78,7 +78,7 @@ export class IncidentGalleryPanelMobileComponent implements OnInit {
7878

7979
// fetch image attachments
8080
this.publishedIncidentService
81-
.fetchPublishedIncidentAttachments(this.incident.incidentNumberLabel)
81+
.fetchPublishedIncidentAttachments(this.incident.incidentGuid)
8282
.toPromise()
8383
.then((results) => {
8484
// Loop through the attachments, for each one, create a ref, and set href to the bytes
@@ -169,16 +169,12 @@ export class IncidentGalleryPanelMobileComponent implements OnInit {
169169
fileName: attachment.attachmentFileName,
170170
primary: attachment.primary.toString(),
171171
type: 'image',
172-
href: `${
173-
this.appConfigService.getConfig().rest['wfnews']
174-
}/publicPublishedIncidentAttachment/${
175-
this.incident.incidentNumberLabel
176-
}/attachments/${attachment.attachmentGuid}/bytes`,
177-
thumbnail: `${
178-
this.appConfigService.getConfig().rest['wfnews']
179-
}/publicPublishedIncidentAttachment/${
180-
this.incident.incidentNumberLabel
181-
}/attachments/${attachment.attachmentGuid}/bytes?thumbnail=true`,
172+
href: `${this.appConfigService.getConfig().rest['wfnews']
173+
}/publicPublishedIncidentAttachment/${this.incident.incidentNumberLabel
174+
}/attachments/${attachment.attachmentGuid}/bytes`,
175+
thumbnail: `${this.appConfigService.getConfig().rest['wfnews']
176+
}/publicPublishedIncidentAttachment/${this.incident.incidentNumberLabel
177+
}/attachments/${attachment.attachmentGuid}/bytes?thumbnail=true`,
182178
});
183179
}
184180
}

client/wfnews-war/src/main/angular/src/app/components/public-incident-page/incident-info-panel/incident-info-panel.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,7 @@ export class IncidentInfoPanelComponent implements AfterViewInit, OnChanges {
222222
// fetch image attachments
223223
this.publishedIncidentService
224224
.fetchPublishedIncidentAttachments(
225-
this.incident.incidentNumberLabel
226-
? this.incident.incidentNumberLabel
227-
: this.incident.incidentNumberLabelFull,
225+
this.incident.incidentGuid,
228226
)
229227
.toPromise()
230228
.then((attachments) => {

client/wfnews-war/src/main/angular/src/app/components/public-incident-page/public-incident-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class PublicIncidentPageComponent implements OnInit {
148148
await this.getAreaRestrictions();
149149

150150
this.publishedIncidentService
151-
.fetchPublishedIncidentAttachments(this.incident.incidentNumberLabelFull)
151+
.fetchPublishedIncidentAttachments(this.incident.incidentGuid)
152152
.toPromise()
153153
.then((results) => {
154154
if (results?.collection?.length > 0) {
@@ -158,7 +158,7 @@ export class PublicIncidentPageComponent implements OnInit {
158158
});
159159

160160
this.publishedIncidentService
161-
.fetchAttachments(this.incident.incidentNumberLabelFull)
161+
.fetchAttachments(this.incident.incidentGuid)
162162
.toPromise()
163163
.then((docs) => {
164164
// remove any non-image types

0 commit comments

Comments
 (0)