mirror of
https://github.com/bitwarden/mobile.git
synced 2025-01-09 19:17:42 +01:00
[PM-6291] Fix Device Login Pending Requests screen not displaying anything (#3012)
* PM-6291 Changed Passwordless Request Login Page Layout structure so that it can display properly * PM-6291 Additional changes to allow iOS to show the correct with on the collectionview items
This commit is contained in:
parent
a73923c4f7
commit
a508bea4b0
@ -37,7 +37,6 @@
|
|||||||
<Label
|
<Label
|
||||||
Text="{u:I18n FingerprintPhrase}"
|
Text="{u:I18n FingerprintPhrase}"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
Padding="0, 10, 0 ,0"
|
|
||||||
FontAttributes="Bold"/>
|
FontAttributes="Bold"/>
|
||||||
<controls:MonoLabel
|
<controls:MonoLabel
|
||||||
FormattedText="{Binding FingerprintPhrase}"
|
FormattedText="{Binding FingerprintPhrase}"
|
||||||
@ -70,64 +69,70 @@
|
|||||||
Grid.ColumnSpan="2"/>
|
Grid.ColumnSpan="2"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<StackLayout
|
|
||||||
x:Key="mainLayout"
|
|
||||||
x:Name="_mainLayout"
|
|
||||||
Padding="0, 10">
|
|
||||||
<RefreshView
|
|
||||||
IsRefreshing="{Binding IsRefreshing}"
|
|
||||||
Command="{Binding RefreshCommand}"
|
|
||||||
VerticalOptions="FillAndExpand"
|
|
||||||
BackgroundColor="{DynamicResource BackgroundColor}">
|
|
||||||
<StackLayout>
|
|
||||||
<Image
|
|
||||||
x:Name="_emptyPlaceholder"
|
|
||||||
Source="empty_login_requests"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
WidthRequest="160"
|
|
||||||
HeightRequest="160"
|
|
||||||
Margin="0,70,0,0"
|
|
||||||
IsVisible="{Binding HasLoginRequests, Converter={StaticResource inverseBool}}"
|
|
||||||
SemanticProperties.Description="{u:I18n NoPendingRequests}" />
|
|
||||||
<controls:CustomLabel
|
|
||||||
StyleClass="box-label-regular"
|
|
||||||
Text="{u:I18n NoPendingRequests}"
|
|
||||||
IsVisible="{Binding HasLoginRequests, Converter={StaticResource inverseBool}}"
|
|
||||||
FontAttributes="{OnPlatform iOS=Bold}"
|
|
||||||
FontWeight="500"
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
Margin="14,10,14,0"/>
|
|
||||||
<controls:ExtendedCollectionView
|
|
||||||
ItemsSource="{Binding LoginRequests}"
|
|
||||||
ItemTemplate="{StaticResource loginRequestTemplate}"
|
|
||||||
SelectionMode="Single"
|
|
||||||
IsVisible="{Binding HasLoginRequests}"
|
|
||||||
ExtraDataForLogging="Login requests page" >
|
|
||||||
<controls:ExtendedCollectionView.Behaviors>
|
|
||||||
<xct:EventToCommandBehavior
|
|
||||||
EventName="SelectionChanged"
|
|
||||||
Command="{Binding AnswerRequestCommand}"
|
|
||||||
EventArgsConverter="{StaticResource SelectionChangedEventArgsConverter}" />
|
|
||||||
</controls:ExtendedCollectionView.Behaviors>
|
|
||||||
</controls:ExtendedCollectionView>
|
|
||||||
</StackLayout>
|
|
||||||
</RefreshView>
|
|
||||||
<controls:IconLabelButton
|
|
||||||
VerticalOptions="End"
|
|
||||||
Margin="10,0"
|
|
||||||
Icon="{Binding Source={x:Static core:BitwardenIcons.Trash}}"
|
|
||||||
Label="{u:I18n DeclineAllRequests}"
|
|
||||||
ButtonCommand="{Binding DeclineAllRequestsCommand}"
|
|
||||||
IsVisible="{Binding HasLoginRequests}"
|
|
||||||
AutomationId="DeleteAllRequestsButton" />
|
|
||||||
</StackLayout>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</ContentPage.Resources>
|
</ContentPage.Resources>
|
||||||
|
|
||||||
<ContentView
|
<Grid
|
||||||
x:Name="_mainContent">
|
RowDefinitions="*, Auto"
|
||||||
</ContentView>
|
Padding="0, 10">
|
||||||
|
<RefreshView
|
||||||
|
Grid.Row="0"
|
||||||
|
IsRefreshing="{Binding IsRefreshing}"
|
||||||
|
Command="{Binding RefreshCommand}"
|
||||||
|
VerticalOptions="Fill"
|
||||||
|
BackgroundColor="{DynamicResource BackgroundColor}">
|
||||||
|
<Grid RowDefinitions="Auto, *">
|
||||||
|
<VerticalStackLayout Grid.Row="0"
|
||||||
|
HorizontalOptions="Center">
|
||||||
|
<Image
|
||||||
|
x:Name="_emptyPlaceholder"
|
||||||
|
Source="empty_login_requests"
|
||||||
|
WidthRequest="160"
|
||||||
|
HeightRequest="160"
|
||||||
|
Margin="0,70,0,0"
|
||||||
|
IsVisible="{Binding HasLoginRequests, Converter={StaticResource inverseBool}}"
|
||||||
|
SemanticProperties.Description="{u:I18n NoPendingRequests}" />
|
||||||
|
<controls:CustomLabel
|
||||||
|
StyleClass="box-label-regular"
|
||||||
|
Text="{u:I18n NoPendingRequests}"
|
||||||
|
IsVisible="{Binding HasLoginRequests, Converter={StaticResource inverseBool}}"
|
||||||
|
FontAttributes="{OnPlatform iOS=Bold}"
|
||||||
|
FontWeight="500"
|
||||||
|
Margin="14,10,14,0"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
<controls:ExtendedCollectionView
|
||||||
|
Grid.Row="1"
|
||||||
|
ItemsSource="{Binding LoginRequests}"
|
||||||
|
ItemTemplate="{StaticResource loginRequestTemplate}"
|
||||||
|
SelectionMode="Single"
|
||||||
|
IsVisible="{Binding HasLoginRequests}"
|
||||||
|
ExtraDataForLogging="Login requests page" >
|
||||||
|
<controls:ExtendedCollectionView.Behaviors>
|
||||||
|
<xct:EventToCommandBehavior
|
||||||
|
EventName="SelectionChanged"
|
||||||
|
Command="{Binding AnswerRequestCommand}"
|
||||||
|
EventArgsConverter="{StaticResource SelectionChangedEventArgsConverter}" />
|
||||||
|
</controls:ExtendedCollectionView.Behaviors>
|
||||||
|
</controls:ExtendedCollectionView>
|
||||||
|
</Grid>
|
||||||
|
</RefreshView>
|
||||||
|
|
||||||
|
<controls:IconLabelButton
|
||||||
|
Grid.Row="1"
|
||||||
|
VerticalOptions="End"
|
||||||
|
Margin="10,0"
|
||||||
|
Icon="{Binding Source={x:Static core:BitwardenIcons.Trash}}"
|
||||||
|
Label="{u:I18n DeclineAllRequests}"
|
||||||
|
ButtonCommand="{Binding DeclineAllRequestsCommand}"
|
||||||
|
IsVisible="{Binding HasLoginRequests}"
|
||||||
|
AutomationId="DeleteAllRequestsButton" />
|
||||||
|
|
||||||
|
<Grid x:Name="_activityIndicatorGrid" Grid.Row="0" Grid.RowSpan="2" BackgroundColor="{DynamicResource BackgroundColor}">
|
||||||
|
<ActivityIndicator IsRunning="True"
|
||||||
|
VerticalOptions="Center"
|
||||||
|
HorizontalOptions="Center" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</pages:BaseContentPage>
|
</pages:BaseContentPage>
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|||||||
using Bit.App.Utilities;
|
using Bit.App.Utilities;
|
||||||
using Bit.Core.Abstractions;
|
using Bit.Core.Abstractions;
|
||||||
using Bit.Core.Models.Response;
|
using Bit.Core.Models.Response;
|
||||||
|
using Bit.Core.Services;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Microsoft.Maui.ApplicationModel;
|
using Microsoft.Maui.ApplicationModel;
|
||||||
using Microsoft.Maui.Controls;
|
using Microsoft.Maui.Controls;
|
||||||
@ -19,7 +20,6 @@ namespace Bit.App.Pages
|
|||||||
public LoginPasswordlessRequestsListPage()
|
public LoginPasswordlessRequestsListPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetActivityIndicator(_mainContent);
|
|
||||||
_vm = BindingContext as LoginPasswordlessRequestsListViewModel;
|
_vm = BindingContext as LoginPasswordlessRequestsListViewModel;
|
||||||
_vm.Page = this;
|
_vm.Page = this;
|
||||||
}
|
}
|
||||||
@ -27,9 +27,21 @@ namespace Bit.App.Pages
|
|||||||
protected override async void OnAppearing()
|
protected override async void OnAppearing()
|
||||||
{
|
{
|
||||||
base.OnAppearing();
|
base.OnAppearing();
|
||||||
await LoadOnAppearedAsync(_mainLayout, false, _vm.RefreshAsync, _mainContent);
|
try
|
||||||
|
{
|
||||||
|
_activityIndicatorGrid.IsVisible = true;
|
||||||
|
|
||||||
UpdatePlaceholder();
|
await _vm.RefreshAsync();
|
||||||
|
UpdatePlaceholder();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_activityIndicatorGrid.IsVisible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Close_Clicked(object sender, System.EventArgs e)
|
private async void Close_Clicked(object sender, System.EventArgs e)
|
||||||
|
@ -108,7 +108,7 @@ namespace Bit.App.Pages
|
|||||||
Origin = loginRequestData.Origin
|
Origin = loginRequestData.Origin
|
||||||
});
|
});
|
||||||
|
|
||||||
await Device.InvokeOnMainThreadAsync(() => Application.Current.MainPage.Navigation.PushModalAsync(new NavigationPage(page)));
|
await MainThread.InvokeOnMainThreadAsync(() => Application.Current.MainPage.Navigation.PushModalAsync(new NavigationPage(page)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DeclineAllRequestsAsync()
|
private async Task DeclineAllRequestsAsync()
|
||||||
|
Loading…
Reference in New Issue
Block a user