Skip to content

Commit

Permalink
Fix since #841 - See details button doesn't have any action (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand authored Jun 23, 2022
1 parent 22f3a13 commit eabae35
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<MudGrid>
<MudItem xs="12">
<MudTable T="ConfigListItem" Items="@result" Loading="IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="OnRowClick">
<MudTable T="ConfigListItem" Items="@result" Loading="IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 20%;" />
<col style="width: 20%;" />
Expand Down Expand Up @@ -53,7 +53,7 @@
<MudTd DataLabel="Creation date" Style="text-align: center;">@context.CreationDate</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudTooltip Text="See details">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTooltip>
</MudTd>
</RowTemplate>
Expand Down Expand Up @@ -105,8 +105,8 @@
}
}

private void OnRowClick(TableRowClickEventArgs<ConfigListItem> e)
private void GoToDetails(ConfigListItem item)
{
NavigationManager.NavigateTo($"/edge/configurations/{e.Item.ConfigurationID}");
NavigationManager.NavigateTo($"/edge/configurations/{item.ConfigurationID}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<MudGrid>
<MudItem xs="12">
<MudTable T="ConfigListItem" id="device-configurations-listing" Items=@result Loading="IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="OnRowClick">
<MudTable T="ConfigListItem" id="device-configurations-listing" Items=@result Loading="IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 20%;" />
<col style="width: 20%;" />
Expand Down Expand Up @@ -52,7 +52,7 @@
<MudTd DataLabel="Priority" Style="text-align: center">@context.Priority</MudTd>
<MudTd DataLabel="Creation date" Style="text-align: center;">@context.CreationDate</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTd>
</RowTemplate>
<NoRecordsContent>
Expand Down Expand Up @@ -105,8 +105,8 @@
}


private void OnRowClick(TableRowClickEventArgs<ConfigListItem> e)
private void GoToDetails(ConfigListItem item)
{
navigationManager.NavigateTo($"/device-configurations/{e.Item.ConfigurationID}");
navigationManager.NavigateTo($"/device-configurations/{item.ConfigurationID}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
else
{
<MudItem xs="12">
<MudTable T="DeviceModel" Items="@result" Loading="@IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="OnRowClick">
<MudTable T="DeviceModel" Items="@result" Loading="@IsLoading" Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 5%;" />
<col style="width: 30%;" />
Expand Down Expand Up @@ -61,7 +61,7 @@
</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudTooltip Text="Delete device model">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTooltip>
</MudTd>
<MudTd DataLabel="Delete" Style="text-align: center">
Expand Down Expand Up @@ -141,8 +141,8 @@
await LoadDeviceModels();
}

private void OnRowClick(TableRowClickEventArgs<DeviceModel> e)
private void GoToDetails(DeviceModel item)
{
navigationManager.NavigateTo($"/device-models/{e.Item.ModelId}{((e.Item.SupportLoRaFeatures && Portal.IsLoRaSupported) ? "?isLora=true" : "")}");
navigationManager.NavigateTo($"/device-models/{item.ModelId}{((item.SupportLoRaFeatures && Portal.IsLoRaSupported) ? "?isLora=true" : "")}");
}
}
12 changes: 6 additions & 6 deletions src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceListPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</MudExpansionPanels>
</MudItem>
<MudItem xs="12">
<MudTable T="DeviceListItem" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="OnRowClick">
<MudTable T="DeviceListItem" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 5%;" />
<col style="width: 40%;" />
Expand Down Expand Up @@ -140,7 +140,7 @@
<MudTd DataLabel="LSU" Style="text-align: center">@context.StatusUpdatedTime</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudTooltip Text="See device details">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTooltip>
</MudTd>
<MudTd DataLabel="Delete" Style="text-align: center">
Expand All @@ -163,8 +163,8 @@
</MudGrid>

@code {
[CascadingParameter]
public Error Error { get; set; }
[CascadingParameter]
public Error Error { get; set; }

private string searchID = "";
private string searchStatus;
Expand Down Expand Up @@ -289,8 +289,8 @@
Search();
}

private void OnRowClick(TableRowClickEventArgs<DeviceListItem> e)
private void GoToDetails(DeviceListItem item)
{
navigationManager.NavigateTo($"devices/{e.Item.DeviceID}{((e.Item.SupportLoRaFeatures && Portal.IsLoRaSupported) ? "?isLora=true" : "")}");
navigationManager.NavigateTo($"devices/{item.DeviceID}{((item.SupportLoRaFeatures && Portal.IsLoRaSupported) ? "?isLora=true" : "")}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</MudExpansionPanels>
</MudItem>
<MudItem xs="12">
<MudTable T="IoTEdgeListItem" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="OnRowClick">
<MudTable T="IoTEdgeListItem" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 40%;" />
<col style="width: 10%;" />
Expand Down Expand Up @@ -97,7 +97,7 @@
<MudTd DataLabel="NbDevices" Style="text-align: center">@context.NbDevices</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudTooltip Text="See device details">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTooltip>
</MudTd>
<MudTd DataLabel="Delete" Style="text-align: center">
Expand Down Expand Up @@ -210,8 +210,8 @@
Search();
}

private void OnRowClick(TableRowClickEventArgs<IoTEdgeListItem> e)
private void GoToDetails(IoTEdgeListItem item)
{
NavigationManager.NavigateTo($"/edge/devices/{@e.Item.DeviceId}");
NavigationManager.NavigateTo($"/edge/devices/{item.DeviceId}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<MudGrid>

<MudItem xs="12">
<MudTable T="Concentrator" id="concentrators-listing" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="OnRowClick">
<MudTable T="Concentrator" id="concentrators-listing" ServerData=@LoadItems Dense=true Breakpoint="Breakpoint.Sm" Hover=true Bordered=true Striped=true @ref="table" Loading="@IsLoading" OnRowClick="@((e) => GoToDetails(e.Item))">
<ColGroup>
<col style="width: 60%;" />
<col style="width: 10%;" />
Expand Down Expand Up @@ -71,7 +71,7 @@
</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<MudTooltip Text="See concentrator details">
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" />
<MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" OnClick="@(() => GoToDetails(context))" />
</MudTooltip>
</MudTd>
<MudTd DataLabel="Delete" Style="text-align: center">
Expand Down Expand Up @@ -167,8 +167,8 @@
table.ReloadServerData();
}

private void OnRowClick(TableRowClickEventArgs<Concentrator> e)
private void GoToDetails(Concentrator item)
{
navigationManager.NavigateTo($"/lorawan/concentrators/{@e.Item.DeviceId}");
navigationManager.NavigateTo($"/lorawan/concentrators/{item.DeviceId}");
}
}

0 comments on commit eabae35

Please sign in to comment.