-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WFNEWS-2277 : Use redirect for links to event page and formatting #1989
Merged
+477
−469
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import { Component } from '@angular/core'; | |
import { Router } from '@angular/router'; | ||
import { MapUtilityService } from '@app/components/preview-panels/map-share-service'; | ||
import { AGOLService } from '@app/services/AGOL-service'; | ||
import { CapacitorService } from '@app/services/capacitor-service'; | ||
import { CommonUtilityService } from '@app/services/common-utility.service'; | ||
import { ResourcesRoutes, formatDate, getActiveMap, hidePanel, showPanel } from '@app/utils'; | ||
|
||
|
@@ -12,28 +13,31 @@ import { ResourcesRoutes, formatDate, getActiveMap, hidePanel, showPanel } from | |
}) | ||
export class DangerRatingPreviewComponent { | ||
|
||
public data; | ||
formatDate = formatDate; | ||
|
||
constructor( | ||
private router: Router, | ||
private agolService: AGOLService, | ||
private commonUtilityService: CommonUtilityService, | ||
private mapUtilityService: MapUtilityService | ||
) {} | ||
private mapUtilityService: MapUtilityService, | ||
private capacitorService: CapacitorService, | ||
) { } | ||
|
||
|
||
public data; | ||
formatDate = formatDate | ||
setContent(data) { | ||
this.data = data.properties; | ||
} | ||
|
||
closePanel() { | ||
closePanel() { | ||
hidePanel('desktop-preview'); | ||
} | ||
goBack(){ | ||
showPanel('identify-panel-wrapper') | ||
goBack() { | ||
showPanel('identify-panel-wrapper'); | ||
hidePanel('desktop-preview'); | ||
} | ||
|
||
enterFullDetail(){ | ||
enterFullDetail() { | ||
const url = this.router.serializeUrl( | ||
this.router.createUrlTree([ResourcesRoutes.PUBLIC_EVENT], { | ||
queryParams: { | ||
|
@@ -44,44 +48,43 @@ export class DangerRatingPreviewComponent { | |
}, | ||
}), | ||
); | ||
window.open(url, '_blank'); | ||
this.capacitorService.redirect(url, true); | ||
} | ||
|
||
zoomIn(level?: number, polygon?: boolean){ | ||
zoomIn(level?: number, polygon?: boolean) { | ||
const viewer = getActiveMap().$viewer; | ||
let long; | ||
let lat; | ||
this.data; | ||
this.agolService | ||
.getDangerRatings( | ||
`PROT_DR_SYSID ='${this.data.PROT_DR_SYSID}'`, | ||
null, | ||
{ | ||
returnGeometry: true, | ||
}, | ||
) | ||
.toPromise() | ||
.then((response) => { | ||
if (response?.features?.length > 0 && response?.features[0].geometry?.rings?.length > 0){ | ||
const polygonData = this.commonUtilityService.extractPolygonData(response.features[0].geometry.rings); | ||
if (polygonData?.length) { | ||
this.mapUtilityService.fixPolygonToMap(polygonData, response.features[0].geometry.rings); | ||
.getDangerRatings( | ||
`PROT_DR_SYSID ='${this.data.PROT_DR_SYSID}'`, | ||
null, | ||
{ | ||
returnGeometry: true, | ||
}, | ||
) | ||
.toPromise() | ||
.then((response) => { | ||
if (response?.features?.length > 0 && response?.features[0].geometry?.rings?.length > 0) { | ||
const polygonData = this.commonUtilityService.extractPolygonData(response.features[0].geometry.rings); | ||
if (polygonData?.length) { | ||
this.mapUtilityService.fixPolygonToMap(polygonData, response.features[0].geometry.rings); | ||
|
||
} | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
|
||
displayDangerRatingDes(danger) { | ||
switch (danger) { | ||
case 'Extreme': | ||
// eslint-disable-next-line max-len | ||
return 'Extremely high risk of fire starting. Forest fuels are extremely dry and the fire risk is very serious. Fires can start easily, spread rapidly, and challenge fire suppression efforts. Forest activities may be restricted.'; | ||
case 'High': | ||
return 'Serious risk of fire starting. Forest fuels are very dry and extreme caution must be used.'; | ||
case 'Moderate': | ||
return 'Moderate risk of fire starting. Forest fuels are dry and caution should be exercised in forested areas.'; | ||
case 'Low': | ||
// eslint-disable-next-line max-len | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this line |
||
return 'Low risk of fire starting. Fires are unlikely to involve deeper fuel layers or larger fuels. Fire is still possible, so be prepared for conditions to change.'; | ||
case 'Very Low': | ||
return 'Very low risk of fire starting.'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed