Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Display conflicts modal when pasting in FTP locations #12242

Merged
merged 7 commits into from
May 3, 2023

Conversation

ferrariofilippo
Copy link
Contributor

@ferrariofilippo ferrariofilippo commented Apr 30, 2023

Resolved / Related Issues

Changes

  • There was a duplicated class that was causing issues (FtpManager), so I left only one
  • I created IFtpStorageService which is essentially a copy of IStorageService. I might remove it and inject the service without its relative interface. @yaira2 what are your thoughts on this?

Limitations
Pasting from FTP to FTP isn't showing the conlicts dialog (I'm working on this) Fixed

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Open app and an FTP connection
    2. Paste an item with a conflicting name

@ferrariofilippo ferrariofilippo marked this pull request as draft April 30, 2023 20:42
@ferrariofilippo ferrariofilippo marked this pull request as ready for review May 1, 2023 11:55
@yaira2
Copy link
Member

yaira2 commented May 1, 2023

I created IFtpStorageService which is essentially a copy of IStorageService. I might remove it and inject the service without its relative interface. @yaira2 what are your thoughts on this?

Can you make FtpStorageService inherent from IStorageService?

@ferrariofilippo
Copy link
Contributor Author

I think it would cause issues once injected. We would have two different instances of the interface

@yaira2
Copy link
Member

yaira2 commented May 1, 2023

What are the differences between the services?

@ferrariofilippo
Copy link
Contributor Author

What are the differences between the services?

There are no differences, but we would inject two IStorageService instances, Native and Ftp. I think this might cause some issues when retrieving them. I'll try and see what happens

@yaira2
Copy link
Member

yaira2 commented May 1, 2023

I meant, why did you create IFtpStorageService?

@ferrariofilippo
Copy link
Contributor Author

ferrariofilippo commented May 1, 2023

I meant, why did you create IFtpStorageService?

Because I thought that if I have to retrieve it as IStorageService, but I have two instances of that (NativeStorageService and FtpStorageService), there would be issues since it may give me once Native and once Ftp
The two classes implement the interfaces but do not extend it

Also, I thought I should keep the pattern service interface - service implementation

@d2dyno1
Copy link
Member

d2dyno1 commented May 1, 2023

Maybe instead of duplicating IStorageService we could reuse it? I can think of two ways of doing it:

  1. Use FtpStorageService in NativeStorageService and redirect calls to the former one when appropriate.
  2. Manually inject (through the constructor) FtpStorageService instead of Ioc

I'm more into the second option because the first one would introduce more mess. The only difficulty with the second option is the injection itself -- the UI would need to inject appropriate implementation into the View Model

Perhaps you have something else on your mind? @ferrariofilippo

@ferrariofilippo
Copy link
Contributor Author

Perhaps you have something else on your mind? @ferrariofilippo

Not really, I'm not really an expert on this, that's why I used this bad "hack"

@ferrariofilippo
Copy link
Contributor Author

  1. Manually inject (through the constructor) FtpStorageService instead of Ioc

I need FtpStorageService in a static method, how should I manage it?

@d2dyno1
Copy link
Member

d2dyno1 commented May 2, 2023

You could inject it by passing it as a parameter however, then we'd have no guarantee that appropriate service was passed. Unless a major refactor in this area is done, that's going to be an issue. We could perhaps continue with your approach, but to bit reduce code duplication and increase reusability you could inherit from IStorageService

public interface IFtpStorageService : IStorageService

@yaira2 yaira2 merged commit e7d3d6d into files-community:main May 3, 2023
@yaira2 yaira2 changed the title Feature: Display conflicts modal when pasting on FTP locations Feature: Display conflicts modal when pasting in FTP locations May 3, 2023
@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label May 3, 2023
@ferrariofilippo ferrariofilippo deleted the FTP_Display_Conflicts branch May 3, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Display conflicts modal when pasting on FTP locations
3 participants