Skip to content

Commit

Permalink
Css cleanup for evac
Browse files Browse the repository at this point in the history
  • Loading branch information
dhlevi committed Oct 14, 2023
1 parent d3a9ed1 commit 0627692
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export class BansWidget implements OnInit, AfterViewInit {
this.startupComplete = true
this.cdr.detectChanges()

console.log(cat1sld, cat2sld, cat3sld)

// Create map and append data to the map component
const southWest = L.latLng(60.2, -116),
northEast = L.latLng(49, -136.3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<div class="content" *ngIf="startupComplete; else loading">
<div class="counts-box">
<div class="stat-box">
<img height="36" width="36" src="/assets/images/svg-icons/evacuation-order.svg" alt="Order" class="stat-box-icon" />
<span class="stat-box-label">Total Evacuation Orders</span>
<div class="stat-text">
<span class="stat-box-label">Total Evacuation Orders</span>
<img height="36" width="36" src="/assets/images/svg-icons/evacuation-order.svg" alt="Order" class="stat-box-icon" />
<span class="stat-box-data">{{evacOrders}}</span>
</div>
</div>
<div class="stat-box">
<img height="36" width="36" src="/assets/images/svg-icons/evacuation-alert.svg" alt="Alert" class="stat-box-icon" />
<span class="stat-box-label">Total Evacuation Alerts</span>
<div class="stat-text">
<span class="stat-box-label">Total Evacuation Alerts</span>
<img height="36" width="36" src="/assets/images/svg-icons/evacuation-alert.svg" alt="Alert" class="stat-box-icon" />
<span class="stat-box-data">{{evacAlerts}}</span>
</div>
</div>
Expand All @@ -34,5 +34,8 @@
</div>
</div>
</div>
<div class="footer">
<a class="link" routerLink="../list" [queryParams]="{tab: 1}">View All<img height="20" width="20" style="position: relative; top: 5px; margin-left: 5px;" src="/assets/images/svg-icons/forward-arrow.svg" alt="Order" /></a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@

.stat-text {
display: flex;
flex-direction: column;
flex-direction: row;
}

.stat-box {
display: flex;
padding: 0px 20px 0px 20px;
padding: 16px 20px 0px 20px;
align-items: center;
gap: 32px;
align-self: stretch;
Expand All @@ -71,14 +70,14 @@

.stat-box-icon {
display: flex;
padding: 12px;
padding: 12px 12px 12px 0px;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 8px;
border-radius: 60px;
position: relative;
top: -5px;
top: 6px;
}

.stat-box-data {
Expand All @@ -99,6 +98,7 @@
font-style: normal;
font-weight: 500;
line-height: normal;
margin-top: 16px;
}

.evac-list-box {
Expand Down Expand Up @@ -150,3 +150,18 @@
font-weight: 500;
line-height: 29px; /* 131.818% */
}

.footer {
width: 100%;
text-align: end;
}

.link {
color: var(--blues-blue-5, var(--Medium-Blue, #146FB4));
font-family: Noto Sans;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 21px; /* 131.25% */
text-decoration: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class EvacuationsWidget implements AfterViewInit {
if (evacs && evacs.features) {

this.evacOrders = evacs.features.filter(e => e.attributes.ORDER_ALERT_STATUS === 'Order').length
this.evacAlerts = evacs.features.filter(e => e.attributes.ORDER_ALERT_STATUS === 'Alerts').length
this.evacAlerts = evacs.features.filter(e => e.attributes.ORDER_ALERT_STATUS === 'Alert').length

for (const element of evacs.features) {
this.evacList.push({
Expand All @@ -37,7 +37,7 @@ export class EvacuationsWidget implements AfterViewInit {
}

// sort the list by date
this.evacList.sort((a,b) =>(a.issuedOnRaw > b.issuedOnRaw) ? 1 : ((b.issuedOnRaw > a.issuedOnRaw) ? -1 : 0))
this.evacList.sort((a,b) =>(a.issuedOnRaw > b.issuedOnRaw) ? -1 : ((b.issuedOnRaw > a.issuedOnRaw) ? 1 : 0))
// only keep the first 4 or 5
if (this.evacList.length > 5) {
this.evacList = this.evacList.slice(0, 5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Component } from '@angular/core';
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatIconRegistry } from '@angular/material/icon';
import { Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { WFMapService } from '@app/services/wf-map.service';
import { isMobileView } from '@app/utils';
import { AppConfigService } from '@wf1/core-ui';
Expand All @@ -11,7 +11,7 @@ import { AppConfigService } from '@wf1/core-ui';
templateUrl: './wildfires-list-header.component.html',
styleUrls: ['./wildfires-list-header.component.scss']
})
export class WildfiresListHeaderComponent {
export class WildfiresListHeaderComponent implements OnInit {

public selectedTab = 0

Expand All @@ -20,6 +20,7 @@ export class WildfiresListHeaderComponent {
constructor(
protected appConfigService: AppConfigService,
protected router: Router,
private activatedRoute: ActivatedRoute,
protected matIconRegistry: MatIconRegistry,
protected cdr: ChangeDetectorRef,
protected dialog: MatDialog,
Expand All @@ -30,7 +31,13 @@ export class WildfiresListHeaderComponent {
selectTab (tab: number) {
this.selectedTab = tab
// swap to the desired tab
this.cdr.detectChanges();
this.cdr.detectChanges()
}

ngOnInit() {
this.activatedRoute.queryParams.subscribe(params => {
const tab = params['tab']
this.selectTab(Number(tab))
});
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0627692

Please sign in to comment.