Add ability to clone personal vault items#734
Conversation
|
@kspearrin The majority of the changes within this PR are format changes. I ran the basic formatting command within Rider and the shown output is the result: we may need to link up our formatting settings (I know @mportune-bw has been slowly crafting his setup in response to your feedback). AppResources.Designer - I did not manually touch this file. Is this something that needs to be ignored or is this expected when adjusting a string? |
| AppOptions appOptions = null) | ||
| AppOptions appOptions = null, | ||
| bool cloneMode = false, | ||
| ViewPage viewPage = null) |
There was a problem hiding this comment.
@kspearrin Is this how you envisioned the instance of ViewPage being passed into the constructor?
kspearrin
left a comment
There was a problem hiding this comment.
A lot of formatting issues. I stopped commenting on them after I realized there were so many. We need to figure this out. Hard to see where the real changes are.
| var options = new List<string> { AppResources.Attachments }; | ||
| if(_vm.EditMode) | ||
|
|
||
| var options = new List<string> {AppResources.Attachments}; |
There was a problem hiding this comment.
This formatting change isn't correct. Did your IDE do this?
| else if(Device.RuntimePlatform == Device.Android && | ||
| !_deviceActionService.AutofillAccessibilityServiceRunning() && | ||
| !_deviceActionService.AutofillServiceEnabled()) | ||
| !_deviceActionService.AutofillAccessibilityServiceRunning() && |
There was a problem hiding this comment.
same, shouldn't format like this
| { | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
are you adding all of these new lines?
| { | ||
| nameof(ShowPasswordIcon) | ||
| }); | ||
| additionalPropertyNames: new string[] {nameof(ShowPasswordIcon)}); |
There was a problem hiding this comment.
we need to fix all of this formatting. this isn't right
|
|
||
| public bool ShowCollections => (!EditMode || CloneMode) && Cipher.OrganizationId != null; | ||
| public bool EditMode => !string.IsNullOrWhiteSpace(CipherId); | ||
| public bool ShowOwnershipOptions => (!EditMode || CloneMode); |
Yes, that is expected. |
| { | ||
| if(CloneMode && ViewPage != null) | ||
| { | ||
| ViewPage.ViewModel.CipherId = this.Cipher.Id; |
There was a problem hiding this comment.
Let's make a public method on the ViewPage that lets you pass in the new id. Then you can set the ViewModel and the private _cipherId member as well.
src/App/Resources/AppResources.resx
Outdated
| --> | ||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
There was a problem hiding this comment.
Not sure why this formatting all changed. I guess something Rider did? Does Rider have a resx editor or did you have to modify this file manually?
There was a problem hiding this comment.
Rider did do this, but I believe its because it exceeded the line length.
src/App/Pages/Vault/ViewPage.xaml.cs
Outdated
|
|
||
| public ViewPageViewModel ViewModel => _vm; | ||
|
|
||
| public void updateCipherId(string cipherId) |
There was a problem hiding this comment.
Method names in c# are PascalCased.
| { | ||
| if(CloneMode) | ||
| { | ||
| ViewPage?.updateCipherId(this.Cipher.Id); |
There was a problem hiding this comment.
need to update it here too. this wont compile anymore.
Objective
Code Changes
Android Images
iOS Images