Revert "Revert "Redefine cipher "share" to "move to organization""" (#1459)

* Revert "Revert "Redefine cipher "share" to "move to organization" (#1433)" (#1440)"

This reverts commit bd4a275558.

* Cancel > close
This commit is contained in:
Matt Gibson 2021-08-04 15:46:28 -04:00 committed by GitHub
parent dbc0f490c5
commit 9042b1009e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 69 additions and 39 deletions

View file

@ -80,7 +80,7 @@
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="" Text=""
IsVisible="{Binding Cipher.Shared, Mode=OneTime}" IsVisible="{Binding Cipher.Shared, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Shared}" /> AutomationProperties.Name="{u:I18n Shared}" />

View file

@ -103,7 +103,7 @@ namespace Bit.App.Pages
{ {
await Navigation.PushModalAsync(new NavigationPage(new ExportVaultPage())); await Navigation.PushModalAsync(new NavigationPage(new ExportVaultPage()));
} }
else if (item.Name == AppResources.ShareVault) else if (item.Name == AppResources.LearnOrg)
{ {
await _vm.ShareAsync(); await _vm.ShareAsync();
} }

View file

@ -150,8 +150,8 @@ namespace Bit.App.Pages
public async Task ShareAsync() public async Task ShareAsync()
{ {
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.ShareVaultConfirmation, var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.LearnOrgConfirmation,
AppResources.ShareVault, AppResources.Yes, AppResources.Cancel); AppResources.LearnOrg, AppResources.Yes, AppResources.Cancel);
if (confirmed) if (confirmed)
{ {
_platformUtilsService.LaunchUri("https://help.bitwarden.com/article/what-is-an-organization/"); _platformUtilsService.LaunchUri("https://help.bitwarden.com/article/what-is-an-organization/");
@ -393,7 +393,7 @@ namespace Bit.App.Pages
}; };
if (IncludeLinksWithSubscriptionInfo()) if (IncludeLinksWithSubscriptionInfo())
{ {
toolsItems.Add(new SettingsPageListItem { Name = AppResources.ShareVault }); toolsItems.Add(new SettingsPageListItem { Name = AppResources.LearnOrg });
toolsItems.Add(new SettingsPageListItem { Name = AppResources.WebVault }); toolsItems.Add(new SettingsPageListItem { Name = AppResources.WebVault });
} }
var otherItems = new List<SettingsPageListItem> var otherItems = new List<SettingsPageListItem>

View file

@ -30,7 +30,7 @@
x:Name="_collectionsItem" x:Name="_collectionsItem"
Clicked="Collections_Clicked" Clicked="Collections_Clicked"
Order="Secondary" /> Order="Secondary" />
<ToolbarItem Text="{u:I18n Share}" <ToolbarItem Text="{u:I18n MoveToOrganization}"
x:Key="shareItem" x:Key="shareItem"
x:Name="_shareItem" x:Name="_shareItem"
Clicked="Share_Clicked" Clicked="Share_Clicked"

View file

@ -284,7 +284,7 @@ namespace Bit.App.Pages
var options = new List<string> { AppResources.Attachments }; var options = new List<string> { AppResources.Attachments };
if (_vm.EditMode) if (_vm.EditMode)
{ {
options.Add(_vm.Cipher.OrganizationId == null ? AppResources.Share : AppResources.Collections); options.Add(_vm.Cipher.OrganizationId == null ? AppResources.MoveToOrganization : AppResources.Collections);
} }
var selection = await DisplayActionSheet(AppResources.Options, AppResources.Cancel, var selection = await DisplayActionSheet(AppResources.Options, AppResources.Cancel,
(_vm.EditMode && !_vm.CloneMode) ? AppResources.Delete : null, options.ToArray()); (_vm.EditMode && !_vm.CloneMode) ? AppResources.Delete : null, options.ToArray());
@ -305,7 +305,7 @@ namespace Bit.App.Pages
var page = new CollectionsPage(_vm.CipherId); var page = new CollectionsPage(_vm.CipherId);
await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page)); await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
} }
else if (selection == AppResources.Share) else if (selection == AppResources.MoveToOrganization)
{ {
var page = new SharePage(_vm.CipherId); var page = new SharePage(_vm.CipherId);
await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page)); await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));

View file

@ -15,7 +15,7 @@
<ContentPage.ToolbarItems> <ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Cancel}" Clicked="Close_Clicked" Order="Primary" Priority="-1" /> <ToolbarItem Text="{u:I18n Cancel}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" /> <ToolbarItem Text="{u:I18n Move}" Clicked="Save_Clicked" />
</ContentPage.ToolbarItems> </ContentPage.ToolbarItems>
<ContentPage.Resources> <ContentPage.Resources>
@ -46,7 +46,7 @@
StyleClass="box-value" /> StyleClass="box-value" />
</StackLayout> </StackLayout>
<Label <Label
Text="{u:I18n ShareDesc}" Text="{u:I18n MoveToOrgDesc}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout StyleClass="box" <StackLayout StyleClass="box"

View file

@ -33,7 +33,7 @@ namespace Bit.App.Pages
_collectionService = ServiceContainer.Resolve<ICollectionService>("collectionService"); _collectionService = ServiceContainer.Resolve<ICollectionService>("collectionService");
Collections = new ExtendedObservableCollection<CollectionViewModel>(); Collections = new ExtendedObservableCollection<CollectionViewModel>();
OrganizationOptions = new List<KeyValuePair<string, string>>(); OrganizationOptions = new List<KeyValuePair<string, string>>();
PageTitle = AppResources.Share; PageTitle = AppResources.MoveToOrganization;
} }
public string CipherId { get; set; } public string CipherId { get; set; }
@ -109,7 +109,9 @@ namespace Bit.App.Pages
await _deviceActionService.ShowLoadingAsync(AppResources.Saving); await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
await _cipherService.ShareWithServerAsync(cipherView, OrganizationId, checkedCollectionIds); await _cipherService.ShareWithServerAsync(cipherView, OrganizationId, checkedCollectionIds);
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
_platformUtilsService.ShowToast("success", null, AppResources.ItemShared); var movedItemToOrgText = string.Format(AppResources.MovedItemToOrg, cipherView.Name,
(await _userService.GetOrganizationAsync(OrganizationId)).Name);
_platformUtilsService.ShowToast("success", null, movedItemToOrgText);
await Page.Navigation.PopModalAsync(); await Page.Navigation.PopModalAsync();
return true; return true;
} }

View file

@ -25,7 +25,7 @@
x:Name="_collectionsItem" x:Name="_collectionsItem"
Clicked="Collections_Clicked" Clicked="Collections_Clicked"
Order="Secondary" /> Order="Secondary" />
<ToolbarItem Text="{u:I18n Share}" <ToolbarItem Text="{u:I18n MoveToOrganization}"
x:Key="shareItem" x:Key="shareItem"
x:Name="_shareItem" x:Name="_shareItem"
Clicked="Share_Clicked" Clicked="Share_Clicked"

View file

@ -220,7 +220,7 @@ namespace Bit.App.Pages
if (_vm.Cipher.OrganizationId == null) if (_vm.Cipher.OrganizationId == null)
{ {
options.Add(AppResources.Clone); options.Add(AppResources.Clone);
options.Add(AppResources.Share); options.Add(AppResources.MoveToOrganization);
} }
else else
{ {
@ -252,7 +252,7 @@ namespace Bit.App.Pages
var page = new CollectionsPage(_vm.CipherId); var page = new CollectionsPage(_vm.CipherId);
await Navigation.PushModalAsync(new NavigationPage(page)); await Navigation.PushModalAsync(new NavigationPage(page));
} }
else if (selection == AppResources.Share) else if (selection == AppResources.MoveToOrganization)
{ {
var page = new SharePage(_vm.CipherId); var page = new SharePage(_vm.CipherId);
await Navigation.PushModalAsync(new NavigationPage(page)); await Navigation.PushModalAsync(new NavigationPage(page));

View file

@ -1,6 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -9,6 +10,7 @@
namespace Bit.App.Resources { namespace Bit.App.Resources {
using System; using System;
using System.Reflection;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
@ -363,6 +365,12 @@ namespace Bit.App.Resources {
} }
} }
public static string Move {
get {
return ResourceManager.GetString("Move", resourceCulture);
}
}
public static string Saving { public static string Saving {
get { get {
return ResourceManager.GetString("Saving", resourceCulture); return ResourceManager.GetString("Saving", resourceCulture);
@ -1257,9 +1265,9 @@ namespace Bit.App.Resources {
} }
} }
public static string ShareVault { public static string LearnOrg {
get { get {
return ResourceManager.GetString("ShareVault", resourceCulture); return ResourceManager.GetString("LearnOrg", resourceCulture);
} }
} }
@ -2397,6 +2405,12 @@ namespace Bit.App.Resources {
} }
} }
public static string MovedItemToOrg {
get {
return ResourceManager.GetString("MovedItemToOrg", resourceCulture);
}
}
public static string ItemShared { public static string ItemShared {
get { get {
return ResourceManager.GetString("ItemShared", resourceCulture); return ResourceManager.GetString("ItemShared", resourceCulture);
@ -2421,15 +2435,21 @@ namespace Bit.App.Resources {
} }
} }
public static string MoveToOrganization {
get {
return ResourceManager.GetString("MoveToOrganization", resourceCulture);
}
}
public static string NoOrgsToList { public static string NoOrgsToList {
get { get {
return ResourceManager.GetString("NoOrgsToList", resourceCulture); return ResourceManager.GetString("NoOrgsToList", resourceCulture);
} }
} }
public static string ShareDesc { public static string MoveToOrgDesc {
get { get {
return ResourceManager.GetString("ShareDesc", resourceCulture); return ResourceManager.GetString("MoveToOrgDesc", resourceCulture);
} }
} }
@ -2481,9 +2501,9 @@ namespace Bit.App.Resources {
} }
} }
public static string ShareVaultConfirmation { public static string LearnOrgConfirmation {
get { get {
return ResourceManager.GetString("ShareVaultConfirmation", resourceCulture); return ResourceManager.GetString("LearnOrgConfirmation", resourceCulture);
} }
} }
@ -3512,23 +3532,21 @@ namespace Bit.App.Resources {
return ResourceManager.GetString("SendFileEmailVerificationRequired", resourceCulture); return ResourceManager.GetString("SendFileEmailVerificationRequired", resourceCulture);
} }
} }
public static string PasswordPrompt
{ public static string PasswordPrompt {
get get {
{
return ResourceManager.GetString("PasswordPrompt", resourceCulture); return ResourceManager.GetString("PasswordPrompt", resourceCulture);
} }
} }
public static string PasswordConfirmation
{ public static string PasswordConfirmation {
get get {
{
return ResourceManager.GetString("PasswordConfirmation", resourceCulture); return ResourceManager.GetString("PasswordConfirmation", resourceCulture);
} }
}public static string PasswordConfirmationDesc }
{
get public static string PasswordConfirmationDesc {
{ get {
return ResourceManager.GetString("PasswordConfirmationDesc", resourceCulture); return ResourceManager.GetString("PasswordConfirmationDesc", resourceCulture);
} }
} }

View file

@ -310,6 +310,9 @@
<value>Save</value> <value>Save</value>
<comment>Button text for a save operation (verb).</comment> <comment>Button text for a save operation (verb).</comment>
</data> </data>
<data name="Move" xml:space="preserve">
<value>Move</value>
</data>
<data name="Saving" xml:space="preserve"> <data name="Saving" xml:space="preserve">
<value>Saving...</value> <value>Saving...</value>
<comment>Message shown when interacting with the server</comment> <comment>Message shown when interacting with the server</comment>
@ -782,8 +785,8 @@
<data name="BitwardenAutofillServiceSearch" xml:space="preserve"> <data name="BitwardenAutofillServiceSearch" xml:space="preserve">
<value>You are searching for an auto-fill item for "{0}".</value> <value>You are searching for an auto-fill item for "{0}".</value>
</data> </data>
<data name="ShareVault" xml:space="preserve"> <data name="LearnOrg" xml:space="preserve">
<value>Share Your Vault</value> <value>Learn About Organizations</value>
</data> </data>
<data name="CannotOpenApp" xml:space="preserve"> <data name="CannotOpenApp" xml:space="preserve">
<value>Cannot open the app "{0}".</value> <value>Cannot open the app "{0}".</value>
@ -1378,6 +1381,10 @@
<data name="NoCollectionsToList" xml:space="preserve"> <data name="NoCollectionsToList" xml:space="preserve">
<value>There are no collections to list.</value> <value>There are no collections to list.</value>
</data> </data>
<data name="MovedItemToOrg" xml:space="preserve">
<value>{0} moved to {1}.</value>
<comment>ex: Item moved to Organization.</comment>
</data>
<data name="ItemShared" xml:space="preserve"> <data name="ItemShared" xml:space="preserve">
<value>Item has been shared.</value> <value>Item has been shared.</value>
</data> </data>
@ -1390,11 +1397,14 @@
<data name="ShareItem" xml:space="preserve"> <data name="ShareItem" xml:space="preserve">
<value>Share Item</value> <value>Share Item</value>
</data> </data>
<data name="MoveToOrganization" xml:space="preserve">
<value>Move to Organization</value>
</data>
<data name="NoOrgsToList" xml:space="preserve"> <data name="NoOrgsToList" xml:space="preserve">
<value>No organizations to list.</value> <value>No organizations to list.</value>
</data> </data>
<data name="ShareDesc" xml:space="preserve"> <data name="MoveToOrgDesc" xml:space="preserve">
<value>Choose an organization that you wish to share this item with. Sharing transfers ownership of the item to the organization. You will no longer be the direct owner of this item once it has been shared.</value> <value>Choose an organization that you wish to move this item to. Moving to an organization transfers ownership of the item to that organization. You will no longer be the direct owner of this item once it has been moved.</value>
</data> </data>
<data name="NumberOfWords" xml:space="preserve"> <data name="NumberOfWords" xml:space="preserve">
<value>Number of Words</value> <value>Number of Words</value>
@ -1424,8 +1434,8 @@
<value>Your account's fingerprint phrase</value> <value>Your account's fingerprint phrase</value>
<comment>A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing.</comment> <comment>A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing.</comment>
</data> </data>
<data name="ShareVaultConfirmation" xml:space="preserve"> <data name="LearnOrgConfirmation" xml:space="preserve">
<value>Bitwarden allows you to share your vault with others by using an organization account. Would you like to visit the bitwarden.com website to learn more?</value> <value>Bitwarden allows you to share your vault items with others by using an organization account. Would you like to visit the bitwarden.com website to learn more?</value>
</data> </data>
<data name="ExportVault" xml:space="preserve"> <data name="ExportVault" xml:space="preserve">
<value>Export Vault</value> <value>Export Vault</value>