Skip to content

Commit

Permalink
Revert "Revert "Redefine cipher "share" to "move to organization""" (#…
Browse files Browse the repository at this point in the history
…1459)

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

This reverts commit bd4a275.

* Cancel > close
  • Loading branch information
MGibson1 authored Aug 4, 2021
1 parent dbc0f49 commit 9042b10
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/App/Controls/CipherViewCell/CipherViewCell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
VerticalOptions="Center"
StyleClass="list-title-icon"
Margin="5, 0, 0, 0"
Text=""
Text=""
IsVisible="{Binding Cipher.Shared, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Shared}" />
Expand Down
2 changes: 1 addition & 1 deletion src/App/Pages/Settings/SettingsPage/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async void RowSelected(object sender, SelectionChangedEventArgs e)
{
await Navigation.PushModalAsync(new NavigationPage(new ExportVaultPage()));
}
else if (item.Name == AppResources.ShareVault)
else if (item.Name == AppResources.LearnOrg)
{
await _vm.ShareAsync();
}
Expand Down
6 changes: 3 additions & 3 deletions src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public void WebVault()

public async Task ShareAsync()
{
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.ShareVaultConfirmation,
AppResources.ShareVault, AppResources.Yes, AppResources.Cancel);
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.LearnOrgConfirmation,
AppResources.LearnOrg, AppResources.Yes, AppResources.Cancel);
if (confirmed)
{
_platformUtilsService.LaunchUri("https://help.bitwarden.com/article/what-is-an-organization/");
Expand Down Expand Up @@ -393,7 +393,7 @@ public void BuildList()
};
if (IncludeLinksWithSubscriptionInfo())
{
toolsItems.Add(new SettingsPageListItem { Name = AppResources.ShareVault });
toolsItems.Add(new SettingsPageListItem { Name = AppResources.LearnOrg });
toolsItems.Add(new SettingsPageListItem { Name = AppResources.WebVault });
}
var otherItems = new List<SettingsPageListItem>
Expand Down
2 changes: 1 addition & 1 deletion src/App/Pages/Vault/AddEditPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
x:Name="_collectionsItem"
Clicked="Collections_Clicked"
Order="Secondary" />
<ToolbarItem Text="{u:I18n Share}"
<ToolbarItem Text="{u:I18n MoveToOrganization}"
x:Key="shareItem"
x:Name="_shareItem"
Clicked="Share_Clicked"
Expand Down
4 changes: 2 additions & 2 deletions src/App/Pages/Vault/AddEditPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private async void More_Clicked(object sender, System.EventArgs e)
var options = new List<string> { AppResources.Attachments };
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,
(_vm.EditMode && !_vm.CloneMode) ? AppResources.Delete : null, options.ToArray());
Expand All @@ -305,7 +305,7 @@ private async void More_Clicked(object sender, System.EventArgs e)
var page = new CollectionsPage(_vm.CipherId);
await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
}
else if (selection == AppResources.Share)
else if (selection == AppResources.MoveToOrganization)
{
var page = new SharePage(_vm.CipherId);
await Navigation.PushModalAsync(new Xamarin.Forms.NavigationPage(page));
Expand Down
4 changes: 2 additions & 2 deletions src/App/Pages/Vault/SharePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ContentPage.ToolbarItems>
<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.Resources>
Expand Down Expand Up @@ -46,7 +46,7 @@
StyleClass="box-value" />
</StackLayout>
<Label
Text="{u:I18n ShareDesc}"
Text="{u:I18n MoveToOrgDesc}"
StyleClass="box-footer-label" />
</StackLayout>
<StackLayout StyleClass="box"
Expand Down
6 changes: 4 additions & 2 deletions src/App/Pages/Vault/SharePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SharePageViewModel()
_collectionService = ServiceContainer.Resolve<ICollectionService>("collectionService");
Collections = new ExtendedObservableCollection<CollectionViewModel>();
OrganizationOptions = new List<KeyValuePair<string, string>>();
PageTitle = AppResources.Share;
PageTitle = AppResources.MoveToOrganization;
}

public string CipherId { get; set; }
Expand Down Expand Up @@ -109,7 +109,9 @@ await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequi
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
await _cipherService.ShareWithServerAsync(cipherView, OrganizationId, checkedCollectionIds);
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();
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/App/Pages/Vault/ViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
x:Name="_collectionsItem"
Clicked="Collections_Clicked"
Order="Secondary" />
<ToolbarItem Text="{u:I18n Share}"
<ToolbarItem Text="{u:I18n MoveToOrganization}"
x:Key="shareItem"
x:Name="_shareItem"
Clicked="Share_Clicked"
Expand Down
4 changes: 2 additions & 2 deletions src/App/Pages/Vault/ViewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private async void More_Clicked(object sender, System.EventArgs e)
if (_vm.Cipher.OrganizationId == null)
{
options.Add(AppResources.Clone);
options.Add(AppResources.Share);
options.Add(AppResources.MoveToOrganization);
}
else
{
Expand Down Expand Up @@ -252,7 +252,7 @@ private async void More_Clicked(object sender, System.EventArgs e)
var page = new CollectionsPage(_vm.CipherId);
await Navigation.PushModalAsync(new NavigationPage(page));
}
else if (selection == AppResources.Share)
else if (selection == AppResources.MoveToOrganization)
{
var page = new SharePage(_vm.CipherId);
await Navigation.PushModalAsync(new NavigationPage(page));
Expand Down
54 changes: 36 additions & 18 deletions src/App/Resources/AppResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions src/App/Resources/AppResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@
<value>Save</value>
<comment>Button text for a save operation (verb).</comment>
</data>
<data name="Move" xml:space="preserve">
<value>Move</value>
</data>
<data name="Saving" xml:space="preserve">
<value>Saving...</value>
<comment>Message shown when interacting with the server</comment>
Expand Down Expand Up @@ -782,8 +785,8 @@
<data name="BitwardenAutofillServiceSearch" xml:space="preserve">
<value>You are searching for an auto-fill item for "{0}".</value>
</data>
<data name="ShareVault" xml:space="preserve">
<value>Share Your Vault</value>
<data name="LearnOrg" xml:space="preserve">
<value>Learn About Organizations</value>
</data>
<data name="CannotOpenApp" xml:space="preserve">
<value>Cannot open the app "{0}".</value>
Expand Down Expand Up @@ -1378,6 +1381,10 @@
<data name="NoCollectionsToList" xml:space="preserve">
<value>There are no collections to list.</value>
</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">
<value>Item has been shared.</value>
</data>
Expand All @@ -1390,11 +1397,14 @@
<data name="ShareItem" xml:space="preserve">
<value>Share Item</value>
</data>
<data name="MoveToOrganization" xml:space="preserve">
<value>Move to Organization</value>
</data>
<data name="NoOrgsToList" xml:space="preserve">
<value>No organizations to list.</value>
</data>
<data name="ShareDesc" 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>
<data name="MoveToOrgDesc" xml:space="preserve">
<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 name="NumberOfWords" xml:space="preserve">
<value>Number of Words</value>
Expand Down Expand Up @@ -1424,8 +1434,8 @@
<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>
</data>
<data name="ShareVaultConfirmation" 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>
<data name="LearnOrgConfirmation" xml:space="preserve">
<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 name="ExportVault" xml:space="preserve">
<value>Export Vault</value>
Expand Down

0 comments on commit 9042b10

Please sign in to comment.