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

Merge for v2.7.0 #889

Merged
merged 64 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
83a1834
Bug/804 (#850)
joelfmrodrigues Mar 26, 2021
96be171
Changelog
joelfmrodrigues Mar 26, 2021
f6f8bc4
v2: fix of #841
AJIXuMuK Mar 30, 2021
4d15c4d
changelog
AJIXuMuK Mar 30, 2021
c5284d2
pre-commit
AJIXuMuK Mar 30, 2021
97e0531
2.7.0
AJIXuMuK Mar 30, 2021
659d324
version
AJIXuMuK Mar 30, 2021
9924e0d
DragDropFiles Control and integration with ListView and FilePicker
aaclage Mar 31, 2021
1cd349a
Remove webkitGetAsEntry method, not standard and supported.
aaclage Apr 1, 2021
b01c007
reverted code to include webkitGetAsEntry and getAsEntry method with …
aaclage Apr 1, 2021
3a74e48
Update validation when folder.
aaclage Apr 1, 2021
b8e04b0
Merge pull request #856 from aaclage/Feature/DragDropFilesControl
joelfmrodrigues Apr 1, 2021
2fcb221
changelog
joelfmrodrigues Apr 1, 2021
9a7b5ce
Missing link for new control DragDropFiles
aaclage Apr 1, 2021
e59fb52
Merge pull request #858 from aaclage/Feature/DragDropFileDocUpdate
joelfmrodrigues Apr 2, 2021
febe234
basic UI
AJIXuMuK Apr 5, 2021
2cb535a
Fix to keep traversing tree, even if parent is selected. Potentially …
YannickRe Apr 5, 2021
7cd071f
Added a dot
YannickRe Apr 5, 2021
f60eb70
custom render + searchbox
AJIXuMuK Apr 5, 2021
3eb0827
selection
AJIXuMuK Apr 6, 2021
a9ed216
search
AJIXuMuK Apr 6, 2021
6913544
fixed search, some styling
AJIXuMuK Apr 6, 2021
2639139
#857 Added locale pt-br
kunj-sangani Apr 6, 2021
80ad59d
#857 Added locale pt-br
kunj-sangani Apr 6, 2021
f57cdd2
#857 Added locale pt-br
kunj-sangani Apr 6, 2021
64ba21b
functionality is ready
AJIXuMuK Apr 6, 2021
2a70957
docs, correct export, telemetry
AJIXuMuK Apr 6, 2021
e176dff
Merge pull request #867 from pnp/site-picker
AJIXuMuK Apr 6, 2021
39a4a8b
changelog
AJIXuMuK Apr 6, 2021
7eaf8ad
circleCI
AJIXuMuK Apr 7, 2021
fc4bd0a
node v10 for circleCI
AJIXuMuK Apr 7, 2021
6e0c50a
Fix warning on MultiUploadFilePickerTab
joelfmrodrigues Apr 7, 2021
4e46258
SitePicker: correct defaults for allowSearch and mode
AJIXuMuK Apr 8, 2021
ebdca02
Merge branch 'v2-dev' of https://github.com/pnp/sp-dev-fx-controls-re…
AJIXuMuK Apr 8, 2021
1cebf38
Update "MultipleUploadFilePicket" to "MultipleUploadFilePicker"
aaclage Apr 9, 2021
28344c1
#801 updated filename replacement logic
kunj-sangani Apr 10, 2021
37659cc
Merge pull request #864 from YannickRe/v2-dev
AJIXuMuK Apr 11, 2021
fdc5d7d
changelog
AJIXuMuK Apr 11, 2021
f64b2d1
pre-commit
AJIXuMuK Apr 11, 2021
abb6416
Fix #799 React error in FileBrowser paging
cwparsons Apr 8, 2021
b653901
changelog
AJIXuMuK Apr 11, 2021
a42be9e
pre-commit
AJIXuMuK Apr 11, 2021
9132568
Merge pull request #872 from aaclage/Feature/DragDropUpdateRefV2
AJIXuMuK Apr 11, 2021
bf57225
Merge pull request #873 from kunj-sangani/659
AJIXuMuK Apr 11, 2021
efeb9dd
changelog
AJIXuMuK Apr 11, 2021
216fa56
pre-commit
AJIXuMuK Apr 11, 2021
6bd3482
Merge pull request #865 from kunj-sangani/216
joelfmrodrigues Apr 11, 2021
4421879
changelog
joelfmrodrigues Apr 11, 2021
7f4d032
fix of #875
AJIXuMuK Apr 17, 2021
8528d6c
changelog
AJIXuMuK Apr 17, 2021
d9441a2
pre-commit
AJIXuMuK Apr 17, 2021
be4e4f8
fix of #882
AJIXuMuK May 1, 2021
751aff9
changelog
AJIXuMuK May 1, 2021
74f27fb
#880 - ability to provide custom sorting function to the ListView
AJIXuMuK May 1, 2021
1cb5844
changelog
AJIXuMuK May 1, 2021
c0117c9
Fix display width of File Picker multi-upload
joelfmrodrigues May 3, 2021
8865603
Allow panel on FilePicker to be open after first load
joelfmrodrigues May 3, 2021
e81e729
fix endentation and update changelog
joelfmrodrigues May 3, 2021
a0f67b0
Allow FilePicker button to be hidden
joelfmrodrigues May 3, 2021
9483596
changelog
joelfmrodrigues May 3, 2021
eae8e36
FilePicker multi upload update to open file explorer
joelfmrodrigues May 4, 2021
891fe4f
Update file picker to return an array of files
joelfmrodrigues May 5, 2021
07d9030
changelog
joelfmrodrigues May 5, 2021
d955573
Updated changelog
estruyf May 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:
- run:
name: build
command: npm run build
- run:
name: sonarcloud:config
command: npm run sonarcloud:config $SONARCLOUD_TOKEN $CIRCLE_BRANCH
- run:
name: sonarcloud:start
command: npm run sonarcloud:start
- persist_to_workspace:
root: .
paths: .
Expand Down Expand Up @@ -126,7 +120,7 @@ workflows:
- build:
filters:
branches:
ignore: /^(dev|master|v2)/
ignore: /^(dev|master|v2|v2-dev|v1-dev)/
release_next:
jobs:
- build:
Expand All @@ -135,6 +129,7 @@ workflows:
only:
- dev
- v2
- v2-dev
- build_next:
requires:
- build
Expand All @@ -143,6 +138,7 @@ workflows:
only:
- dev
- v2
- v2-dev
- publish_next:
requires:
- build_next
Expand All @@ -151,6 +147,7 @@ workflows:
only:
- dev
- v2
- v2-dev
release:
jobs:
- build:
Expand Down
30 changes: 30 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
}

readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
exit $exitCode
fi

exit 0
fi
38 changes: 36 additions & 2 deletions CHANGELOG.JSON
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
{
"versions": [
{
"version": "2.7.0",
"changes": {
"new": [
"`DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
"`SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)",
"`Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)"
],
"enhancements": [
"`ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
"`FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
"`ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)",
"`FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)",
"`FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)",
"`FilePicker`: Changed save function to return an array of objects"
],
"fixes": [
"`PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)",
"`TreeView`: Not able to select/deselect checkbox in spfx-controls-react TreeView after assign the defaultSelectedKeys value [#870](https://github.com/pnp/sp-dev-fx-controls-react/issues/870)",
"`FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)",
"`ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)",
"`RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)",
"`FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)"
]
},
"contributions": [
"[André Lage](https://github.com/aaclage)",
"[cwparsons](https://github.com/cwparsons)",
"[Kunj Balkrishna Sangani](https://github.com/kunj-sangani)",
"[Yannick Reekmans](https://github.com/YannickRe)"
]
},
{
"version": "2.6.0",
"changes": {
Expand All @@ -20,7 +52,8 @@
"`AccessibleAccordion`: documentation link is broken [#818](https://github.com/pnp/sp-dev-fx-controls-react/issues/818)",
"Documentation: Controls link in the menu is broken [#821](https://github.com/pnp/sp-dev-fx-controls-react/pull/821)",
"`TreeView`: Fix two potential null reference issues [#832](https://github.com/pnp/sp-dev-fx-controls-react/pull/832)",
"`RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)"
"`RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)",
"`TreeView`: Don't expand selected nodes when using expandToSelected [#850](https://github.com/pnp/sp-dev-fx-controls-react/pull/850)"
]
},
"contributions": [
Expand All @@ -31,7 +64,8 @@
"[Marcin Wojciechowski](https://github.com/mgwojciech)",
"[Mark Bice](https://github.com/mbice)",
"[Nizar Grindi](https://github.com/NizarGrindi)",
"[Yannick Reekmans](https://github.com/YannickRe)"
"[Yannick Reekmans](https://github.com/YannickRe)",
"[mk0023](https://github.com/mk0023)"
]
},
{
Expand Down
33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Releases

## 2.7.0

### New control(s)

- `DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)
- `Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)

### Enhancements

- `ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
- `FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)
- `FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)
- `FilePicker`: Changed save function to return an array of objects

### Fixes

- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
- `TreeView`: Not able to select/deselect checkbox in spfx-controls-react TreeView after assign the defaultSelectedKeys value [#870](https://github.com/pnp/sp-dev-fx-controls-react/issues/870)
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)

### Contributors

Special thanks to our contributors (in alphabetical order): [André Lage](https://github.com/aaclage), [cwparsons](https://github.com/cwparsons), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Yannick Reekmans](https://github.com/YannickRe).

## 2.6.0

### New control(s)
Expand All @@ -23,10 +53,11 @@
- Documentation: Controls link in the menu is broken [#821](https://github.com/pnp/sp-dev-fx-controls-react/pull/821)
- `TreeView`: Fix two potential null reference issues [#832](https://github.com/pnp/sp-dev-fx-controls-react/pull/832)
- `RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)
- `TreeView`: Don't expand selected nodes when using expandToSelected [#850](https://github.com/pnp/sp-dev-fx-controls-react/pull/850)

### Contributors

Special thanks to our contributors (in alphabetical order): [Anoop Tatti](https://github.com/anoopt), [Ari Gunawan](https://github.com/AriGunawan), [Gautam Sheth](https://github.com/gautamdsheth), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Marcin Wojciechowski](https://github.com/mgwojciech), [Mark Bice](https://github.com/mbice), [Nizar Grindi](https://github.com/NizarGrindi), [Yannick Reekmans](https://github.com/YannickRe).
Special thanks to our contributors (in alphabetical order): [Anoop Tatti](https://github.com/anoopt), [Ari Gunawan](https://github.com/AriGunawan), [Gautam Sheth](https://github.com/gautamdsheth), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Marcin Wojciechowski](https://github.com/mgwojciech), [Mark Bice](https://github.com/mbice), [Nizar Grindi](https://github.com/NizarGrindi), [Yannick Reekmans](https://github.com/YannickRe), [mk0023](https://github.com/mk0023).

## 2.5.0

Expand Down
33 changes: 32 additions & 1 deletion docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Releases

## 2.7.0

### New control(s)

- `DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)
- `Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)

### Enhancements

- `ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
- `FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)
- `FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)
- `FilePicker`: Changed save function to return an array of objects

### Fixes

- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
- `TreeView`: Not able to select/deselect checkbox in spfx-controls-react TreeView after assign the defaultSelectedKeys value [#870](https://github.com/pnp/sp-dev-fx-controls-react/issues/870)
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)

### Contributors

Special thanks to our contributors (in alphabetical order): [André Lage](https://github.com/aaclage), [cwparsons](https://github.com/cwparsons), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Yannick Reekmans](https://github.com/YannickRe).

## 2.6.0

### New control(s)
Expand All @@ -23,10 +53,11 @@
- Documentation: Controls link in the menu is broken [#821](https://github.com/pnp/sp-dev-fx-controls-react/pull/821)
- `TreeView`: Fix two potential null reference issues [#832](https://github.com/pnp/sp-dev-fx-controls-react/pull/832)
- `RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)
- `TreeView`: Don't expand selected nodes when using expandToSelected [#850](https://github.com/pnp/sp-dev-fx-controls-react/pull/850)

### Contributors

Special thanks to our contributors (in alphabetical order): [Anoop Tatti](https://github.com/anoopt), [Ari Gunawan](https://github.com/AriGunawan), [Gautam Sheth](https://github.com/gautamdsheth), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Marcin Wojciechowski](https://github.com/mgwojciech), [Mark Bice](https://github.com/mbice), [Nizar Grindi](https://github.com/NizarGrindi), [Yannick Reekmans](https://github.com/YannickRe).
Special thanks to our contributors (in alphabetical order): [Anoop Tatti](https://github.com/anoopt), [Ari Gunawan](https://github.com/AriGunawan), [Gautam Sheth](https://github.com/gautamdsheth), [Kunj Balkrishna Sangani](https://github.com/kunj-sangani), [Marcin Wojciechowski](https://github.com/mgwojciech), [Mark Bice](https://github.com/mbice), [Nizar Grindi](https://github.com/NizarGrindi), [Yannick Reekmans](https://github.com/YannickRe), [mk0023](https://github.com/mk0023).

## 2.5.0

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/documentation/docs/controls/DragDropFiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# DragDropFiles

This control allows to drag and drop files in pre defined areas.

## How to use this control in your solutions

- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency.
- Import the following modules to your component:

```TypeScript
import { DragDropFiles } from "@pnp/spfx-controls-react/lib/DragDropFiles";
```

- Use the DragDropFiles control in your code as follows:

```jsx
<DragDropFiles
dropEffect="copy"
enable={true}
onDrop={this._getDropFiles}
iconName="Upload"
labelMessage= "My custom upload File"
>
{/* Specify the components to load where Drag and drop area should work */}
</DragDropFiles>
```
**Content with drag and drop applied**

```jsx
<DragDropFiles
dropEffect="copy"
enable={true}
onDrop={this._getDropFiles}
iconName="Upload"
labelMessage= "My custom upload File"
>
Drag and drop here...

</DragDropFiles>
```
![Custom html with drag and drop](../assets/DragDropFilesSample1.png)

**ListView with drag and drop applied**

![ListView control with drag and drop Control](../assets/ListView-DragDrop.png)

**FilePicker with drag and drop applied**

![FilePicker control with grouping](../assets/DragDropFilesSample2.png)

- With the `onDrop` handler you can define a method that returns files and files inside folders that where drag and drop by user.

**PS: New property "fullPath" was included in file object to allow identify dropped files based on Folders, this allow users to create associated folder path.**

```typescript
private _getDropFiles = (files) => {
for (var i = 0; i < files.length; i++) {
console.log("Filename: " + files[i].name);
console.log("Path: " + files[i].fullPath);
}
}
```

## Implementation

The `DragDropFiles` can be configured with the following properties:

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| dropEffect | string | no | Visual feedback given to user during a drag and drop operation (copy,move,link,none). Default value is `copy`. |
| enable | boolean | no | Option allow control to be enable or disable. Default value is `true`|
| labelMessage | string | no | Message displayed in drag drop preview. |
| onDrop | any | no | Method that returns all Files[] from drag and drop file area. |
| iconName | string | no | Icon Name from Office UI Fabric Icons. |



![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/DragDropFiles)
Loading