Skip to content

Commit

Permalink
Merge pull request #889 from pnp/v2-dev
Browse files Browse the repository at this point in the history
Merge for v2.7.0
  • Loading branch information
estruyf committed May 5, 2021
2 parents 3d1cb39 + d955573 commit 0d856aa
Show file tree
Hide file tree
Showing 60 changed files with 1,878 additions and 186 deletions.
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

0 comments on commit 0d856aa

Please sign in to comment.