Skip to content

Commit

Permalink
Merge branch 'branch-2.4.0' into feature/WFNEWS-2493
Browse files Browse the repository at this point in the history
  • Loading branch information
ssylver93 authored Dec 17, 2024
2 parents bca4cff + df7c349 commit 13575d0
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="info"><img height="20" width="20" class="icon" src="/assets/images/svg-icons/location-pin.svg"
alt="Location Pin" />{{restrictionData?.fireCentre}}</div>
<div class="info"><img height="20" width="20" class="icon" src="/assets/images/svg-icons/carbon_calendar.svg"
alt="Calendar" />Discovered on {{incident.discoveryDate}}<img height="20" width="20" class="arrow-button"
alt="Calendar" />Discovered on {{incident.discoveryDate}}<img height="20" width="20" class="arrow-button" (click)="navToIncident(incident)"
alt="icon" src="/assets/images/svg-icons/forward-arrow-grey.svg"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
import { Router as Route } from '@angular/router';
import { Router } from '@angular/router';
import { LocationData } from '@app/components/wildfires-list-header/filter-by-location/filter-by-location-dialog.component';
import { AGOLService, AgolOptions } from '@app/services/AGOL-service';
import { PublishedIncidentService } from '@app/services/published-incident-service';
Expand Down Expand Up @@ -57,10 +57,11 @@ export class AreaRestrictionsFullDetailsComponent implements OnInit {
private appConfigService: AppConfigService,
private agolService: AGOLService,
private publishedIncidentService: PublishedIncidentService,
private route: Route,
private watchlistService: WatchlistService,
private commonUtilityService: CommonUtilityService,
private metaService: Meta,
protected router: Router,

) {}

async ngOnInit(): Promise<void> {
Expand Down Expand Up @@ -182,6 +183,18 @@ export class AreaRestrictionsFullDetailsComponent implements OnInit {
}
this.cdr.detectChanges();
}
navToIncident(incident: any) {
this.router.navigate([ResourcesRoutes.PUBLIC_INCIDENT], {
queryParams: {
fireYear: incident.fireYear,
incidentNumber: incident.incidentNumberLabel,
source: [ResourcesRoutes.FULL_DETAILS],
sourceId: this.id,
sourceType: 'area-restriction',
name: this.name
},
});
}

async populateAreaRestrictionByID(options: AgolOptions = null) {
this.restrictionData = null;
Expand Down Expand Up @@ -230,7 +243,7 @@ export class AreaRestrictionsFullDetailsComponent implements OnInit {

navToMap() {
setTimeout(() => {
this.route.navigate([ResourcesRoutes.ACTIVEWILDFIREMAP], {
this.router.navigate([ResourcesRoutes.ACTIVEWILDFIREMAP], {
queryParams: {
longitude: this.restrictionData.centroidLongitude,
latitude: this.restrictionData.centroidLatitude,
Expand Down Expand Up @@ -268,7 +281,8 @@ export class AreaRestrictionsFullDetailsComponent implements OnInit {
}

navToBulletinUrl() {
window.open(this.restrictionData.bulletinUrl ? this.restrictionData.bulletinUrl : this.appConfigService.getConfig().externalAppConfig['currentRestrictions'] as unknown as string, '_blank');
window.open(this.restrictionData.bulletinUrl ? this.restrictionData.bulletinUrl
: this.appConfigService.getConfig().externalAppConfig['currentRestrictions'] as unknown as string, '_blank');
}

onWatchlist(incident): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<warning-card></warning-card>
</ng-container>
<ng-container column-2>
<associated-wildfire-card *ngIf="incident" [incident]="incident" [isBookmarked]="isBookmarked"
(bookmarkClicked)="handleBookmarkClicked($event)"
(viewDetailsClicked)="handleViewDetailsClicked()">
</associated-wildfire-card>
<related-topics-card [links]="relatedTopicLinks"></related-topics-card>
</ng-container>
</two-column-content-cards-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Component, Input } from '@angular/core';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { AdvisorySectionStyle } from '@app/components/common/advisory-section/advisory-section.component';
import { IconButtonArgs } from '@app/components/common/icon-button/icon-button.component';
import { RelatedTopicsLink } from '@app/components/full-details/cards/related-topics-card/related-topics-card.component';
import { SimpleIncident } from '@app/services/published-incident-service';
import { AppConfigService } from '@wf1/core-ui';

@Component({
Expand All @@ -12,6 +13,13 @@ import { AppConfigService } from '@wf1/core-ui';
export class AreaRestrictionDetailsComponent {

@Input() areaRestriction: any;
@Input() incident: SimpleIncident;
@Input() isBookmarked: boolean;


@Output() bookmarkClicked = new EventEmitter<boolean>();

@Output() viewDetailsClicked = new EventEmitter<void>();

advisorySectionComponentStyle: AdvisorySectionStyle = {
backgroundColor: '#F0F5FF',
Expand Down Expand Up @@ -63,4 +71,13 @@ export class AreaRestrictionDetailsComponent {
handleAdvisoryClick = () => {
window.open(this.getBulletinLink(), '_blank');
};

handleBookmarkClicked = ($event) => {
this.bookmarkClicked.emit($event);
};

handleViewDetailsClicked = () => {
this.viewDetailsClicked.emit();
};

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
(viewDetailsClicked)="handleViewDetailsClicked()"
></evac-order-details>
<area-restriction-details *ngSwitchCase="'area-restriction'"
[incident]="incident"
[areaRestriction]="areaRestriction"
[isBookmarked]="isAssociatedWildfireBookmarked"
(bookmarkClicked)="handleBookmarkClicked($event)"
(viewDetailsClicked)="handleViewDetailsClicked()"
></area-restriction-details>
<fire-ban-details *ngSwitchCase="'ban'"
[fireBan]="ban"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class PublicEventPageComponent {
public id : string;
public eventName: string;
public evac: string;
public areaRestriction: string;
public areaRestriction: any;
public ban: string;
public dangerRating: string;
public incident: SimpleIncident;
Expand Down Expand Up @@ -88,10 +88,27 @@ export class PublicEventPageComponent {
},
)
.toPromise()
.then((response) => {
.then(async (response) => {
if (response?.features?.length > 0 && response?.features[0].geometry?.rings?.length > 0) {
this.areaRestriction = response.features[0];
this.isLoading = false;
if (this.areaRestriction) {
const restrictionPolygon = this.areaRestriction.geometry.rings;
try {
this.incident =
await this.publishedIncidentService.populateIncidentByPoint(
restrictionPolygon,
);
this.isAssociatedWildfireBookmarked = this.onWatchlist(this.incident);
this.cdr.detectChanges();
} catch (error) {
console.error(
'Error while populating associated incident for area restriction: ' +
error,
);
}

}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class PublicIncidentPageComponent implements OnInit {
} else if (event?.tab?.textLabel === 'Gallery') {
actionName = 'incident_details_gallery_click';
} else if (event?.tab?.textLabel === 'Maps') {
actionName = 'incident_ details_maps_click';
actionName = 'incident_details_maps_click';
}
this.snowPlowHelper(url, {
action: actionName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ export class CommonUtilityService {
const currentUrl = this.appConfigService.getConfig().application.baseUrl.toString() + this.router.url.slice(1);
// contents of the share is out of scope for wfnews-2403. Enhancment should be available in wfnews-2422
const imageUrl = this.appConfigService.getConfig().application.baseUrl.toString() + '/assets/images/share-wildfire.png';
document.querySelector('meta[property="og:title"]')?.setAttribute('content', `${shareTitle}`);

Share.share({
title: shareTitle,
text: 'Share the incident update',
url: currentUrl,
dialogTitle: 'Share Wildfire News Link',
}).then(() => {
Expand Down

0 comments on commit 13575d0

Please sign in to comment.