Skip to content

Commit 5826158

Browse files
authored
Merge pull request #547 from ledpup/development
Refactor modals and improve UI consistency across components
2 parents 439c85b + 975a698 commit 5826158

8 files changed

Lines changed: 17 additions & 31 deletions

File tree

ClimateExplorer.Web.Client/Pages/Index.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
Use the suggested charts to get started quickly, or <a href="#" @onclick="ShowAddDataSetModal">add data sets</a> to build custom views. The chevron (&gt;) expands or collapses parts of the site such as the suggested charts. Click the chevron to <a href="#" @onclick="suggestedChartsCollapsible!.CollapserOnClick">see more chart presets</a>.
9191
</p>
9292
<p>
93-
The <a href="regionalandglobal">regional &amp; global</a> section has charts for global data such as greenhouse gases and the global temperature anomaly. Regional views include charts for the Arctic and Antarctic, the northern and southern hemispheres, and land and ocean.
93+
The <a href="regionalandglobal">regional &amp; global</a> section has charts for global data such as greenhouse gases and regional charts like the Arctic and Antarctic sea ice.
9494
</p>
9595
</InfoPanel>
9696

ClimateExplorer.Web.Client/Services/InfoPanelDismissalService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public interface IInfoPanelDismissalService
1111
public class InfoPanelDismissalService : IInfoPanelDismissalService
1212
{
1313
private const string StorageKey = "infoPanelDismissals";
14-
private static readonly TimeSpan SameVersionCooldown = TimeSpan.FromDays(365);
15-
private static readonly TimeSpan NewVersionCooldown = TimeSpan.FromDays(90);
14+
private static readonly TimeSpan Cooldown = TimeSpan.FromDays(365);
1615

1716
private readonly ILocalStorageService localStorage;
1817

@@ -35,10 +34,10 @@ public async Task<bool> ShouldShowAsync(string panelName, string version)
3534

3635
if (entry.Version == version)
3736
{
38-
return elapsed >= SameVersionCooldown;
37+
return elapsed >= Cooldown;
3938
}
4039

41-
return elapsed >= NewVersionCooldown;
40+
return true;
4241
}
4342

4443
public async Task DismissAsync(string panelName, string version)

ClimateExplorer.Web.Client/Shared/ChartView.razor

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@
3939
<DropdownMenu>
4040
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.ByYear)">Yearly</DropdownItem>
4141
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.ByYearAndMonth)">Year + Month</DropdownItem>
42-
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.ByYearAndWeek)">Year + Week</DropdownItem>
43-
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.ByYearAndDay)">Year + Day</DropdownItem>
4442
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.ByMonthOnly)">Month (ignoring year)</DropdownItem>
45-
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.BySouthernHemisphereTemperateSeasonOnly)">Southern hemisphere temperate season only (ignoring year)</DropdownItem>
46-
<DropdownItem Clicked="() => OnSelectedBinGranularityChanged(BinGranularities.BySouthernHemisphereTropicalSeasonOnly)">Southern hemisphere tropical season only (ignoring year)</DropdownItem>
4743
</DropdownMenu>
4844
</Dropdown>
4945

@@ -128,14 +124,6 @@
128124
<ChartOptionsContent />
129125
</InfoPanel>
130126

131-
<Modal @ref="aggregationOptionsModal">
132-
<ModalContent Size="ModalSize.Large">
133-
<ModalHeader Class="custom-modal-header">
134-
<ModalTitle>Aggregation options information</ModalTitle>
135-
<CloseButton />
136-
</ModalHeader>
137-
<ModalBody>
138-
<AggregationOptionsContent />
139-
</ModalBody>
140-
</ModalContent>
141-
</Modal>
127+
<InfoPanel @ref="aggregationOptionsInfoPanel" Title="Aggregation options information" Height="60vh">
128+
<AggregationOptionsContent />
129+
</InfoPanel>

ClimateExplorer.Web.Client/Shared/ChartView.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial class ChartView
3131
private BinIdentifier? chartStartBin;
3232
private BinIdentifier? chartEndBin;
3333

34-
private Modal? aggregationOptionsModal;
34+
private InfoPanel? aggregationOptionsInfoPanel;
3535
private InfoPanel? chartOptionsInfoPanel;
3636

3737
private string? groupingThresholdText;
@@ -968,7 +968,7 @@ private Task ShowChartOptionsInfo()
968968

969969
private Task ShowAggregationOptionsInfo()
970970
{
971-
return aggregationOptionsModal!.Show();
971+
return aggregationOptionsInfoPanel!.ShowAsync();
972972
}
973973

974974
private SourceSeriesSpecification BuildSourceSeriesSpecification(DataSetLibraryEntry.SourceSeriesSpecification sss, IEnumerable<DataSetDefinitionViewModel> dataSetDefinitions)

ClimateExplorer.Web.Client/Shared/ChartView.razor.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151

5252
::deep .chart-controls .dropdown {
5353
text-decoration: none;
54-
margin-bottom: 16px;
55-
margin-right: 16px;
54+
margin: 8px 16px 16px 8px;
5655
display: inline-block;
5756
top: -1px;
5857
border-radius: 8px;
@@ -79,10 +78,10 @@
7978
background-color: #f8f8f8;
8079
border-radius: 8px;
8180
margin-right: 16px;
81+
margin-bottom: 16px;
8282
text-decoration: none;
8383
color: #425f59;
8484
cursor: pointer;
85-
margin-bottom: 16px;
8685
display: inline-block;
8786
box-shadow: rgb(0 0 0 / 20%) 0px 0px 4px;
8887
vertical-align: baseline;

ClimateExplorer.Web.Client/Shared/LocationComponents/ChangeLocation.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@using ClimateExplorer.WebApiClient.Services
66
@using GeoCoordinatePortable
77

8-
<Modal @ref="modal">
9-
<ModalContent Size="ModalSize.Large">
8+
<Modal @ref="modal" Size="ModalSize.Large">
9+
<ModalContent>
1010
<ModalHeader Class="custom-modal-header">
1111
<ModalTitle>Change location</ModalTitle>
1212
<CloseButton />

ClimateExplorer.Web.Client/Shared/LocationComponents/ClimateStripe.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
@if (ShowInfo)
2929
{
30-
<Modal @ref="popup">
31-
<ModalContent Size="ModalSize.Large">
30+
<Modal @ref="popup" Size="ModalSize.Large">
31+
<ModalContent>
3232
<ModalHeader Class="custom-modal-header">
3333
<ModalTitle>Climate stripe</ModalTitle>
3434
<CloseButton />

ClimateExplorer.Web.Client/Shared/OverviewField.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
@if (PopupContent != null)
2020
{
21-
<Modal @ref="popup" Closing="@OnModalClosing">
22-
<ModalContent Size="ModalSize.Large">
21+
<Modal @ref="popup" Closing="@OnModalClosing" Size="ModalSize.Large">
22+
<ModalContent>
2323
<ModalHeader Class="custom-modal-header">
2424
<ModalTitle>
2525
@(string.IsNullOrWhiteSpace(PopupTitle) ? Label : PopupTitle)

0 commit comments

Comments
 (0)