Skip to content

Commit 0d856aa

Browse files
authored
Merge pull request #889 from pnp/v2-dev
Merge for v2.7.0
2 parents 3d1cb39 + d955573 commit 0d856aa

File tree

60 files changed

+1878
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1878
-186
lines changed

.circleci/config.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ jobs:
2929
- run:
3030
name: build
3131
command: npm run build
32-
- run:
33-
name: sonarcloud:config
34-
command: npm run sonarcloud:config $SONARCLOUD_TOKEN $CIRCLE_BRANCH
35-
- run:
36-
name: sonarcloud:start
37-
command: npm run sonarcloud:start
3832
- persist_to_workspace:
3933
root: .
4034
paths: .
@@ -126,7 +120,7 @@ workflows:
126120
- build:
127121
filters:
128122
branches:
129-
ignore: /^(dev|master|v2)/
123+
ignore: /^(dev|master|v2|v2-dev|v1-dev)/
130124
release_next:
131125
jobs:
132126
- build:
@@ -135,6 +129,7 @@ workflows:
135129
only:
136130
- dev
137131
- v2
132+
- v2-dev
138133
- build_next:
139134
requires:
140135
- build
@@ -143,6 +138,7 @@ workflows:
143138
only:
144139
- dev
145140
- v2
141+
- v2-dev
146142
- publish_next:
147143
requires:
148144
- build_next
@@ -151,6 +147,7 @@ workflows:
151147
only:
152148
- dev
153149
- v2
150+
- v2-dev
154151
release:
155152
jobs:
156153
- build:

.husky/_/husky.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
if [ -z "$husky_skip_init" ]; then
3+
debug () {
4+
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
5+
}
6+
7+
readonly hook_name="$(basename "$0")"
8+
debug "starting $hook_name..."
9+
10+
if [ "$HUSKY" = "0" ]; then
11+
debug "HUSKY env variable is set to 0, skipping hook"
12+
exit 0
13+
fi
14+
15+
if [ -f ~/.huskyrc ]; then
16+
debug "sourcing ~/.huskyrc"
17+
. ~/.huskyrc
18+
fi
19+
20+
export readonly husky_skip_init=1
21+
sh -e "$0" "$@"
22+
exitCode="$?"
23+
24+
if [ $exitCode != 0 ]; then
25+
echo "husky - $hook_name hook exited with code $exitCode (error)"
26+
exit $exitCode
27+
fi
28+
29+
exit 0
30+
fi

CHANGELOG.JSON

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
{
22
"versions": [
3+
{
4+
"version": "2.7.0",
5+
"changes": {
6+
"new": [
7+
"`DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
8+
"`SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)",
9+
"`Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)"
10+
],
11+
"enhancements": [
12+
"`ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
13+
"`FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)",
14+
"`ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)",
15+
"`FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)",
16+
"`FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)",
17+
"`FilePicker`: Changed save function to return an array of objects"
18+
],
19+
"fixes": [
20+
"`PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)",
21+
"`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)",
22+
"`FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)",
23+
"`ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)",
24+
"`RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)",
25+
"`FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)"
26+
]
27+
},
28+
"contributions": [
29+
"[André Lage](https://github.com/aaclage)",
30+
"[cwparsons](https://github.com/cwparsons)",
31+
"[Kunj Balkrishna Sangani](https://github.com/kunj-sangani)",
32+
"[Yannick Reekmans](https://github.com/YannickRe)"
33+
]
34+
},
335
{
436
"version": "2.6.0",
537
"changes": {
@@ -20,7 +52,8 @@
2052
"`AccessibleAccordion`: documentation link is broken [#818](https://github.com/pnp/sp-dev-fx-controls-react/issues/818)",
2153
"Documentation: Controls link in the menu is broken [#821](https://github.com/pnp/sp-dev-fx-controls-react/pull/821)",
2254
"`TreeView`: Fix two potential null reference issues [#832](https://github.com/pnp/sp-dev-fx-controls-react/pull/832)",
23-
"`RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)"
55+
"`RichText`: Problem with bullets and number list [#795](https://github.com/pnp/sp-dev-fx-controls-react/issues/795)",
56+
"`TreeView`: Don't expand selected nodes when using expandToSelected [#850](https://github.com/pnp/sp-dev-fx-controls-react/pull/850)"
2457
]
2558
},
2659
"contributions": [
@@ -31,7 +64,8 @@
3164
"[Marcin Wojciechowski](https://github.com/mgwojciech)",
3265
"[Mark Bice](https://github.com/mbice)",
3366
"[Nizar Grindi](https://github.com/NizarGrindi)",
34-
"[Yannick Reekmans](https://github.com/YannickRe)"
67+
"[Yannick Reekmans](https://github.com/YannickRe)",
68+
"[mk0023](https://github.com/mk0023)"
3569
]
3670
},
3771
{

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Releases
22

3+
## 2.7.0
4+
5+
### New control(s)
6+
7+
- `DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
8+
- `SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)
9+
- `Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)
10+
11+
### Enhancements
12+
13+
- `ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
14+
- `FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
15+
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
16+
- `FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)
17+
- `FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)
18+
- `FilePicker`: Changed save function to return an array of objects
19+
20+
### Fixes
21+
22+
- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
23+
- `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)
24+
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
25+
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
26+
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
27+
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)
28+
29+
### Contributors
30+
31+
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).
32+
333
## 2.6.0
434

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

2758
### Contributors
2859

29-
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).
60+
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).
3061

3162
## 2.5.0
3263

docs/documentation/docs/about/release-notes.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Releases
22

3+
## 2.7.0
4+
5+
### New control(s)
6+
7+
- `DragDropFiles`: new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
8+
- `SitePicker` new Site Picker control [#867](https://github.com/pnp/sp-dev-fx-controls-react/pull/867)
9+
- `Controls` Add locale strings for pt-br [#865](https://github.com/pnp/sp-dev-fx-controls-react/pull/865)
10+
11+
### Enhancements
12+
13+
- `ListView`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
14+
- `FilePicker`: Use new DragDropFiles control [#856](https://github.com/pnp/sp-dev-fx-controls-react/issues/856)
15+
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
16+
- `FilePicker`: Allow panel on FilePicker to be invoked after first load [#886](https://github.com/pnp/sp-dev-fx-controls-react/issues/886)
17+
- `FilePicker`: Allow FilePicker button to be hidden [#887](https://github.com/pnp/sp-dev-fx-controls-react/issues/887)
18+
- `FilePicker`: Changed save function to return an array of objects
19+
20+
### Fixes
21+
22+
- `PeoplePicker`: error message isn't cleared after `onGetErrorMessage` returns an empty string [#841](https://github.com/pnp/sp-dev-fx-controls-react/issues/841)
23+
- `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)
24+
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
25+
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
26+
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
27+
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)
28+
29+
### Contributors
30+
31+
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).
32+
333
## 2.6.0
434

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

2758
### Contributors
2859

29-
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).
60+
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).
3061

3162
## 2.5.0
3263

11.1 KB
Loading
18.2 KB
Loading
1.76 MB
Loading
1.71 MB
Loading
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# DragDropFiles
2+
3+
This control allows to drag and drop files in pre defined areas.
4+
5+
## How to use this control in your solutions
6+
7+
- 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.
8+
- Import the following modules to your component:
9+
10+
```TypeScript
11+
import { DragDropFiles } from "@pnp/spfx-controls-react/lib/DragDropFiles";
12+
```
13+
14+
- Use the DragDropFiles control in your code as follows:
15+
16+
```jsx
17+
<DragDropFiles
18+
dropEffect="copy"
19+
enable={true}
20+
onDrop={this._getDropFiles}
21+
iconName="Upload"
22+
labelMessage= "My custom upload File"
23+
>
24+
{/* Specify the components to load where Drag and drop area should work */}
25+
</DragDropFiles>
26+
```
27+
**Content with drag and drop applied**
28+
29+
```jsx
30+
<DragDropFiles
31+
dropEffect="copy"
32+
enable={true}
33+
onDrop={this._getDropFiles}
34+
iconName="Upload"
35+
labelMessage= "My custom upload File"
36+
>
37+
Drag and drop here...
38+
39+
</DragDropFiles>
40+
```
41+
![Custom html with drag and drop](../assets/DragDropFilesSample1.png)
42+
43+
**ListView with drag and drop applied**
44+
45+
![ListView control with drag and drop Control](../assets/ListView-DragDrop.png)
46+
47+
**FilePicker with drag and drop applied**
48+
49+
![FilePicker control with grouping](../assets/DragDropFilesSample2.png)
50+
51+
- With the `onDrop` handler you can define a method that returns files and files inside folders that where drag and drop by user.
52+
53+
**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.**
54+
55+
```typescript
56+
private _getDropFiles = (files) => {
57+
for (var i = 0; i < files.length; i++) {
58+
console.log("Filename: " + files[i].name);
59+
console.log("Path: " + files[i].fullPath);
60+
}
61+
}
62+
```
63+
64+
## Implementation
65+
66+
The `DragDropFiles` can be configured with the following properties:
67+
68+
| Property | Type | Required | Description |
69+
| ---- | ---- | ---- | ---- |
70+
| dropEffect | string | no | Visual feedback given to user during a drag and drop operation (copy,move,link,none). Default value is `copy`. |
71+
| enable | boolean | no | Option allow control to be enable or disable. Default value is `true`|
72+
| labelMessage | string | no | Message displayed in drag drop preview. |
73+
| onDrop | any | no | Method that returns all Files[] from drag and drop file area. |
74+
| iconName | string | no | Icon Name from Office UI Fabric Icons. |
75+
76+
77+
78+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/DragDropFiles)

0 commit comments

Comments
 (0)