Skip to content

Commit

Permalink
Merge pull request #615 from pnp/dev
Browse files Browse the repository at this point in the history
3.17.0 release
  • Loading branch information
AJIXuMuK authored May 15, 2024
2 parents 538af10 + da0b3f9 commit 5734b70
Show file tree
Hide file tree
Showing 91 changed files with 5,115 additions and 3,707 deletions.
8 changes: 8 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"development"
],
"hints": {
"no-inline-styles": "off"
}
}
31 changes: 31 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
{
"versions": [
{
"version": "3.17.0",
"changes": {
"new": [
"`PropertyFieldButton`: New Control PropertyFieldButton [#613](https://github.com/pnp/sp-dev-fx-property-controls/pull/613)",
"`PropertyFieldGrid`: New Control PropertyFieldGrid [#614](https://github.com/pnp/sp-dev-fx-property-controls/pull/614)"
],
"enhancements": [
"`fast-serve`: ast-serve update to match the most recent changes. [#606](https://github.com/pnp/sp-dev-fx-property-controls/pull/606)",
"`PropertyFieldContentTypePicker`: PropertyFieldContentTypePicker control [#611](https://github.com/pnp/sp-dev-fx-property-controls/pull/611)",
"`PropertyFieldFilePicker` : add a delete button to the selected file [#579](https://github.com/pnp/sp-dev-fx-property-controls/pull/#607)",
"`PropertyFieldFilePicker`: Fix root site org asset library showing no items in file picker (https://github.com/pnp/sp-dev-fx-property-controls/pull/603)",
"`PropertyFieldFolderPicker`: added siteAbsoluteUrl to FOlderPicker (https://github.com/pnp/sp-dev-fx-property-controls/pull/602)"

],
"fixes": [
"`General Helper`: toRelativeUrl returns proper relative url in case of root site (https://github.com/pnp/sp-dev-fx-property-controls/pull/609)"
]
},
"contributions": [
"[Daniel Lindén](https://github.com/daniellinden22)",
"[Jake](https://github.com/jjkim11)",
"[João Mendes](https://github.com/joaojmendes)",
"[Nishkalank Bezawada](https://github.com/NishkalankBezawada)",
"[ramonitor](https://github.com/ramonitor)",
"[Russell gove](https://github.com/russgove)",
"[Sergei Sergeev](https://github.com/s-KaiNet)"
]
},
{
"version": "3.16.0",
"changes": {
Expand Down Expand Up @@ -53,12 +82,14 @@
"enhancements": [
"`PropertyFieldListPicker`: Implemented functionality to select multiple base templates [#568](https://github.com/pnp/sp-dev-fx-property-controls/pull/568)",
"`fast-serve`: Fast-serve updated to the latest version and serve warnings fixed. [#579](https://github.com/pnp/sp-dev-fx-property-controls/pull/579)"

],
"fixes": []
},
"contributions": [
"[Chandani Prajapati](https://github.com/chandaniprajapati)",
"[Sergei Sergeev](https://github.com/s-KaiNet)"

]
},
{
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
# Releases

## 3.17.0

### New control(s)

- `PropertyFieldButton`: New Control PropertyFieldButton [#613](https://github.com/pnp/sp-dev-fx-property-controls/pull/613)

### Enhancements

- `fast-serve`: ast-serve update to match the most recent changes. [#606](https://github.com/pnp/sp-dev-fx-property-controls/pull/606)
- `PropertyFieldContentTypePicker`: PropertyFieldContentTypePicker control [#611](https://github.com/pnp/sp-dev-fx-property-controls/pull/611)
- `PropertyFieldFilePicker` : add a delete button to the selected file [#579](https://github.com/pnp/sp-dev-fx-property-controls/pull/#607)
- `PropertyFieldFilePicker`: Fix root site org asset library showing no items in file picker (https://github.com/pnp/sp-dev-fx-property-controls/pull/603)
- `PropertyFieldFolderPicker`: added siteAbsoluteUrl to FOlderPicker (https://github.com/pnp/sp-dev-fx-property-controls/pull/602)

### Fixes

- `General Helper`: toRelativeUrl returns proper relative url in case of root site (https://github.com/pnp/sp-dev-fx-property-controls/pull/609)

### Contributors

Special thanks to our contributors (in alphabetical order): [Daniel Lindén](https://github.com/daniellinden22), [Jake](https://github.com/jjkim11), [João Mendes](https://github.com/joaojmendes), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [ramonitor](https://github.com/ramonitor), [Russell gove](https://github.com/russgove), [Sergei Sergeev](https://github.com/s-KaiNet).

## 3.16.0

### Enhancements

- `PropertyFieldSitePicker`: disabled property not implemented in UI [#577](https://github.com/pnp/sp-dev-fx-property-controls/issues/577)

### Fixes

- `PropertyFieldMonacoEditor` and `PropertyFieldCodeEditor`: fix text selection in code editor [#590](https://github.com/pnp/sp-dev-fx-property-controls/issues/590)

### Contributors

Special thanks to our contributor: [Luna Heyman](https://github.com/toodeluna).
Special thanks to our contributors (in alphabetical order): [Luna Heyman](https://github.com/toodeluna), [srpmtt](https://github.com/srpmtt).

## 3.15.1

Expand Down
28 changes: 27 additions & 1 deletion docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
# Releases

## 3.17.0

### New control(s)

- `PropertyFieldButton`: New Control PropertyFieldButton [#613](https://github.com/pnp/sp-dev-fx-property-controls/pull/613)

### Enhancements

- `fast-serve`: ast-serve update to match the most recent changes. [#606](https://github.com/pnp/sp-dev-fx-property-controls/pull/606)
- `PropertyFieldContentTypePicker`: PropertyFieldContentTypePicker control [#611](https://github.com/pnp/sp-dev-fx-property-controls/pull/611)
- `PropertyFieldFilePicker` : add a delete button to the selected file [#579](https://github.com/pnp/sp-dev-fx-property-controls/pull/#607)
- `PropertyFieldFilePicker`: Fix root site org asset library showing no items in file picker (https://github.com/pnp/sp-dev-fx-property-controls/pull/603)
- `PropertyFieldFolderPicker`: added siteAbsoluteUrl to FOlderPicker (https://github.com/pnp/sp-dev-fx-property-controls/pull/602)

### Fixes

- `General Helper`: toRelativeUrl returns proper relative url in case of root site (https://github.com/pnp/sp-dev-fx-property-controls/pull/609)

### Contributors

Special thanks to our contributors (in alphabetical order): [Daniel Lindén](https://github.com/daniellinden22), [Jake](https://github.com/jjkim11), [João Mendes](https://github.com/joaojmendes), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [ramonitor](https://github.com/ramonitor), [Russell gove](https://github.com/russgove), [Sergei Sergeev](https://github.com/s-KaiNet).

## 3.16.0

### Enhancements

- `PropertyFieldSitePicker`: disabled property not implemented in UI [#577](https://github.com/pnp/sp-dev-fx-property-controls/issues/577)

### Fixes

- `PropertyFieldMonacoEditor` and `PropertyFieldCodeEditor`: fix text selection in code editor [#590](https://github.com/pnp/sp-dev-fx-property-controls/issues/590)

### Contributors

Special thanks to our contributor: [Luna Heyman](https://github.com/toodeluna).
Special thanks to our contributors (in alphabetical order): [Luna Heyman](https://github.com/toodeluna), [srpmtt](https://github.com/srpmtt).

## 3.15.1

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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The `PropertyFieldFolderPicker` control can be configured with the following pro
| 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. |

| siteAbsoluteUrl | string | no | The absolute url of the site you want to pick a folder from (if different than the site the webpart is installed on) |

interface `IFolder`

Expand Down
51 changes: 51 additions & 0 deletions docs/documentation/docs/controls/PropertyFieldButton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# PropertyFieldButton control

This control generates a Button Control .

**PropertyFieldButton example usage**

![PropertyFieldButton example](../assets/propertyFieldButton.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 component:

```TypeScript
import { PropertyFieldButton} from '@pnp/spfx-property-controls/lib/PropertyFieldButton';
```

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

```TypeScript
PropertyFieldButton("", {
text={"Button"}
key={"buttonID"}
disabled={false}
className={className}
styles={styles}
onClick={()=>{alert("Button Clicked")}}
iconProps={iconProps}
isPrimary={true}
isVIsible={true}

})
```

## Implementation

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

| Property | Type | Required | Description |
| --------- | -------------- | -------- | ---------------------------------------------------------- |
| key | string | yes | An unique key that indicates the identity of this control. |
| styles | IButtonStyles | no | styles object |
| classname | string | no | css ClassName |
| isVisible | boolean | yes | Indicate if button is visible |
| text | string | no | text of button |
| isPrimary | boolean | yes | indicate Button is a primary button |
| iconProps | IIconProps | no | text of button |
| disable | boolean | no | Disable control |
| onClick | (e:any) =>void | yes | Onclick function |

![](https://telemetry.sharepointpnp.com/sp-dev-fx-property-controls/wiki/PropertyFieldButton)
146 changes: 146 additions & 0 deletions docs/documentation/docs/controls/PropertyFieldContentTypePicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# PropertyFieldContentTypePicker control

This control generates a ContentType picker field that can be used in the property pane of your SharePoint Framework web parts.

The control automatically retrieves the ContentType for a given SharePoint Site or selected SharePoint list:

![ContentType picker](../assets/contentTypePicker.png)

## How to use this control in your solutions

1. 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.
2. Import the following modules to your component:

```TypeScript
import { PropertyFieldContentTypePicker, PropertyFieldContentTypePickerOrderBy } from '@pnp/spfx-property-controls/lib/PropertyFieldContentTypePicker';
```

3. You'll probably want to use this control in combination with the [PropertyFieldListPicker](./PropertyFieldListPicker.md). Make sure to select the `multiSelect` prop to `false`, as this control is designed to work with a single list. Store the list id in your web part properties, as follows:
```TypeScript
export interface IPropertyControlsTestWebPartProps {
list: string; // Stores the list ID
}
```

3. Create a new property for your web part, as indicated between the `BEGIN:` and `END:` comments below:


```TypeScript
export interface IPropertyControlsTestWebPartProps {
list: string; // Stores the list ID

// BEGIN: Added
view: string; // Stores the view ID
contentType : string // stores the contenttype ID
// END: Added
}
```

4. Add the custom property control to the `groupFields` of the web part property pane configuration:

```TypeScript
PropertyFieldContentTypePicker('contentType', {
label: 'Select a Content Type',
context: this.context,
selectedContentType: this.properties.contentType,
disabled: false,
orderBy: PropertyFieldContentTypeOrderBy.Name,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
properties: this.properties,
onGetErrorMessage: null,
deferredValidationTime: 0,
key: 'contentTypePickerFieldId'
})

```

5. To fetch the contentTypes of a particular site, change the property pane configuration as follows:

```TypeScript
PropertyFieldContentTypePicker('contentType', {
label: 'Select a Content Type',
context: this.context,
selectedContentType: this.properties.contentType,
disabled: false,
webAbsoluteUrl:"https://****.sharepoint.com/sites/*****",
orderBy: PropertyFieldContentTypeOrderBy.Name,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
properties: this.properties,
onGetErrorMessage: null,
deferredValidationTime: 0,
key: 'contentTypePickerFieldId'
})
```
![ContentType picker for site ](../assets/contentTypes-for-Site.gif)

6. To fetch the contentTypes of selected list, change the property pane configuration as follows:

```TypeScript
PropertyFieldContentTypePicker('contentType', {
label: 'Select a Content Type',
context: this.context,
selectedContentType: this.properties.contentType,
listId: {list-guid} //"0da3b4b7-8ebd-4f15-87ee-afae5cacadad"
disabled: false,
orderBy: PropertyFieldContentTypeOrderBy.Name,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
properties: this.properties,
onGetErrorMessage: null,
deferredValidationTime: 0,
key: 'contentTypePickerFieldId'
})

```

![ContentType picker for selected list ](../assets/contentTypePicker1.png)

7. If ListID specified in the propertiesc is not available in the selected site, the control will error out as follows
```TypeScript
PropertyFieldContentTypePicker('contentType', {
label: 'Select a Content Type',
context: this.context,
selectedContentType: this.properties.contentType,
listId: {list-guid} //"0da3b4b7-8ebd-4f15-87ee-afae5cacadad"
disabled: false,
orderBy: PropertyFieldContentTypeOrderBy.Name,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
properties: this.properties,
onGetErrorMessage: null,
deferredValidationTime: 0,
key: 'contentTypePickerFieldId'
})

```
![ContentType picker Error ](../assets/contentTypePicker-Error.png)

## Implementation

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

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| label | string | yes | Property field label displayed on top. |
| listId | string | no | The ID of the list or library you wish to select a contentType from. |
| disabled | boolean | no | Specify if the control needs to be disabled. |
| context | BaseComponentContext | yes | Context of the current web part. |
| selectedContentType | string | string[] | no | IDefines ContentType titles which should be excluded from the ContentType picker control. |
| orderBy | PropertyFieldContentTypeOrderBy | no | Specify the property on which you want to order the retrieve set of ContentTypes. |
| webAbsoluteUrl | string | no | Absolute Web Url of target site (user requires permissions) |
| onPropertyChange | function | yes | Defines a onPropertyChange function to raise when the date gets changed. |
| properties | any | yes | Parent web part properties, this object is use to update the property value. |
| key | string | yes | An unique key that indicates the identity of this control. |
| 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. |
| deferredValidationTime | number | no | Control will start to validate after users stop typing for `deferredValidationTime` milliseconds. Default value is 200. |
| contentTypesToExclude | string[] | no | Defines contentTypes by which should be excluded from the contentType picker control. You can specify contentType titles or IDs |
| filter | string | no | Filter contentTypes from OData query. |
| onContentTypesRetrieved | (contentType: ISPContentType[]) => PromiseLike<ISPContentType[]> \| ISPContentType[] | no | Callback that is called before the dropdown is populated. |


Enum `PropertyFieldContentTypePickerOrderBy`

| Name | Description |
| ---- | ---- |
| Id | Sort by contentType ID |
| Title | Sort by contentType title |

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

0 comments on commit 5734b70

Please sign in to comment.