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

<FilePicker/> Add properties for default library- & folderPath for <SiteFilePicker/> #936

Closed
1 task done
Katli95 opened this issue Jun 15, 2021 · 12 comments
Closed
1 task done
Assignees
Labels
status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:enhancement New feature or enhancement of existing capability
Milestone

Comments

@Katli95
Copy link
Contributor

Katli95 commented Jun 15, 2021

Category

  • Enhancement

Version

3.1.0

Desired Behavior

It would be great if the <FilePicker/> could accept a property/properties for setting a default selected library and folder which would apply to the <SiteFilePicker/> child.

Implementation

I'm up for submitting a Pull Request and I might even take a look into #725 while I'm at it as a multiple file select is applicable for my use case as well.

Right now I'm thinking of just giving a single property named defaultFolderAbsolutePath (perhaps with a suffix to indicate its intention for the SiteFilesTab) and parse it in the <SiteFilePickerTab/> constructor for the state variables (and breadcrumb ofc).

@ghost
Copy link

ghost commented Jun 15, 2021

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 15, 2021
@Katli95 Katli95 changed the title <FilePicker/> Add properties ford default library- & folderPath for <SiteFilePicker/> <FilePicker/> Add properties for default library- & folderPath for <SiteFilePicker/> Jun 15, 2021
@Katli95
Copy link
Contributor Author

Katli95 commented Jun 16, 2021

For anyone interested I've started working on this here, I've added one commit for the initial logic of parsing the string property "defaultFolderAbsolutePath". Next up is to add everything to the breadcrumb to preserve current functionality. Feel free to comment.

@joelfmrodrigues joelfmrodrigues added status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:enhancement New feature or enhancement of existing capability and removed Needs: Triage 🔍 labels Jun 16, 2021
@joelfmrodrigues
Copy link
Collaborator

@Katli95 Both are great suggestions!
Also, the FilePicker control was recently updated to return an array of results (instead of a single file) so this should make things easier to enable the selection of multiple files.
I have assigned this issue to you so others know it's already being addressed and we avoid duplication of effort.
Let me know if you need any help

@Katli95
Copy link
Contributor Author

Katli95 commented Jun 17, 2021

@joelfmrodrigues awesome! Thank you, no need for help as is, just a question: do you have an idea of how long it may take to get this released once I submit? I'm working on a project atm that requires this feature 😇

@joelfmrodrigues
Copy link
Collaborator

It should not take long to review the PR, and after it's merged a new beta version is automatically created and published to npm so you can install it and then update later to a major release.
PRs from the last last 2-3 weeks have been delayed a bit as only Alex was able to review them but things should be better now as I was able to close 3 projects this week and can focus on this again😊

@Katli95
Copy link
Contributor Author

Katli95 commented Jun 18, 2021

Awesome, glad to hear it! How free should I feel to generally refactor the code? (Nothing major ofc, but somehting like changing variable names and removing obsolete code?

@joelfmrodrigues
Copy link
Collaborator

@Katli95 Ideally, try to only modify the code that is relevant and necessary to what you are implementing. This is a common approach with many open source projects as otherwise code reviews would be more complex and someone else implementing features on related code could be impacted and have to deal with code conflicts, etc. If for example, you move a block of code, it's all marked as a change in the code review and impossible to identify if something changes unless we compare line by line. Even something simple like letting VS Code format an entire document can cause a lot of changes in the pull-request and is discouraged.

Please check the Do's and Dont's section of the documentation:
https://pnp.github.io/sp-dev-fx-controls-react/guides/contributing/#dos-donts

@Katli95
Copy link
Contributor Author

Katli95 commented Jun 18, 2021

Awesome, ok, good to know, hahah yeah, first thing I did was to disable prettier. And yeah, I looked through those before I began. I was mainly thinking of renaming state variables to make their intention clearer as I had some trouble understanding them at first and also removing some which don't seem to be used anymore. But I'll restrain myself and let it lie 😅

Should submit the pull request this weekend 🙌 I've finished most of the actual work, just have to add the docs and learn to rebase. If you have the time I'd be grateful if you could look at it and let me know if I'm doing something wrong, if not ofc I understand.

@joelfmrodrigues
Copy link
Collaborator

Well, this is a bit of a different story then 😊
I would be fine with removing unused variables and even rename variables if the name is not indicative of their purpose and confusing.
One thing that I would suggest, is that you do this as a separate PR (using a new branch from dev, not your previous branch) as it's not directly related to the feature you are implementing and can be submitted as a completely isolated improvement to the code

@Katli95
Copy link
Contributor Author

Katli95 commented Jul 1, 2021

My pull request has been merged, so I'm closing the issue :)

@Katli95 Katli95 closed this as completed Jul 1, 2021
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Jul 1, 2021

Please don't close until the version is released.

@AJIXuMuK AJIXuMuK reopened this Jul 1, 2021
@Katli95
Copy link
Contributor Author

Katli95 commented Jul 1, 2021

Oh, sorry, didn't know that's how this works ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:enhancement New feature or enhancement of existing capability
Projects
None yet
Development

No branches or pull requests

3 participants