1
0
mirror of https://github.com/bitwarden/mobile synced 2025-01-30 10:15:10 +01:00

[EC-348] change blacklisted to blocked URIs (#2012)

* [EC-348] update blacklisted to blocked URIs

* [EC-348] update variable names
This commit is contained in:
Andreas Coroiu 2022-07-26 09:55:16 +02:00 committed by GitHub
parent f0ebc5e644
commit 16f70dc0ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 27 deletions

View File

@ -132,20 +132,20 @@
<StackLayout StyleClass="box" IsVisible="{Binding ShowAndroidAutofillSettings}"> <StackLayout StyleClass="box" IsVisible="{Binding ShowAndroidAutofillSettings}">
<StackLayout StyleClass="box-row, box-row-input"> <StackLayout StyleClass="box-row, box-row-input">
<Label <Label
Text="{u:I18n BlacklistedUris}" Text="{u:I18n AutofillBlockedUris}"
StyleClass="box-label" /> StyleClass="box-label" />
<Editor <Editor
x:Name="_blacklistedUrisEditor" x:Name="_autofillBlockedUrisEditor"
Text="{Binding AutofillBlacklistedUris}" Text="{Binding AutofillBlockedUris}"
StyleClass="box-value" StyleClass="box-value"
AutoSize="TextChanges" AutoSize="TextChanges"
IsSpellCheckEnabled="False" IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False" IsTextPredictionEnabled="False"
Keyboard="Url" Keyboard="Url"
Unfocused="BlacklistedUrisEditor_Unfocused" /> Unfocused="AutofillBlockedUrisEditor_Unfocused" />
</StackLayout> </StackLayout>
<Label <Label
Text="{u:I18n BlacklistedUrisDescription}" Text="{u:I18n AutofillBlockedUrisDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
</StackLayout> </StackLayout>

View File

@ -45,12 +45,12 @@ namespace Bit.App.Pages
protected async override void OnDisappearing() protected async override void OnDisappearing()
{ {
base.OnDisappearing(); base.OnDisappearing();
await _vm.UpdateAutofillBlacklistedUris(); await _vm.UpdateAutofillBlockedUris();
} }
private async void BlacklistedUrisEditor_Unfocused(object sender, FocusEventArgs e) private async void AutofillBlockedUrisEditor_Unfocused(object sender, FocusEventArgs e)
{ {
await _vm.UpdateAutofillBlacklistedUris(); await _vm.UpdateAutofillBlockedUris();
} }
private async void Close_Clicked(object sender, System.EventArgs e) private async void Close_Clicked(object sender, System.EventArgs e)

View File

@ -17,7 +17,7 @@ namespace Bit.App.Pages
private bool _autofillSavePrompt; private bool _autofillSavePrompt;
private string _autofillBlacklistedUris; private string _autofillBlockedUris;
private bool _favicon; private bool _favicon;
private bool _autoTotpCopy; private bool _autoTotpCopy;
private int _clearClipboardSelectedIndex; private int _clearClipboardSelectedIndex;
@ -167,10 +167,10 @@ namespace Bit.App.Pages
} }
} }
public string AutofillBlacklistedUris public string AutofillBlockedUris
{ {
get => _autofillBlacklistedUris; get => _autofillBlockedUris;
set => SetProperty(ref _autofillBlacklistedUris, value); set => SetProperty(ref _autofillBlockedUris, value);
} }
public bool ShowAndroidAutofillSettings public bool ShowAndroidAutofillSettings
@ -182,8 +182,8 @@ namespace Bit.App.Pages
public async Task InitAsync() public async Task InitAsync()
{ {
AutofillSavePrompt = !(await _stateService.GetAutofillDisableSavePromptAsync()).GetValueOrDefault(); AutofillSavePrompt = !(await _stateService.GetAutofillDisableSavePromptAsync()).GetValueOrDefault();
var blacklistedUrisList = await _stateService.GetAutofillBlacklistedUrisAsync(); var blockedUrisList = await _stateService.GetAutofillBlacklistedUrisAsync();
AutofillBlacklistedUris = blacklistedUrisList != null ? string.Join(", ", blacklistedUrisList) : null; AutofillBlockedUris = blockedUrisList != null ? string.Join(", ", blockedUrisList) : null;
AutoTotpCopy = !(await _stateService.GetDisableAutoTotpCopyAsync() ?? false); AutoTotpCopy = !(await _stateService.GetDisableAutoTotpCopyAsync() ?? false);
Favicon = !(await _stateService.GetDisableFaviconAsync()).GetValueOrDefault(); Favicon = !(await _stateService.GetDisableFaviconAsync()).GetValueOrDefault();
var theme = await _stateService.GetThemeAsync(); var theme = await _stateService.GetThemeAsync();
@ -252,19 +252,19 @@ namespace Bit.App.Pages
} }
} }
public async Task UpdateAutofillBlacklistedUris() public async Task UpdateAutofillBlockedUris()
{ {
if (_inited) if (_inited)
{ {
if (string.IsNullOrWhiteSpace(AutofillBlacklistedUris)) if (string.IsNullOrWhiteSpace(AutofillBlockedUris))
{ {
await _stateService.SetAutofillBlacklistedUrisAsync(null); await _stateService.SetAutofillBlacklistedUrisAsync(null);
AutofillBlacklistedUris = null; AutofillBlockedUris = null;
return; return;
} }
try try
{ {
var csv = AutofillBlacklistedUris; var csv = AutofillBlockedUris;
var urisList = new List<string>(); var urisList = new List<string>();
foreach (var uri in csv.Split(',')) foreach (var uri in csv.Split(','))
{ {
@ -281,7 +281,7 @@ namespace Bit.App.Pages
urisList.Add(cleanedUri); urisList.Add(cleanedUri);
} }
await _stateService.SetAutofillBlacklistedUrisAsync(urisList); await _stateService.SetAutofillBlacklistedUrisAsync(urisList);
AutofillBlacklistedUris = string.Join(", ", urisList); AutofillBlockedUris = string.Join(", ", urisList);
} }
catch { } catch { }
} }

View File

@ -2759,15 +2759,15 @@ namespace Bit.App.Resources {
} }
} }
public static string BlacklistedUris { public static string AutofillBlockedUris {
get { get {
return ResourceManager.GetString("BlacklistedUris", resourceCulture); return ResourceManager.GetString("AutofillBlockedUris", resourceCulture);
} }
} }
public static string BlacklistedUrisDescription { public static string AutofillBlockedUrisDescription {
get { get {
return ResourceManager.GetString("BlacklistedUrisDescription", resourceCulture); return ResourceManager.GetString("AutofillBlockedUrisDescription", resourceCulture);
} }
} }

View File

@ -1573,11 +1573,11 @@
<value>Nord</value> <value>Nord</value>
<comment>'Nord' is the name of a specific color scheme. It should not be translated.</comment> <comment>'Nord' is the name of a specific color scheme. It should not be translated.</comment>
</data> </data>
<data name="BlacklistedUris" xml:space="preserve"> <data name="AutofillBlockedUris" xml:space="preserve">
<value>Blacklisted URIs</value> <value>Auto-fill blocked URIs</value>
</data> </data>
<data name="BlacklistedUrisDescription" xml:space="preserve"> <data name="AutofillBlockedUrisDescription" xml:space="preserve">
<value>URIs that are blacklisted will not offer auto-fill. The list should be comma separated. Ex: "https://twitter.com, androidapp://com.twitter.android".</value> <value>Auto-fill will not be offered for blocked URIs. Separate multiple URIs with a comma. For example: "https://twitter.com, androidapp://com.twitter.android".</value>
</data> </data>
<data name="AskToAddLogin" xml:space="preserve"> <data name="AskToAddLogin" xml:space="preserve">
<value>Ask to add login</value> <value>Ask to add login</value>