diff --git a/CHANGELOG.json b/CHANGELOG.json index 07934329..dae079b2 100644 --- a/CHANGELOG.json +++ b/CHANGELOG.json @@ -1,5 +1,25 @@ { "versions": [ + { + "version": "2.7.0", + "changes": { + "new": [], + "enhancements": [ + "`PropertyFieldColorPicker`: Add debounce property to color picker control [#352](https://github.com/pnp/sp-dev-fx-property-controls/issues/352)" + ], + "fixes": [ + "`PropertyFieldFilePicker`: Stock images url is getting a 404 server error [#364](https://github.com/pnp/sp-dev-fx-property-controls/issues/364)", + "`PropertyFieldColumnPicker`: Filter not working properly [#356](https://github.com/pnp/sp-dev-fx-property-controls/issues/356)", + "`PropertyFieldFilePicker`: React crash on large folders [#371](https://github.com/pnp/sp-dev-fx-property-controls/pull/371)", + "`PropertyFieldCollectionData`: PropertyFieldCollectionData is not setting sortIdx on resulting collection when using Add and Save [#369](https://github.com/pnp/sp-dev-fx-property-controls/issues/369)" + ] + }, + "contributions": [ + "[Chrisrb05](https://github.com/Chrisrb05)", + "[Konrad K.](https://github.com/wilecoyotegenius)", + "[Mark Bice](https://github.com/mbice)" + ] + }, { "version": "2.6.0", "changes": { diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d35a77..e3382427 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Releases +## 2.7.0 + +### Enhancements + +- `PropertyFieldColorPicker`: Add debounce property to color picker control [#352](https://github.com/pnp/sp-dev-fx-property-controls/issues/352) + +### Fixes + +- `PropertyFieldFilePicker`: Stock images url is getting a 404 server error [#364](https://github.com/pnp/sp-dev-fx-property-controls/issues/364) +- `PropertyFieldColumnPicker`: Filter not working properly [#356](https://github.com/pnp/sp-dev-fx-property-controls/issues/356) +- `PropertyFieldFilePicker`: React crash on large folders [#371](https://github.com/pnp/sp-dev-fx-property-controls/pull/371) +- `PropertyFieldCollectionData`: PropertyFieldCollectionData is not setting sortIdx on resulting collection when using Add and Save [#369](https://github.com/pnp/sp-dev-fx-property-controls/issues/369) + +### Contributors + +Special thanks to our contributors (in alphabetical order): [Chrisrb05](https://github.com/Chrisrb05), [Konrad K.](https://github.com/wilecoyotegenius), [Mark Bice](https://github.com/mbice). + ## 2.6.0 ### Fixes diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index 60d35a77..e3382427 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -1,5 +1,22 @@ # Releases +## 2.7.0 + +### Enhancements + +- `PropertyFieldColorPicker`: Add debounce property to color picker control [#352](https://github.com/pnp/sp-dev-fx-property-controls/issues/352) + +### Fixes + +- `PropertyFieldFilePicker`: Stock images url is getting a 404 server error [#364](https://github.com/pnp/sp-dev-fx-property-controls/issues/364) +- `PropertyFieldColumnPicker`: Filter not working properly [#356](https://github.com/pnp/sp-dev-fx-property-controls/issues/356) +- `PropertyFieldFilePicker`: React crash on large folders [#371](https://github.com/pnp/sp-dev-fx-property-controls/pull/371) +- `PropertyFieldCollectionData`: PropertyFieldCollectionData is not setting sortIdx on resulting collection when using Add and Save [#369](https://github.com/pnp/sp-dev-fx-property-controls/issues/369) + +### Contributors + +Special thanks to our contributors (in alphabetical order): [Chrisrb05](https://github.com/Chrisrb05), [Konrad K.](https://github.com/wilecoyotegenius), [Mark Bice](https://github.com/mbice). + ## 2.6.0 ### Fixes diff --git a/docs/documentation/docs/controls/PropertyFieldColorPicker.md b/docs/documentation/docs/controls/PropertyFieldColorPicker.md index 42bdbcdd..ee391d64 100644 --- a/docs/documentation/docs/controls/PropertyFieldColorPicker.md +++ b/docs/documentation/docs/controls/PropertyFieldColorPicker.md @@ -36,6 +36,7 @@ PropertyFieldColorPicker('color', { onPropertyChange: this.onPropertyPaneFieldChanged, properties: this.properties, disabled: false, + debounce: 1000, isHidden: false, alphaSliderHidden: false, style: PropertyFieldColorPickerStyle.Full, @@ -52,6 +53,7 @@ The `PropertyFieldColorPicker` control can be configured with the following prop | ---- | ---- | ---- | ---- | | label | string | yes | Property field label displayed on top. | | disabled | boolean | no | Specify if the control needs to be disabled. | +| debounce | number | no | Specify delay after which control value will be set. | | isHidden | boolean | no | Specify if the control needs to be hidden. | | selectedColor | string or IColor | no | The CSS-compatible string or an IColor object to describe the initial color | | alphaSliderHidden | boolean | no | When true, the alpha slider control is hidden | diff --git a/package-lock.json b/package-lock.json index 12af8512..776411a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@pnp/spfx-property-controls", - "version": "2.6.0", + "version": "2.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 60421539..48a94249 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@pnp/spfx-property-controls", "description": "Reusable property pane controls for SharePoint Framework solutions", - "version": "2.6.0", + "version": "2.7.0", "engines": { "node": ">=0.10.0" }, diff --git a/src/common/telemetry/version.ts b/src/common/telemetry/version.ts index 14963bd7..fec80f99 100644 --- a/src/common/telemetry/version.ts +++ b/src/common/telemetry/version.ts @@ -1 +1 @@ -export const version: string = "2.6.0"; \ No newline at end of file +export const version: string = "2.7.0"; \ No newline at end of file diff --git a/src/propertyFields/collectionData/collectionDataViewer/CollectionDataViewer.tsx b/src/propertyFields/collectionData/collectionDataViewer/CollectionDataViewer.tsx index 867e2af0..846c30e6 100644 --- a/src/propertyFields/collectionData/collectionDataViewer/CollectionDataViewer.tsx +++ b/src/propertyFields/collectionData/collectionDataViewer/CollectionDataViewer.tsx @@ -127,7 +127,9 @@ export class CollectionDataViewer extends React.Component { // Check if the item is not empty if (this.state.inCreationItem) { - this.props.fOnSave([...this.state.crntItems, this.state.inCreationItem]); + let crntItems = [...this.state.crntItems, this.state.inCreationItem]; + crntItems = this.updateSortProperty(crntItems); + this.props.fOnSave(crntItems); } else { this.onSave(); } diff --git a/src/propertyFields/colorPicker/IPropertyFieldColorPicker.ts b/src/propertyFields/colorPicker/IPropertyFieldColorPicker.ts index 79e885c6..0998b039 100644 --- a/src/propertyFields/colorPicker/IPropertyFieldColorPicker.ts +++ b/src/propertyFields/colorPicker/IPropertyFieldColorPicker.ts @@ -41,6 +41,11 @@ export interface IPropertyFieldColorPickerProps { */ disabled?: boolean; + /** + * Time after which the control is updated + */ + debounce?: number; + /** * Whether the property pane field is hidden or not. */ diff --git a/src/propertyFields/colorPicker/IPropertyFieldColorPickerHost.ts b/src/propertyFields/colorPicker/IPropertyFieldColorPickerHost.ts index 0778de85..2c5d76a4 100644 --- a/src/propertyFields/colorPicker/IPropertyFieldColorPickerHost.ts +++ b/src/propertyFields/colorPicker/IPropertyFieldColorPickerHost.ts @@ -7,6 +7,7 @@ export interface IPropertyFieldColorPickerHostProps { label: string; alphaSliderHidden: boolean; disabled: boolean; + debounce: number; isHidden: boolean; selectedColor: string; style: PropertyFieldColorPickerStyle; diff --git a/src/propertyFields/colorPicker/PropertyFieldColorPicker.ts b/src/propertyFields/colorPicker/PropertyFieldColorPicker.ts index ac43b0ba..7241e3f4 100644 --- a/src/propertyFields/colorPicker/PropertyFieldColorPicker.ts +++ b/src/propertyFields/colorPicker/PropertyFieldColorPicker.ts @@ -3,6 +3,7 @@ import { getColorFromString, IColor } from 'office-ui-fabric-react/lib/utilities import * as React from 'react'; import * as ReactDom from 'react-dom'; import { setPropertyValue } from '../../helpers/GeneralHelper'; +import { debounce } from '../../common/util/Util'; import { IPropertyFieldColorPickerProps, @@ -22,6 +23,7 @@ class PropertyFieldColorPickerBuilder implements IPropertyPaneField void; + private _debounce: (fnc: any, timeout:number) => void = debounce(); public constructor(_targetProperty: string, _properties: IPropertyFieldColorPickerProps) { this.targetProperty = _targetProperty; @@ -31,6 +33,7 @@ class PropertyFieldColorPickerBuilder implements IPropertyPaneField { + this.onColorChangedInternal(oldValue, newValue); + }, this.properties.debounce) : + this.onColorChangedInternal(oldValue, newValue); + } + } + private onColorChangedInternal(oldValue: string | IColor , newValue: string | IColor ) { + this.properties.onPropertyChange(this.targetProperty, oldValue, newValue); + setPropertyValue(this.properties.properties, this.targetProperty, newValue); + if (typeof this.changeCB !== 'undefined' && this.changeCB !== null) { + this.changeCB(this.targetProperty, newValue); } } - } export function PropertyFieldColorPicker(targetProperty: string, properties: IPropertyFieldColorPickerProps): IPropertyPaneField { diff --git a/src/propertyFields/columnPicker/PropertyFieldColumnPickerHost.tsx b/src/propertyFields/columnPicker/PropertyFieldColumnPickerHost.tsx index 9520db89..573c9096 100644 --- a/src/propertyFields/columnPicker/PropertyFieldColumnPickerHost.tsx +++ b/src/propertyFields/columnPicker/PropertyFieldColumnPickerHost.tsx @@ -66,7 +66,8 @@ export default class PropertyFieldColumnPickerHost extends React.Component { // Start mapping the Columns that are selected - response.value.forEach((column: ISPColumn) => { + const value = response.value || []; + value.forEach((column: ISPColumn) => { let colPropsToCheck = columnReturnProperty ? column[columnReturnProperty] : column.Id; if (selectedColumn === colPropsToCheck) { this.selectedKey = columnReturnProperty ? column[columnReturnProperty] : column.Id; diff --git a/src/propertyFields/filePicker/filePickerControls/StockImagesTab/StockImages.tsx b/src/propertyFields/filePicker/filePickerControls/StockImagesTab/StockImages.tsx index 674a77e2..1da643d5 100644 --- a/src/propertyFields/filePicker/filePickerControls/StockImagesTab/StockImages.tsx +++ b/src/propertyFields/filePicker/filePickerControls/StockImagesTab/StockImages.tsx @@ -17,7 +17,7 @@ export class StockImages extends React.Component { const { language } = this.props; const themesColor = `&themecolors=${encodeURIComponent(this.getCurrentThemeConfiguration())}`; - const contentPickerUrl = `https://hubblecontent.osi.office.net/contentsvc/external/m365contentpicker/index.html?p=3&app=1001&aud=prod&channel=devmain&setlang=${language}&msel=0&env=prod&premium=1${themesColor}`; + const contentPickerUrl = `https://hubblecontent.osi.office.net/contentsvc/m365contentpicker/index.html?p=3&app=1001&aud=prod&channel=devmain&setlang=${language}&msel=0&env=prod&premium=1${themesColor}`; return (
diff --git a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx index 22d28572..d0acd35a 100644 --- a/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx +++ b/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx @@ -179,7 +179,7 @@ export class FileBrowser extends React.Component { this._loadNextDataRequest(); return null; }} />) : (