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

Merging for 1.20.0 #294

Merged
merged 30 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3217468
1.20.0
estruyf Jun 17, 2020
5c7a042
Role Definition picker - first checkin
gautamdsheth Jun 28, 2020
fcf70f4
Added documentation for role definition picker
gautamdsheth Jun 28, 2020
2c3798f
Docs changes
gautamdsheth Jun 28, 2020
37f5641
Docs fixes
gautamdsheth Jun 30, 2020
3dd3b68
Adds multiselect option for role definition picker
gautamdsheth Jul 4, 2020
4f47aae
import fix in docs
AJIXuMuK Jul 4, 2020
5ce32f3
Merge branch 'gautamdsheth-feature/roleDefinitionPicker' into dev
AJIXuMuK Jul 4, 2020
c6e695c
changelog
AJIXuMuK Jul 4, 2020
5c7760d
doc nav fix
AJIXuMuK Jul 4, 2020
f6de5a9
fix of #269
AJIXuMuK Jul 4, 2020
e183ee0
changelog
AJIXuMuK Jul 4, 2020
d8d0fe4
Added dynamic options to ICustomCollectionField
lafe Jul 8, 2020
7b37ecc
Fixed link to project guides
lafe Jul 8, 2020
fa2697a
Feature: Added folder picker control
gautamdsheth Jul 25, 2020
2cb4115
Merge pull request #270 from lafe/DynamicOptions
AJIXuMuK Jul 26, 2020
3698900
Merge pull request #271 from lafe/GuidesLinkFix
AJIXuMuK Jul 26, 2020
17d6972
Merge pull request #273 from gautamdsheth/feature/folderPickerCotntrol
AJIXuMuK Jul 26, 2020
04b847e
changelog
AJIXuMuK Jul 26, 2020
3be2303
Added missing webAbsoluteUrl, fixes #263
hugoabernier Jul 28, 2020
c2deaa0
Merge pull request #274 from hugoabernier/hb-patch-1
AJIXuMuK Jul 29, 2020
83435b3
changelog
AJIXuMuK Jul 29, 2020
12caac5
=== instead of ==
AJIXuMuK Jul 29, 2020
0a277da
Initial version
hugoabernier Aug 3, 2020
570e5fc
Merge branch 'markdown-property-control' of https://github.com/hugoab…
AJIXuMuK Aug 6, 2020
ea77ba9
ErrorMessage import fix, docs: markdown url on index page
AJIXuMuK Aug 6, 2020
9917762
Merge branch 'hugoabernier-markdown-property-control' into dev
AJIXuMuK Aug 6, 2020
1472053
changelog
AJIXuMuK Aug 6, 2020
0bfa42b
code of conduct section header
AJIXuMuK Aug 28, 2020
3aef44f
Updated changelog
estruyf Sep 9, 2020
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
23 changes: 23 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{
"versions": [
{
"version": "1.20.0",
"changes": {
"new": [
"`PropertyFieldRoleDefinitionPicker`: new Role Definition Picker control [#268](https://github.com/pnp/sp-dev-fx-property-controls/pull/268)",
"`PropertyFieldFolderPicker`: new Folder Picker control [#272](https://github.com/pnp/sp-dev-fx-property-controls/issues/272)",
"`PropertyPaneMarkdownContent`: new Markdown Content control [#162](https://github.com/pnp/sp-dev-fx-property-controls/issues/162)"
],
"enhancements": [
"`PropertyFieldCollectionData`: Dynamic options [#260](https://github.com/pnp/sp-dev-fx-property-controls/issues/260)"
],
"fixes": [
"Documentation fix: Link to `PropertyFieldListPicker` control points to `PropertyFieldMessage` [#269](https://github.com/pnp/sp-dev-fx-property-controls/issues/269)",
"Readme fix: fixed link to project guides [#271](https://github.com/pnp/sp-dev-fx-property-controls/pull/271)",
"`PropertyFieldViewPicker`: Unable to load Views from another site [#263](https://github.com/pnp/sp-dev-fx-property-controls/issues/263)"
]
},
"contributions": [
"[Gautam Sheth](https://github.com/gautamdsheth)",
"[Hugo Bernier](https://github.com/hugoabernier)",
"[Lars Fernhomberg](https://github.com/lafe)"
]
},
{
"version": "1.19.0",
"changes": {
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Releases

## 1.20.0

### New control(s)

- `PropertyFieldRoleDefinitionPicker`: new Role Definition Picker control [#268](https://github.com/pnp/sp-dev-fx-property-controls/pull/268)
- `PropertyFieldFolderPicker`: new Folder Picker control [#272](https://github.com/pnp/sp-dev-fx-property-controls/issues/272)
- `PropertyPaneMarkdownContent`: new Markdown Content control [#162](https://github.com/pnp/sp-dev-fx-property-controls/issues/162)

### Enhancements

- `PropertyFieldCollectionData`: Dynamic options [#260](https://github.com/pnp/sp-dev-fx-property-controls/issues/260)

### Fixes

- Documentation fix: Link to `PropertyFieldListPicker` control points to `PropertyFieldMessage` [#269](https://github.com/pnp/sp-dev-fx-property-controls/issues/269)
- Readme fix: fixed link to project guides [#271](https://github.com/pnp/sp-dev-fx-property-controls/pull/271)
- `PropertyFieldViewPicker`: Unable to load Views from another site [#263](https://github.com/pnp/sp-dev-fx-property-controls/issues/263)

### Contributors

Special thanks to our contributors (in alphabetical order): [Gautam Sheth](https://github.com/gautamdsheth), [Hugo Bernier](https://github.com/hugoabernier), [Lars Fernhomberg](https://github.com/lafe).

## 1.19.0

### New control(s)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ This project welcomes contributions and suggestions. Most contributions require

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

If you have ideas for new features or feedback, let us know by creating an issue in the [issues list](https://github.com/pnp/sp-dev-fx-property-controls/issues). Before you submit a PR with your improvements, please review our [project guides](./docs/guides/index.md).
If you have ideas for new features or feedback, let us know by creating an issue in the [issues list](https://github.com/pnp/sp-dev-fx-property-controls/issues). Before you submit a PR with your improvements, please review our [project guides](./docs/documentation/docs/guides/index.md).

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
Expand Down
2 changes: 1 addition & 1 deletion config/serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://dev.office.com/json-schemas/core-build/serve.schema.json",
"port": 4321,
"initialPage": "https://localhost:5432/workbench",
"https": false,
"https": true,
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
Expand Down
22 changes: 22 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Releases

## 1.20.0

### New control(s)

- `PropertyFieldRoleDefinitionPicker`: new Role Definition Picker control [#268](https://github.com/pnp/sp-dev-fx-property-controls/pull/268)
- `PropertyFieldFolderPicker`: new Folder Picker control [#272](https://github.com/pnp/sp-dev-fx-property-controls/issues/272)
- `PropertyPaneMarkdownContent`: new Markdown Content control [#162](https://github.com/pnp/sp-dev-fx-property-controls/issues/162)

### Enhancements

- `PropertyFieldCollectionData`: Dynamic options [#260](https://github.com/pnp/sp-dev-fx-property-controls/issues/260)

### Fixes

- Documentation fix: Link to `PropertyFieldListPicker` control points to `PropertyFieldMessage` [#269](https://github.com/pnp/sp-dev-fx-property-controls/issues/269)
- Readme fix: fixed link to project guides [#271](https://github.com/pnp/sp-dev-fx-property-controls/pull/271)
- `PropertyFieldViewPicker`: Unable to load Views from another site [#263](https://github.com/pnp/sp-dev-fx-property-controls/issues/263)

### Contributors

Special thanks to our contributors (in alphabetical order): [Gautam Sheth](https://github.com/gautamdsheth), [Hugo Bernier](https://github.com/hugoabernier), [Lars Fernhomberg](https://github.com/lafe).

## 1.19.0

### New control(s)
Expand Down
Binary file added docs/documentation/docs/assets/badmarkdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/documentation/docs/assets/folderPicker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/documentation/docs/assets/goodmarkdown.png
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.
Binary file added docs/documentation/docs/assets/roleDef1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/documentation/docs/assets/roleDefPicker1.gif
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/PropertyFIeldFolderPicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# PropertyFieldFolderPicker control

This control allows you to explore and select a folder from the propery pane.
It also allows the user to create a new folder at the current level being explored.

Here is an example of the control:


**PropertyFieldFolderPicker example usage**

![PropertyFieldFolderPicker example](../assets/folderPicker.gif)

## How to use this control in your solutions

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

```TypeScript
import { IFolder, IPropertyFieldFolderPickerProps , PropertyFieldFolderPicker } from "@pnp/spfx-property-controls/lib/PropertyFieldFolderPicker";
```

Create a new property for your web part, for example:

```TypeScript
export interface IPropertyControlsTestWebPartProps {
folderPicker: IFolder;
}
```

- Add the folder picker property control to the `groupFields` of the web part property pane configuration:

```TypeScript
PropertyFieldFolderPicker('folderPicker', {
context: this.context,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
properties: this.properties,
key: "folderPickerId",
label: "Folder Picker",
selectedFolder: this.properties.folderPicker,
canCreateFolders: true,
onSelect: ((folder: IFolder) => { console.log(folder); this.properties.folderPicker = folder; }),
rootFolder: {
Name: "Documents",
ServerRelativeUrl: "/sites/testSiteCollection/Shared Documents"
},
}),
```

## Implementation

The `PropertyFieldFolderPicker` control can be configured with the following properties:

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| context | WebPartContext | yes | The context object of the SPFx loaded webpart. |
| label | string | yes | The label for the control. |
| rootFolder | IFolder | yes | The lowest level folder that can be explored. This can be the root folder of a library. |
| selectedFolder | IFolder | yes | Store the results of the folder picker. |
| defaultFolder | IFolder | no | The default folder to be selected or explored. |
| properties | any | yes | Parent web part properties, this object is used to update the property value. |
| key | string | yes | A unique key that indicates the identity of this control. |
| onPropertyChange | function | yes | Defines a onPropertyChange function to raise when the data gets changed. |
| required | boolean | no | Is selection required. |
| disabled | boolean | no | Is the control disabled. |
| canCreateFolders | boolean | no | Allow current user to create folders on the target location. If enabled, you need to ensure that the user has the required permissions. |
| onSelect | (folder: IFolder): void | no | Callback function called after a folder is selected. |


interface `IFolder`

The value returned from the selected folder object.

| Value | Type | Description |
| ---- | ---- | ---- |
| Name | string | Name of the folder. |
| ServerRelativeUrl | string | Server relative URL of the folder. |

![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/PropertyFieldFolderPicker)
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Interface `ICustomCollectionField`
| type | CustomCollectionFieldType | yes | Specifies the type of field to render. |
| disableEdit | boolean | no | Allows you to specify if a field is disabled for editing. |
| required | boolean | no | Specify if the field is required. |
| options | [IDropdownOption[]](https://developer.microsoft.com/en-us/fabric#/components/dropdown) | no | Dropdown options. Only necessary when dropdown type is used. |
| options | [IDropdownOption[]](https://developer.microsoft.com/en-us/fabric#/components/dropdown) \| (fieldId: string, item: any) => IDropdownOption[] | no | Dropdown options. Only necessary when dropdown type is used. Options can be either a static array or a function that will calculate the values dynamically and can react to the current item. |
| onRenderOption | IRenderFunction<ISelectableOption> | no | Dropdown custom options render method. Only for the **dropdown** field type. |
| placeholder | string | no | Placehoder text which will be used for the input field. If not provided the input title will be used. |
| defaultValue | any | no | Specify a default value for the input field. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# PropertyFieldRoleDefinitionPicker control

Role Definition picker control allows to select role definitions of a specific web via the property pane.


## Overview
The control allows a you to pick role definitions from a dropdown control. It supports role definition selection using the dropdown control of Office fabric UI with multi-select enabled.
![Role Definition Picker overview](../assets/roleDef1.png)


**PropertyFieldRoleDefinitionPicker example usage**

![PropertyFieldFilePicker example](../assets/roleDefPicker1.gif)

## How to use this control in your solutions

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

```TypeScript
import { IBasePermissions, IPropertyFieldRoleDefinitionPickerProps , PropertyFieldRoleDefinitionPicker, RoleTypeKind , IRoleDefinitionInformation } from "@pnp/spfx-property-controls/lib/PropertyFieldRoleDefinitionPicker";
```

Create a new property for your web part, for example:

```TypeScript
export interface IPropertyControlsTestWebPartProps {
roleDefinitions: IRoleDefinitionInformation[];
}
```

- Add the role definition picker property control to the `groupFields` of the web part property pane configuration:

```TypeScript
PropertyFieldRoleDefinitionPicker('roleDefinitions', {
context: this.context,
label: "Role Definitions",
roleDefinitions: this.properties.roleDefinitions,
onPropertyChange: this.onPropertyPaneFieldChanged,
properties: this.properties,
key: "roleDefinitionPickerId",
selectedRoleDefinition:["Full Control"],
roleDefinitionsToExclude: ["System.LimitedView"],
})
```

## Implementation

The `PropertyFieldRoleDefinitionPicker` control can be configured with the following properties:

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| properties | any | yes | Parent web part properties, this object is used to update the property value. |
| key | string | yes | A unique key that indicates the identity of this control. |
| context | WebPartContext | yes | Current webpart context. |
| onPropertyChange | function | yes | Defines a onPropertyChange function to raise when the data gets changed. |
| label | string | no | Specifies the text describing the role definition picker. |
| webAbsoluteUrl | string | no | Absolute Web Url of target site (user requires permissions) |
| required | boolean | no | Sets the label to inform that the value is required. |
| disabled | boolean | no | Specifies if the picker button is disabled |
| roleDefinitions | IRoleDefinitionInformation[] | yes | The value of selected role defintions
| multiSelect | boolean | no | Specify if you want to have a single or multi-select role definition picker. By default this is set to `true` (multi-select role picker). |
| selectedRoleDefinition | string[] | no | Pre-selected role definitions for the picker control
| roleDefinitionsToExclude | string[] | no | Role definitions to be excluded from the picker control
| onRoleDefinitionsRetrieved | `(roleDefinitions: IRoleDefinitionInformation[]) => PromiseLike<IRoleDefinitionInformation[]> | IRoleDefinitionInformation[]` | no | Callback that is called before the dropdown is populated. |
| onGetErrorMessage | function | no | The method is used to get the validation error message and determine whether the input value is valid or not. See [this documentation](https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/validate-web-part-property-values) to learn how to use it. |


interface `IRoleDefinitionInformation`

The value returned from the selected role definition.

| Value | Type | Description |
| ---- | ---- | ---- |
| Id | number | Id of the role definition. |
| Name | string | Name of the selected role definition. |
| Description | string | Description of selected role definition. |
| Hidden | boolean | Whether selected role definition is hidden or not. |
| Order | number | Order of selected role definition. |
| RoleTypeKind | RoleTypeKind | RoleTypeKind of selected role definition. |
| BasePermissions | IBasePermissions | BasePermissions of selected role definition. |

interface `IBasePermissions`

| Value | Type |
| ---- | ---- |
| Low | number |
| High | number |

type `RoleTypeKind`

| Value | Type |
| ---- | ---- |
| RoleTypeKind | `0 | 1 | 2 | 3 | 4 | 5 | 6 | 7` |

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