Skip to content

Commit

Permalink
Quick forecast nav (#1938)
Browse files Browse the repository at this point in the history
* Initial commit of quick forecast

* Initial working mobile for grid strategy

* Full working layout version, initial

* Removing comments and adding bottom margin

* Fixing scrolling from nav links

* Fixing desktop condition/date alignment issue

When there are no alerts for the day

* Bump cookie and express in /tests/api (#1893)

Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](jshttp/cookie@v0.6.0...v0.7.1)

Updates `express` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@v5.0.0...5.0.1)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update alert tab

* review feedback

* do it in css rather than js!

* lints

* Fixing mobile/tablet column vertical alignment issues

* Adding hover state (border) for desktop

* Hover them all!

* Minor adjustments

* Update scroll button colors for contrast, make them slighly smaller

* Change temp chart header a heading, reduce spacing below headings

* Reduce space below arrows

* Hide chart arrows on desktop

* Update libraries file

* Update layout of daily forecast item cards

* Remove width transition from hourly detail toggle button

* Update library date

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Greg Walker <michael.walker@noaa.gov>
Co-authored-by: partly-igor <igor.korenfeld@noaa.gov>
  • Loading branch information
4 people authored Oct 22, 2024
1 parent c812cb4 commit 42371d4
Show file tree
Hide file tree
Showing 12 changed files with 465 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => false,
"isOvernight" => true,
"timeLabel" => "NOW-6AM",
"dayNumericString" => $expectedStart->format("d"),
"monthNumericString" => $expectedStart->format("m"),
];

$data = $this->block->build($now);
Expand Down Expand Up @@ -115,6 +117,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => false,
"isOvernight" => true,
"timeLabel" => "NOW-6AM",
"dayNumericString" => "06",
"monthNumericString" => "05",
],
[
"shortDayName" => "Tue",
Expand All @@ -132,6 +136,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => true,
"isOvernight" => false,
"timeLabel" => "6AM-6PM",
"dayNumericString" => "07",
"monthNumericString" => "05",
],
[
"shortDayName" => "Tue",
Expand All @@ -149,6 +155,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => false,
"isOvernight" => false,
"timeLabel" => "6PM-6AM",
"dayNumericString" => "07",
"monthNumericString" => "05",
],
];

Expand Down Expand Up @@ -189,6 +197,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => false,
"isOvernight" => false,
"timeLabel" => "6PM-6AM",
"dayNumericString" => "06",
"monthNumericString" => "05",
],
];

Expand Down Expand Up @@ -229,6 +239,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => true,
"isOvernight" => false,
"timeLabel" => "6AM-6PM",
"dayNumericString" => "07",
"monthNumericString" => "05",
],
[
"shortDayName" => "Tue",
Expand All @@ -246,6 +258,8 @@ final class DailyForecastStructureTest extends EndToEndBase
"isDaytime" => false,
"isOvernight" => false,
"timeLabel" => "6PM-6AM",
"dayNumericString" => "07",
"monthNumericString" => "05",
],
];

Expand Down
10 changes: 9 additions & 1 deletion web/modules/weather_data/src/Service/DailyForecastTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,28 @@ private function formatDailyPeriod($period, $timezone = null)
// Sentence-case the forecast description.
$shortForecast = ucfirst(strtolower($period->shortForecast));

// String versions of day of month numeric
// and month of year numeric
$formattedStartTime = $startTime->format("c");
$dayNumericString = substr(explode("-", $formattedStartTime)[2], 0, 2);
$monthNumericString = explode("-", $formattedStartTime)[1];

// Return a formatted assoc array that can be
// used by the templates
return [
"shortDayName" => $shortDayName,
"dayName" => $dayName,
"monthAndDay" => $monthAndDay,
"startTime" => $startTime->format("c"),
"startTime" => $formattedStartTime,
"endTime" => $period->endTime,
"shortForecast" => $this->t->translate($shortForecast),
"icon" => $this->getIcon($period),
"temperature" => $period->temperature,
"probabilityOfPrecipitation" =>
$period->probabilityOfPrecipitation->value,
"isDaytime" => $period->isDaytime,
"dayNumericString" => $dayNumericString,
"monthNumericString" => $monthNumericString
];
}

Expand Down
2 changes: 1 addition & 1 deletion web/themes/new_weather_theme/assets/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/themes/new_weather_theme/assets/css/styles.css.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
------------------------------------- */
.wx-daily-forecast-block ol > li {
@include u-margin-bottom(3);

scroll-margin-top: units(7);
}

/* Hourly Forecast Block Overrides
Expand Down
Loading

0 comments on commit 42371d4

Please sign in to comment.