From d995939a267644cb0b9577d64a3d2ab659ce0c22 Mon Sep 17 00:00:00 2001 From: Joel Rodrigues <19577724+joelfmrodrigues@users.noreply.github.com> Date: Wed, 22 Aug 2018 12:45:51 +0100 Subject: [PATCH 01/23] add new property to people picker for source url --- src/controls/peoplepicker/IPeoplePicker.ts | 4 ++++ src/controls/peoplepicker/PeoplePickerComponent.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/src/controls/peoplepicker/IPeoplePicker.ts b/src/controls/peoplepicker/IPeoplePicker.ts index bc4a485bc..03aec4cfa 100644 --- a/src/controls/peoplepicker/IPeoplePicker.ts +++ b/src/controls/peoplepicker/IPeoplePicker.ts @@ -14,6 +14,10 @@ export interface IPeoplePickerProps { * Text of the Control */ titleText: string; + /** + * Web Absolute Url of source site + */ + webAbsoluteUrl?: string; /** * Whether the control is enabled or not */ diff --git a/src/controls/peoplepicker/PeoplePickerComponent.tsx b/src/controls/peoplepicker/PeoplePickerComponent.tsx index 1b2eac900..a206dff8f 100644 --- a/src/controls/peoplepicker/PeoplePickerComponent.tsx +++ b/src/controls/peoplepicker/PeoplePickerComponent.tsx @@ -143,6 +143,7 @@ export class PeoplePicker extends React.Component Date: Wed, 22 Aug 2018 13:34:20 +0100 Subject: [PATCH 02/23] add web absolute url variable to the request --- src/controls/peoplepicker/PeoplePickerComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/peoplepicker/PeoplePickerComponent.tsx b/src/controls/peoplepicker/PeoplePickerComponent.tsx index a206dff8f..634eabd54 100644 --- a/src/controls/peoplepicker/PeoplePickerComponent.tsx +++ b/src/controls/peoplepicker/PeoplePickerComponent.tsx @@ -55,7 +55,7 @@ export class PeoplePicker extends React.Component Date: Wed, 22 Aug 2018 13:41:00 +0100 Subject: [PATCH 03/23] revert change included by mistake on previous commit --- src/controls/peoplepicker/PeoplePickerComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/peoplepicker/PeoplePickerComponent.tsx b/src/controls/peoplepicker/PeoplePickerComponent.tsx index 634eabd54..02da87c87 100644 --- a/src/controls/peoplepicker/PeoplePickerComponent.tsx +++ b/src/controls/peoplepicker/PeoplePickerComponent.tsx @@ -55,7 +55,7 @@ export class PeoplePicker extends React.Component Date: Fri, 24 Aug 2018 16:32:44 -0400 Subject: [PATCH 04/23] Add different font-sizes for WebPartTitle at different screen sizes --- src/controls/webPartTitle/WebPartTitle.module.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/controls/webPartTitle/WebPartTitle.module.scss b/src/controls/webPartTitle/WebPartTitle.module.scss index bf592fbf7..15333d78e 100644 --- a/src/controls/webPartTitle/WebPartTitle.module.scss +++ b/src/controls/webPartTitle/WebPartTitle.module.scss @@ -1,9 +1,17 @@ .webPartTitle { - font-size: 24px; + font-size: 14px; font-weight: 100; margin-bottom: 11px; color: "[theme:neutralPrimary, default: #333333]"; + @media (max-width: 320px) { + font-size: 21px; + } + + @media (max-width: 480px) { + font-size: 24px; + } + // Edit mode textarea { background-color: transparent; From 43f3eb3ddf2e06f7fa648bf699ae6adb5599bb93 Mon Sep 17 00:00:00 2001 From: Thomas Lamb Date: Fri, 24 Aug 2018 16:53:47 -0400 Subject: [PATCH 05/23] Fix media query for WebPartTitle font-size --- src/controls/webPartTitle/WebPartTitle.module.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/webPartTitle/WebPartTitle.module.scss b/src/controls/webPartTitle/WebPartTitle.module.scss index 15333d78e..69546375b 100644 --- a/src/controls/webPartTitle/WebPartTitle.module.scss +++ b/src/controls/webPartTitle/WebPartTitle.module.scss @@ -4,11 +4,11 @@ margin-bottom: 11px; color: "[theme:neutralPrimary, default: #333333]"; - @media (max-width: 320px) { + @media (min-width: 320px) { font-size: 21px; } - @media (max-width: 480px) { + @media (min-width: 480px) { font-size: 24px; } From ffc8f3c2274154f57a63ba8d12f8981ad970aefb Mon Sep 17 00:00:00 2001 From: Mikael Svenson Date: Wed, 5 Sep 2018 13:27:46 +0200 Subject: [PATCH 06/23] Added accessibility tags --- src/controls/webPartTitle/WebPartTitle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls/webPartTitle/WebPartTitle.tsx b/src/controls/webPartTitle/WebPartTitle.tsx index c87f24466..172899c66 100644 --- a/src/controls/webPartTitle/WebPartTitle.tsx +++ b/src/controls/webPartTitle/WebPartTitle.tsx @@ -49,7 +49,7 @@ export class WebPartTitle extends React.Component { } { - this.props.displayMode !== DisplayMode.Edit && this.props.title && {this.props.title} + this.props.displayMode !== DisplayMode.Edit && this.props.title && {this.props.title} } ); From de5c10a1953915634ba18b82db163aab5d3d750c Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 5 Sep 2018 15:39:57 +0200 Subject: [PATCH 07/23] Documentation logo changes --- .../docs/assets/pnp-spfx-controls.svg | 1 + docs/documentation/docs/controls/ListView.md | 2 +- docs/documentation/docs/css/extra.css | 32 +++++++++++++++++++ docs/documentation/mkdocs.yml | 8 +++-- 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 docs/documentation/docs/assets/pnp-spfx-controls.svg create mode 100644 docs/documentation/docs/css/extra.css diff --git a/docs/documentation/docs/assets/pnp-spfx-controls.svg b/docs/documentation/docs/assets/pnp-spfx-controls.svg new file mode 100644 index 000000000..21007108c --- /dev/null +++ b/docs/documentation/docs/assets/pnp-spfx-controls.svg @@ -0,0 +1 @@ +pnp-spfx-controls diff --git a/docs/documentation/docs/controls/ListView.md b/docs/documentation/docs/controls/ListView.md index e1a47b614..09d404ae4 100644 --- a/docs/documentation/docs/controls/ListView.md +++ b/docs/documentation/docs/controls/ListView.md @@ -55,7 +55,7 @@ const groupByFields: IGrouping[] = [ ``` !!! note "Extend ListView with a ContextualMenu" - To extend the `ListView` control with a [ContextualMenu](https://developer.microsoft.com/en-us/fabric#/components/contextualmenu) refer to [ListView.ContextualMenu](./ListView.ContextualMenu). + To extend the `ListView` control with a [ContextualMenu](https://developer.microsoft.com/en-us/fabric#/components/contextualmenu) refer to [ListView.ContextualMenu](./ListView.ContextualMenu.md). ## Implementation diff --git a/docs/documentation/docs/css/extra.css b/docs/documentation/docs/css/extra.css new file mode 100644 index 000000000..18a925402 --- /dev/null +++ b/docs/documentation/docs/css/extra.css @@ -0,0 +1,32 @@ +.md-logo { + height: 32px; + width: 150px; +} + +.md-logo img { + width: 100% !important; + height: auto !important; + margin-top: -0.25em; +} + +.md-header{ + height: 75px; +} + +.md-container{ + padding-top: 70px; +} + +.md-sidebar[data-md-state="lock"]{ + padding-top: 75px; +} + +.md-footer { + margin-top: 5em; +} + +@media only screen and (max-width: 76.1875em) { + .md-nav--primary .md-nav__title--site .md-nav__button { + width: 150px; + } +} diff --git a/docs/documentation/mkdocs.yml b/docs/documentation/mkdocs.yml index c46e35da4..861e8bef5 100644 --- a/docs/documentation/mkdocs.yml +++ b/docs/documentation/mkdocs.yml @@ -1,5 +1,5 @@ -site_name: SharePoint Framework React Controls -pages: +site_name: '@pnp/spfx-controls-react' +nav: - Home: 'index.md' - Controls: - FileTypeIcon: 'controls/FileTypeIcon.md' @@ -34,9 +34,11 @@ theme: name: 'material' palette: primary: 'blue' - logo: 'assets/sharepoint.png' + logo: 'assets/pnp-spfx-controls.svg' feature: tabs: true +extra_css: + - 'css/extra.css' markdown_extensions: - admonition - codehilite: From c75590f01bdaad8ade5b42bd69d34334c9c706f0 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 6 Sep 2018 17:09:55 +0200 Subject: [PATCH 08/23] Documentation + version updates --- CHANGELOG.JSON | 11 +++++++++++ CHANGELOG.md | 6 ++++++ docs/documentation/docs/about/release-notes.md | 6 ++++++ docs/documentation/docs/controls/PeoplePicker.md | 1 + package.json | 2 +- src/common/telemetry/version.ts | 2 +- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index bffc033cd..ecdcab7ca 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -1,5 +1,16 @@ { "versions": [ + { + "version": "1.8.0", + "changes": { + "new": [], + "enhancements": [ + "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)" + ], + "fixes": [] + }, + "contributions": ["Joel Rodrigues"] + }, { "version": "1.7.0", "changes": { diff --git a/CHANGELOG.md b/CHANGELOG.md index 5325e7172..c2165ca05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Releases +## 1.8.0 + +**Enhancements** + +- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) + ## 1.7.0 **Enhancements** diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index 5325e7172..c2165ca05 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -1,5 +1,11 @@ # Releases +## 1.8.0 + +**Enhancements** + +- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) + ## 1.7.0 **Enhancements** diff --git a/docs/documentation/docs/controls/PeoplePicker.md b/docs/documentation/docs/controls/PeoplePicker.md index 769bf86fd..7b7b90945 100644 --- a/docs/documentation/docs/controls/PeoplePicker.md +++ b/docs/documentation/docs/controls/PeoplePicker.md @@ -67,6 +67,7 @@ The People picker control can be configured with the following properties: | peoplePickerWPclassName | string | no | applies custom styling to the people picker element | | peoplePickerCntrlclassName | string | no | applies custom styling to the people picker control only | | defaultSelectedUsers | string[] | no | Default selected user emails | +| webAbsoluteUrl | string | no | Specify the site URL on which you want to perform the user query call. Default is the current site URL. | ![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/PeoplePicker) diff --git a/package.json b/package.json index f6581c481..8d5f37583 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@pnp/spfx-controls-react", "description": "Reusable React controls for SharePoint Framework solutions", - "version": "1.7.0", + "version": "1.8.0", "engines": { "node": ">=0.10.0" }, diff --git a/src/common/telemetry/version.ts b/src/common/telemetry/version.ts index 345e31684..fc942def7 100644 --- a/src/common/telemetry/version.ts +++ b/src/common/telemetry/version.ts @@ -1 +1 @@ -export const version: string = "1.7.0"; \ No newline at end of file +export const version: string = "1.8.0"; \ No newline at end of file From 4d03018c2a4f48933d43e076dcc7a365fb1356da Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 6 Sep 2018 17:27:34 +0200 Subject: [PATCH 09/23] Change log notes for #115 --- CHANGELOG.JSON | 5 +++-- CHANGELOG.md | 1 + docs/documentation/docs/about/release-notes.md | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index ecdcab7ca..640f9e2b4 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -5,11 +5,12 @@ "changes": { "new": [], "enhancements": [ - "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)" + "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", + "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)" ], "fixes": [] }, - "contributions": ["Joel Rodrigues"] + "contributions": ["Thomas Lamb", "Joel Rodrigues"] }, { "version": "1.7.0", diff --git a/CHANGELOG.md b/CHANGELOG.md index c2165ca05..bd63025a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ **Enhancements** - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) +- `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) ## 1.7.0 diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index c2165ca05..bd63025a6 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -5,6 +5,7 @@ **Enhancements** - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) +- `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) ## 1.7.0 From 95c4b576b50402f30848c294121ef7ab6a6173ab Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 6 Sep 2018 17:32:42 +0200 Subject: [PATCH 10/23] Changelog updates --- CHANGELOG.JSON | 5 +++-- CHANGELOG.md | 1 + docs/documentation/docs/about/release-notes.md | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 640f9e2b4..2879dade9 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -6,11 +6,12 @@ "new": [], "enhancements": [ "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", - "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)" + "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", + "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)" ], "fixes": [] }, - "contributions": ["Thomas Lamb", "Joel Rodrigues"] + "contributions": ["Thomas Lamb", "Joel Rodrigues", "Mikael Svenson"] }, { "version": "1.7.0", diff --git a/CHANGELOG.md b/CHANGELOG.md index bd63025a6..f64319e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) +- `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) ## 1.7.0 diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index bd63025a6..f64319e7f 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -6,6 +6,7 @@ - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) +- `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) ## 1.7.0 From cd9b303ac7c43365523c1865b070e824861ece05 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 7 Sep 2018 09:47:08 +0200 Subject: [PATCH 11/23] DetailsList property for ListView --- src/controls/listView/IListView.ts | 5 +++++ src/controls/listView/ListView.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controls/listView/IListView.ts b/src/controls/listView/IListView.ts index 371b15457..a9d7a6f54 100644 --- a/src/controls/listView/IListView.ts +++ b/src/controls/listView/IListView.ts @@ -1,5 +1,6 @@ import { Selection, SelectionMode } from 'office-ui-fabric-react/lib/DetailsList'; import { IColumn, IGroup } from 'office-ui-fabric-react/lib/components/DetailsList'; +import { IDetailsListProps } from "office-ui-fabric-react/lib/DetailsList"; export { SelectionMode }; @@ -44,6 +45,10 @@ export interface IListViewProps { * The index of the items to be select by default */ defaultSelection?: number[]; + /** + * Specify direct properties for the DetailsList component + */ + detailsListProps?: IDetailsListProps; } export interface IListViewState { diff --git a/src/controls/listView/ListView.tsx b/src/controls/listView/ListView.tsx index 4e4b231ae..61fbb2276 100644 --- a/src/controls/listView/ListView.tsx +++ b/src/controls/listView/ListView.tsx @@ -399,7 +399,8 @@ export class ListView extends React.Component { layoutMode={DetailsListLayoutMode.justified} compact={this.props.compact} setKey="ListViewControl" - groupProps={groupProps} /> + groupProps={groupProps} + {...this.props.detailsListProps} /> ); } From 58a25c77c72b57a4ab48cd991a8e7bb0355c71a0 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 7 Sep 2018 10:05:18 +0200 Subject: [PATCH 12/23] Enhancement for #119 --- CHANGELOG.JSON | 3 ++- CHANGELOG.md | 1 + docs/documentation/docs/about/release-notes.md | 1 + docs/documentation/docs/controls/ListView.md | 1 + src/controls/listView/IListView.ts | 9 ++++----- src/controls/listView/ListView.tsx | 4 ++-- .../controlsTest/components/ControlsTest.tsx | 15 ++++++++++----- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 2879dade9..4afea7eb2 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -7,7 +7,8 @@ "enhancements": [ "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", - "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)" + "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", + "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)" ], "fixes": [] }, diff --git a/CHANGELOG.md b/CHANGELOG.md index f64319e7f..e428c5aad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) +- `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) ## 1.7.0 diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index f64319e7f..e428c5aad 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -7,6 +7,7 @@ - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) +- `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) ## 1.7.0 diff --git a/docs/documentation/docs/controls/ListView.md b/docs/documentation/docs/controls/ListView.md index 09d404ae4..6ee114f25 100644 --- a/docs/documentation/docs/controls/ListView.md +++ b/docs/documentation/docs/controls/ListView.md @@ -82,6 +82,7 @@ The `IViewField` has the following implementation: | sorting | boolean | no | Specify if you want to enable sorting for the current field. | | maxWidth | number | no | Specify the minimum width of the column. | | maxWidth | number | no | Specify the maximum width of the column. | +| isResizable | boolean | no | Determines if the column can be resized. | | render | function | no | Override how the field has to get rendered. | The `IGrouping` has the following implementation: diff --git a/src/controls/listView/IListView.ts b/src/controls/listView/IListView.ts index a9d7a6f54..48f41af08 100644 --- a/src/controls/listView/IListView.ts +++ b/src/controls/listView/IListView.ts @@ -1,6 +1,5 @@ import { Selection, SelectionMode } from 'office-ui-fabric-react/lib/DetailsList'; import { IColumn, IGroup } from 'office-ui-fabric-react/lib/components/DetailsList'; -import { IDetailsListProps } from "office-ui-fabric-react/lib/DetailsList"; export { SelectionMode }; @@ -45,10 +44,6 @@ export interface IListViewProps { * The index of the items to be select by default */ defaultSelection?: number[]; - /** - * Specify direct properties for the DetailsList component - */ - detailsListProps?: IDetailsListProps; } export interface IListViewState { @@ -102,6 +97,10 @@ export interface IViewField { * Specify the maximum width of the column */ maxWidth?: number; + /** + * Determines if the column can be resized. + */ + isResizable?: boolean; /** * Override the render method of the field */ diff --git a/src/controls/listView/ListView.tsx b/src/controls/listView/ListView.tsx index 61fbb2276..085fc5f3d 100644 --- a/src/controls/listView/ListView.tsx +++ b/src/controls/listView/ListView.tsx @@ -277,6 +277,7 @@ export class ListView extends React.Component { fieldName: field.name, minWidth: field.minWidth || 50, maxWidth: field.maxWidth, + isResizable: field.isResizable, onRender: this._fieldRender(field), onColumnClick: this._columnClick }); @@ -399,8 +400,7 @@ export class ListView extends React.Component { layoutMode={DetailsListLayoutMode.justified} compact={this.props.compact} setKey="ListViewControl" - groupProps={groupProps} - {...this.props.detailsListProps} /> + groupProps={groupProps} /> ); } diff --git a/src/webparts/controlsTest/components/ControlsTest.tsx b/src/webparts/controlsTest/components/ControlsTest.tsx index 502704ca8..9291c9e4b 100644 --- a/src/webparts/controlsTest/components/ControlsTest.tsx +++ b/src/webparts/controlsTest/components/ControlsTest.tsx @@ -143,27 +143,32 @@ export default class ControlsTest extends React.Component { return Link; - } + }, + isResizable: true }, { - name: 'Title' + name: 'Title', + isResizable: true } ]; From 3c8016b295b3900c4d33544c8147834ef2a0f5bf Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 7 Sep 2018 10:46:01 +0200 Subject: [PATCH 13/23] Fix for #118 --- CHANGELOG.JSON | 4 +- CHANGELOG.md | 4 ++ .../documentation/docs/about/release-notes.md | 4 ++ src/controls/iFrameDialog/IFrameDialog.tsx | 55 ++++++++++++++++--- .../iFrameDialog/IFrameDialogContent.tsx | 2 +- 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 4afea7eb2..00eb71965 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -10,7 +10,9 @@ "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)" ], - "fixes": [] + "fixes": [ + "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)" + ] }, "contributions": ["Thomas Lamb", "Joel Rodrigues", "Mikael Svenson"] }, diff --git a/CHANGELOG.md b/CHANGELOG.md index e428c5aad..4d07c1918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +**Fixes** + +- `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) + ## 1.7.0 **Enhancements** diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index e428c5aad..4d07c1918 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -9,6 +9,10 @@ - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +**Fixes** + +- `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) + ## 1.7.0 **Enhancements** diff --git a/src/controls/iFrameDialog/IFrameDialog.tsx b/src/controls/iFrameDialog/IFrameDialog.tsx index 37f60d84c..03b927176 100644 --- a/src/controls/iFrameDialog/IFrameDialog.tsx +++ b/src/controls/iFrameDialog/IFrameDialog.tsx @@ -3,6 +3,8 @@ import * as ReactDOM from "react-dom"; import { Dialog, IDialogProps } from 'office-ui-fabric-react/lib/Dialog'; import { IFrameDialogContent } from './IFrameDialogContent'; import * as telemetry from '../../common/telemetry'; +import { Guid } from "@microsoft/sp-core-library"; +import omit = require('lodash/omit'); export interface IFrameDialogProps extends IDialogProps { /** @@ -24,6 +26,7 @@ export interface IFrameDialogProps extends IDialogProps { } export interface IFrameDialogState { + dialogId: string; } /** @@ -35,19 +38,55 @@ export class IFrameDialog extends React.Component - + + ); + } + /** + * Set the dialog style + */ + private setDialogStyling(): void { + if (!this.props.hidden && this.state.dialogId) { + const element = document.querySelector(`.${this.state.dialogId} .ms-Dialog-main`) as HTMLElement; + if (element && this.props.width) { + element.style.width = this.props.width; + element.style.minWidth = this.props.width; + element.style.maxWidth = this.props.width; + } + } } } diff --git a/src/controls/iFrameDialog/IFrameDialogContent.tsx b/src/controls/iFrameDialog/IFrameDialogContent.tsx index 58b4d4c88..098455163 100644 --- a/src/controls/iFrameDialog/IFrameDialogContent.tsx +++ b/src/controls/iFrameDialog/IFrameDialogContent.tsx @@ -36,4 +36,4 @@ export class IFrameDialogContent extends React.Component Date: Fri, 7 Sep 2018 12:07:01 +0200 Subject: [PATCH 14/23] Fix for #117 --- package.json | 3 +- src/controls/peoplepicker/IPeoplePicker.ts | 5 ++- .../peoplepicker/PeoplePickerComponent.tsx | 39 ++++++++++--------- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 8d5f37583..e65692cb5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "@pnp/odata": "^1.0.1", "@pnp/sp": "^1.0.1", "@pnp/telemetry-js": "1.0.0", - "lodash": "^4.17.4" + "lodash": "^4.17.4", + "office-ui-fabric-react": "~5.122.0" }, "devDependencies": { "@microsoft/decorators": "~1.3.0", diff --git a/src/controls/peoplepicker/IPeoplePicker.ts b/src/controls/peoplepicker/IPeoplePicker.ts index 03aec4cfa..32c1e4a9d 100644 --- a/src/controls/peoplepicker/IPeoplePicker.ts +++ b/src/controls/peoplepicker/IPeoplePicker.ts @@ -1,5 +1,6 @@ -import { IPersonaProps, DirectionalHint } from "office-ui-fabric-react"; import { WebPartContext } from '@microsoft/sp-webpart-base'; +import { DirectionalHint } from "office-ui-fabric-react/lib/common/DirectionalHint"; +import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Persona.types"; /** * Used to display a placeholder in case of no or temporary content. Button is optional. @@ -91,7 +92,7 @@ export interface IPeoplePickerUserItem { id: string; imageUrl: string; imageInitials: string; - primaryText: string; // name + text: string; // name secondaryText: string; // role tertiaryText: string; // status optionalText: string; // anything diff --git a/src/controls/peoplepicker/PeoplePickerComponent.tsx b/src/controls/peoplepicker/PeoplePickerComponent.tsx index 02da87c87..ac6af9106 100644 --- a/src/controls/peoplepicker/PeoplePickerComponent.tsx +++ b/src/controls/peoplepicker/PeoplePickerComponent.tsx @@ -1,20 +1,21 @@ import * as strings from 'ControlStrings'; import * as React from 'react'; import { IPeoplePickerProps, IPeoplePickerState, IPeoplePickerUserItem } from './IPeoplePicker'; -import { IPersonaProps } from 'office-ui-fabric-react/lib/Persona'; import { TooltipHost, DirectionalHint } from 'office-ui-fabric-react/lib/Tooltip'; -import { IBasePickerSuggestionsProps } from 'office-ui-fabric-react/lib/Pickers'; import { NormalPeoplePicker } from 'office-ui-fabric-react/lib/components/pickers/PeoplePicker/PeoplePicker'; -import { IPersonaWithMenu } from 'office-ui-fabric-react/lib/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.Props'; -import { ValidationState } from 'office-ui-fabric-react/lib/Pickers'; -import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar'; +import { MessageBar } from 'office-ui-fabric-react/lib/MessageBar'; import { SPHttpClient } from '@microsoft/sp-http'; import styles from './PeoplePickerComponent.module.scss'; import * as telemetry from '../../common/telemetry'; import { assign } from 'office-ui-fabric-react/lib/Utilities'; import { IUsers } from './IUsers'; -import { Label } from 'office-ui-fabric-react/lib/Label'; +import { Label } from 'office-ui-fabric-react/lib/components/Label'; import { Environment, EnvironmentType } from "@microsoft/sp-core-library"; +import { IBasePickerSuggestionsProps } from "office-ui-fabric-react/lib/components/pickers/BasePicker.types"; +import { IPersonaWithMenu } from "office-ui-fabric-react/lib/components/pickers/PeoplePicker/PeoplePickerItems/PeoplePickerItem.types"; +import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Persona.types"; +import { MessageBarType } from "office-ui-fabric-react/lib/components/MessageBar"; +import { ValidationState } from 'office-ui-fabric-react/lib/components/pickers/BasePicker.types'; const suggestionProps: IBasePickerSuggestionsProps = { suggestionsHeaderText: 'Suggested People', @@ -82,7 +83,7 @@ export class PeoplePicker extends React.Component 0; + return text && text.toLowerCase().indexOf(filterText.toLowerCase()) > 0; } /** From 632c446499db81062024a05c2d52fe7fb6c2b581 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 7 Sep 2018 12:28:30 +0200 Subject: [PATCH 15/23] Enhancement for #113 --- CHANGELOG.JSON | 6 ++- CHANGELOG.md | 2 + .../documentation/docs/about/release-notes.md | 2 + .../taxonomyPicker/TaxonomyPicker.module.scss | 13 +++++-- .../taxonomyPicker/TaxonomyPicker.tsx | 38 +++++++++---------- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 00eb71965..931d5fe3d 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -8,10 +8,12 @@ "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", - "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)" + "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)", + "`TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113)" ], "fixes": [ - "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)" + "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)", + "`PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117)" ] }, "contributions": ["Thomas Lamb", "Joel Rodrigues", "Mikael Svenson"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d07c1918..ff7c02336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,12 @@ - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +- `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) **Fixes** - `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) +- `PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117) ## 1.7.0 diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index 4d07c1918..ff7c02336 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -8,10 +8,12 @@ - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +- `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) **Fixes** - `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) +- `PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117) ## 1.7.0 diff --git a/src/controls/taxonomyPicker/TaxonomyPicker.module.scss b/src/controls/taxonomyPicker/TaxonomyPicker.module.scss index 5956cc045..a19ccc839 100644 --- a/src/controls/taxonomyPicker/TaxonomyPicker.module.scss +++ b/src/controls/taxonomyPicker/TaxonomyPicker.module.scss @@ -14,12 +14,19 @@ } } -.termFieldTable { +.termField { + align-items: center; border-spacing: 0; + display: flex; width: 100%; - .termFieldRow { - vertical-align: initial; + .termFieldInput { + width: 90%; + } + + .termFieldButton { + text-align: center; + width: 10%; } input[type="text"] { diff --git a/src/controls/taxonomyPicker/TaxonomyPicker.tsx b/src/controls/taxonomyPicker/TaxonomyPicker.tsx index 6dc6f0879..4c7b0293d 100644 --- a/src/controls/taxonomyPicker/TaxonomyPicker.tsx +++ b/src/controls/taxonomyPicker/TaxonomyPicker.tsx @@ -249,27 +249,23 @@ export class TaxonomyPicker extends React.Component {this.props.label && } - - - - - - - -
- - - -
+
+
+ +
+
+ +
+
From b3c66fa93925a79e5250a87a9465751b4e840b7c Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 7 Sep 2018 15:14:11 +0200 Subject: [PATCH 16/23] Fix for #109 --- CHANGELOG.JSON | 3 +- CHANGELOG.md | 1 + .../documentation/docs/about/release-notes.md | 1 + .../taxonomyPicker/TaxonomyPicker.module.scss | 7 +- .../taxonomyPicker/TaxonomyPicker.tsx | 1 + src/controls/taxonomyPicker/Term.tsx | 19 +- src/services/ISPTermStorePickerService.ts | 1 + src/services/SPTermStorePickerMockService.ts | 182 +++++++++--------- src/services/SPTermStorePickerService.ts | 2 +- .../controlsTest/components/ControlsTest.tsx | 2 +- 10 files changed, 123 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 931d5fe3d..16d6df3db 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -9,7 +9,8 @@ "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)", - "`TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113)" + "`TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113)", + "`TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109)" ], "fixes": [ "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)", diff --git a/CHANGELOG.md b/CHANGELOG.md index ff7c02336..c473e2e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) - `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) +- `TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109) **Fixes** diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index ff7c02336..c473e2e16 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -9,6 +9,7 @@ - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) - `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) +- `TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109) **Fixes** diff --git a/src/controls/taxonomyPicker/TaxonomyPicker.module.scss b/src/controls/taxonomyPicker/TaxonomyPicker.module.scss index a19ccc839..571ab83c8 100644 --- a/src/controls/taxonomyPicker/TaxonomyPicker.module.scss +++ b/src/controls/taxonomyPicker/TaxonomyPicker.module.scss @@ -56,7 +56,8 @@ padding-left: 20px; .termEnabled, - .termDisabled { + .termDisabled, + .termNoTagging { background-repeat: no-repeat; background-position: 30px 3px; } @@ -69,6 +70,10 @@ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFMSURBVDhPzZPNSsNAFIULQqEQEPoSQqAg7gqC0HdwXxAElyYgBBGSZ+gDdOUyIauULATdKrgIKCKuQjbiDySCkNV4TrkzpJW2cefAxwwzc86de2em0/k3zXGcHpgC9Qeu5glAsAMefN+/K8vyVbVoWZbdMxDFY9d136Ioum6hW9iiDVSe588rxDXmJ+AAdAWOOVcbAy1O01R5nqfYoxVglyk+Hu7Z4FiwOcc1GBRMwQSnOAxDHz0jDyCwwCVQS3DO0gU0BkmSzG8A/UQiz7DxC5yLGQ1PwDeYGYOiKF6WarCPDUOJeor+A4z0m8P4SNaG+hY+4zi+aZh0scEBNeB41DTBuCcGjj6FjaM/BUFwW1XVO6vdMNiSdIzJLwN5TJZ+iSLQKYwbR9cmZyaFdX+JhZIiMue+cLFQxA0G22uusd/6I8OEb4LXRwZN4Q+3Ys8Mb9+nRgAAAABJRU5ErkJggg=='); // /_layouts/15/Images/EMMTermDeprecated.png } + .termNoTagging { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZBJREFUeNqkU0trwkAQnhURBBFPKghekuJN7KW9pOCj0Agl9/4uT/6BHgXpxQfxYKltKEYhV3tXFF/4RrOdXYgkxpz8YA47O983O9+whFIKt8DvddHv9wej0UjY7/dwPB55sGaJRKImSVLxXMiSl9Hr9fRWq0WvoVKpUFVVv6xaF1nX9R+LvFqteKAgrVarVNM0fi6Xy9Sq99mfjeTv2Wz2mMvlYL1en/OGYYCiKKTT6fAzG8flQbfb1ReLxX0+n4fJZOLwQxRFKJVKNJPJwHa7dZuI5I/lcsnJrHMwGHQUpdNpHp5bGI/Hr7IsA3Pc7/dcDEynU5jP5xAIBJwCpmmeN+IF9IaT0VA20p+V5yaGQqF2s9mE3W4Hh8PBFXZyLBbTstmsaAkQqyuu7nOz2UiCIEAkEoFwOMzz6A0n44YgHo8bhULBYQaxP7vRaLyjyFsqleIiDLbOAyTfXY5GLueu1+s1XNULE2Fg5Gg0qj4jrnlDrhmHIu3hcPh0Op0gmUz+IvfBy1xy62/0wY34F2AAKtctO7g/KgIAAAAASUVORK5CYII='); // /_layouts/15/Images/EMMTermDisabled.png + } + label>span { padding-left: 25px; } diff --git a/src/controls/taxonomyPicker/TaxonomyPicker.tsx b/src/controls/taxonomyPicker/TaxonomyPicker.tsx index 4c7b0293d..dc2717082 100644 --- a/src/controls/taxonomyPicker/TaxonomyPicker.tsx +++ b/src/controls/taxonomyPicker/TaxonomyPicker.tsx @@ -234,6 +234,7 @@ export class TaxonomyPicker extends React.Component { } } + /** + * Get the right class name for the term + */ + private getClassName() { + if (this.props.term.IsDeprecated) { + return styles.termDisabled; + } + + if (!this.props.term.IsAvailableForTagging) { + return styles.termNoTagging; + } + + return styles.termEnabled; + } + /** * Default React render */ @@ -60,8 +75,8 @@ export default class Term extends React.Component {
diff --git a/src/services/ISPTermStorePickerService.ts b/src/services/ISPTermStorePickerService.ts index 39e1d43dd..e2c36afc6 100644 --- a/src/services/ISPTermStorePickerService.ts +++ b/src/services/ISPTermStorePickerService.ts @@ -67,6 +67,7 @@ export interface ITerm { Name: string; Description: string; IsDeprecated: boolean; + IsAvailableForTagging: boolean; IsRoot: boolean; PathOfTerm: string; TermSet: ITermSetMinimal; diff --git a/src/services/SPTermStorePickerMockService.ts b/src/services/SPTermStorePickerMockService.ts index 08149c754..21192c3ad 100644 --- a/src/services/SPTermStorePickerMockService.ts +++ b/src/services/SPTermStorePickerMockService.ts @@ -1,13 +1,13 @@ import { ITermStore, ITerm, ITermSet } from './ISPTermStorePickerService'; import {IPickerTerms, IPickerTerm } from '../controls/taxonomyPicker/ITermPicker'; /** - * Defines a http client to request mock data to use the web part with the local workbench - */ +* Defines a http client to request mock data to use the web part with the local workbench +*/ export default class SPTermStoreMockHttpClient { /** - * Mock SharePoint result sample - */ + * Mock SharePoint result sample + */ private static _mockTermStores: ITermStore[] = [{ "_ObjectType_": "SP.Taxonomy.TermStore", "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:st:generated-idwdg==", @@ -38,79 +38,83 @@ export default class SPTermStoreMockHttpClient { } }]; - private static _mockTerms: ITermSet = - {"_ObjectType_":"SP.Taxonomy.TermSet", - "_ObjectIdentity_":"a4f45d9e-7003-5000-7d35-b4064108885e|fec14c62-7c3b-481b-851b-c80d7802b224:se:15WaN9o+nUi6qkivmCMKhxA4k0b3ed9BqbnSqve6DjrKW1tjX4wxSIv4oNnV63Xg", - "Id":"/Guid(635b5bca-8c5f-4831-8bf8-a0d9d5eb75e0)/", - "Name":"Countries", - "Description":"", -"Names":{"1033":"Countries"}, -"Terms":[ - { - "_ObjectType_": "SP.Taxonomy.Term", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-SPnCDng5nkmdP+UcRJTUTA==", - "Name": "Belgium", - "Id": "0ec2f948-3978-499e-9d3f-e51c4494d44c", - "Description": "", - "IsDeprecated": false, - "IsRoot": true, - "PathOfTerm": "Belgium", - "PathDepth": 1, - "TermSet": { - "_ObjectType_": "SP.Taxonomy.TermSet", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", - "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", - "Name" : "Country" - } - }, { - "_ObjectType_": "SP.Taxonomy.Term", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-1a3nKkDuZUOvMhLp9PvKFw==", - "Id": "2ae7add5-ee40-4365-af32-12e9f4fbca17", - "Name": "Antwerp", - "Description": "", - "IsDeprecated": false, - "IsRoot": false, - "PathOfTerm": "Belgium;Antwerp", - "PathDepth": 2, - "TermSet": { - "_ObjectType_": "SP.Taxonomy.TermSet", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", - "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", - "Name" : "Country" - } - }, { - "_ObjectType_": "SP.Taxonomy.Term", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-WCbUI7Ims0ysT\u002fBkk4NUhQ==", - "Name": "Brussels", - "Id": "23d42658-26b2-4cb3-ac4f-f06493835485", - "Description": "", - "IsDeprecated": false, - "IsRoot": false, - "PathOfTerm": "Belgium;Brussels", - "PathDepth": 2, - "TermSet": { - "_ObjectType_": "SP.Taxonomy.TermSet", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", - "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", - "Name" : "Country" - } - }, { - "_ObjectType_": "SP.Taxonomy.Term", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-WCbUI7Ims0ysT\u002fBkk4NUhQ==", - "Name": "Deprecated", - "Id": "23d42658-26b2-4cb3-ac4f-f06493835486", - "Description": "", - "IsDeprecated": true, - "IsRoot": true, - "PathOfTerm": "Deprecated", - "PathDepth": 1, - "TermSet": { - "_ObjectType_": "SP.Taxonomy.TermSet", - "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", - "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", - "Name" : "Country" - } - }]}; + private static _mockTerms: ITermSet = { + "_ObjectType_":"SP.Taxonomy.TermSet", + "_ObjectIdentity_":"a4f45d9e-7003-5000-7d35-b4064108885e|fec14c62-7c3b-481b-851b-c80d7802b224:se:15WaN9o+nUi6qkivmCMKhxA4k0b3ed9BqbnSqve6DjrKW1tjX4wxSIv4oNnV63Xg", + "Id":"/Guid(635b5bca-8c5f-4831-8bf8-a0d9d5eb75e0)/", + "Name":"Countries", + "Description":"", + "Names":{"1033":"Countries"}, + "Terms":[{ + "_ObjectType_": "SP.Taxonomy.Term", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-SPnCDng5nkmdP+UcRJTUTA==", + "Name": "Belgium", + "Id": "0ec2f948-3978-499e-9d3f-e51c4494d44c", + "Description": "", + "IsDeprecated": false, + "IsAvailableForTagging": false, + "IsRoot": true, + "PathOfTerm": "Belgium", + "PathDepth": 1, + "TermSet": { + "_ObjectType_": "SP.Taxonomy.TermSet", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", + "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", + "Name" : "Country" + } + }, { + "_ObjectType_": "SP.Taxonomy.Term", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-1a3nKkDuZUOvMhLp9PvKFw==", + "Id": "2ae7add5-ee40-4365-af32-12e9f4fbca17", + "Name": "Antwerp", + "Description": "", + "IsDeprecated": false, + "IsAvailableForTagging": false, + "IsRoot": false, + "PathOfTerm": "Belgium;Antwerp", + "PathDepth": 2, + "TermSet": { + "_ObjectType_": "SP.Taxonomy.TermSet", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", + "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", + "Name" : "Country" + } + }, { + "_ObjectType_": "SP.Taxonomy.Term", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-WCbUI7Ims0ysT\u002fBkk4NUhQ==", + "Name": "Brussels", + "Id": "23d42658-26b2-4cb3-ac4f-f06493835485", + "Description": "", + "IsDeprecated": false, + "IsAvailableForTagging": true, + "IsRoot": false, + "PathOfTerm": "Belgium;Brussels", + "PathDepth": 2, + "TermSet": { + "_ObjectType_": "SP.Taxonomy.TermSet", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", + "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", + "Name" : "Country" + } + }, { + "_ObjectType_": "SP.Taxonomy.Term", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:te:generated-id-WCbUI7Ims0ysT\u002fBkk4NUhQ==", + "Name": "Deprecated", + "Id": "23d42658-26b2-4cb3-ac4f-f06493835486", + "Description": "", + "IsDeprecated": true, + "IsAvailableForTagging": false, + "IsRoot": true, + "PathOfTerm": "Deprecated", + "PathDepth": 1, + "TermSet": { + "_ObjectType_": "SP.Taxonomy.TermSet", + "_ObjectIdentity_": "5e06ddd0-d2dd-4fff-bcc0-42b40f4aa59e|4dbeb936-1813-4630-a4bd-9811df3fe7f1:se:generated-id-", + "Id": "\/Guid(5b1b6df0-09a2-42eb-a3f6-006556621931)\/", + "Name" : "Country" + } + }] + }; /** * Mock method which returns mock terms stores @@ -134,31 +138,29 @@ export default class SPTermStoreMockHttpClient { return new Promise((resolve) => { resolve([ { - key : "23d42658-26b2-4cb3-ac4f-f06493835485", + key : "23d42658-26b2-4cb3-ac4f-f06493835485", name : 'Brussels', path : "Belgium;Brussels", termSet :"635b5bca-8c5f-4831-8bf8-a0d9d5eb75e0", termSetName : "Countries" - }, - { - key : "2ae7add5-ee40-4365-af32-12e9f4fbca17", + }, + { + key : "2ae7add5-ee40-4365-af32-12e9f4fbca17", name : 'Antwerp', path : "Belgium;Antwerp", termSet :"635b5bca-8c5f-4831-8bf8-a0d9d5eb75e0", termSetName : "Countries" - }, - { - key : "0ec2f948-3978-499e-9d3f-e51c4494d44c", + }, + { + key : "0ec2f948-3978-499e-9d3f-e51c4494d44c", name : 'Belgium', path : "Belgium", termSet :"635b5bca-8c5f-4831-8bf8-a0d9d5eb75e0", termSetName : "Countries" - } - ]); + } + ]); }); - } - - - } + } +} diff --git a/src/services/SPTermStorePickerService.ts b/src/services/SPTermStorePickerService.ts index a86c29e48..02a9601f7 100644 --- a/src/services/SPTermStorePickerService.ts +++ b/src/services/SPTermStorePickerService.ts @@ -132,7 +132,7 @@ export default class SPTermStorePickerService { } // Request body to retrieve all terms for the given term set - const data = `${termsetId}`; + const data = `${termsetId}`; const reqHeaders = new Headers(); diff --git a/src/webparts/controlsTest/components/ControlsTest.tsx b/src/webparts/controlsTest/components/ControlsTest.tsx index 9291c9e4b..ce8f32e4a 100644 --- a/src/webparts/controlsTest/components/ControlsTest.tsx +++ b/src/webparts/controlsTest/components/ControlsTest.tsx @@ -241,7 +241,7 @@ export default class ControlsTest extends React.Component Date: Fri, 7 Sep 2018 16:12:14 +0200 Subject: [PATCH 17/23] Enhancements for #94 and #122 --- CHANGELOG.JSON | 2 ++ CHANGELOG.md | 2 ++ .../documentation/docs/about/release-notes.md | 2 ++ .../docs/controls/PeoplePicker.md | 18 ++++++++++++-- src/controls/peoplepicker/IPeoplePicker.ts | 9 +++++++ .../peoplepicker/PeoplePickerComponent.tsx | 24 ++++++++++++------- src/controls/peoplepicker/PrincipalType.ts | 6 +++++ src/controls/peoplepicker/index.ts | 3 ++- .../controlsTest/components/ControlsTest.tsx | 6 +++-- 9 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 src/controls/peoplepicker/PrincipalType.ts diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 16d6df3db..778432904 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -6,6 +6,8 @@ "new": [], "enhancements": [ "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", + "`PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122)", + "`PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122)", "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)", diff --git a/CHANGELOG.md b/CHANGELOG.md index c473e2e16..6e3cbc675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ **Enhancements** - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) +- `PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) +- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index c473e2e16..6e3cbc675 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -5,6 +5,8 @@ **Enhancements** - `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) +- `PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) +- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) diff --git a/docs/documentation/docs/controls/PeoplePicker.md b/docs/documentation/docs/controls/PeoplePicker.md index 7b7b90945..99db205c2 100644 --- a/docs/documentation/docs/controls/PeoplePicker.md +++ b/docs/documentation/docs/controls/PeoplePicker.md @@ -21,7 +21,7 @@ This control renders a People picker field which can be used to select one or mo - Import the following modules to your component: ```typescript -import { PeoplePicker } from "@pnp/spfx-controls-react/lib/PeoplePicker"; +import { PeoplePicker, PrincipalType } from "@pnp/spfx-controls-react/lib/PeoplePicker"; ``` - Use the `PeoplePicker` control in your code as follows: @@ -35,7 +35,9 @@ import { PeoplePicker } from "@pnp/spfx-controls-react/lib/PeoplePicker"; showtooltip={true} isRequired={true} disabled={true} - selectedItems={this._getPeoplePickerItems} /> + selectedItems={this._getPeoplePickerItems} + showHiddenInUI={false} + principleTypes={[PrincipalType.User]} /> ``` - With the `selectedItems` property you can get the selected People in the Peoplepicker : @@ -68,6 +70,18 @@ The People picker control can be configured with the following properties: | peoplePickerCntrlclassName | string | no | applies custom styling to the people picker control only | | defaultSelectedUsers | string[] | no | Default selected user emails | | webAbsoluteUrl | string | no | Specify the site URL on which you want to perform the user query call. Default is the current site URL. | +| showHiddenInUI | boolean | no | Show users which are hidden from the UI. By default these users/groups hidden for the UI will not be shown. | +| principleTypes | PrincipleType[] | no | Define which type of data you want to retrieve: User, SharePoint groups, Security groups. Multiple are possible. | +Enum `PrincipalType` + +The `PrincipalType` enum can be used to specify the types of information you want to query: User, Security groups, and/or SharePoint groups. + +| Name | +| ---- | +| User | +| DistributionList | +| SecurityGroup | +| SharePointGroup | ![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/PeoplePicker) diff --git a/src/controls/peoplepicker/IPeoplePicker.ts b/src/controls/peoplepicker/IPeoplePicker.ts index 32c1e4a9d..63351d76f 100644 --- a/src/controls/peoplepicker/IPeoplePicker.ts +++ b/src/controls/peoplepicker/IPeoplePicker.ts @@ -1,6 +1,7 @@ import { WebPartContext } from '@microsoft/sp-webpart-base'; import { DirectionalHint } from "office-ui-fabric-react/lib/common/DirectionalHint"; import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Persona.types"; +import { PrincipalType } from "."; /** * Used to display a placeholder in case of no or temporary content. Button is optional. @@ -71,6 +72,14 @@ export interface IPeoplePickerProps { * Default Selected User Emails */ defaultSelectedUsers? : string[]; + /** + * Show users which are hidden from the UI + */ + showHiddenInUI?: boolean; + /** + * Specify the user / group types to retrieve + */ + principleTypes?: PrincipalType[]; } export interface IPeoplePickerState { diff --git a/src/controls/peoplepicker/PeoplePickerComponent.tsx b/src/controls/peoplepicker/PeoplePickerComponent.tsx index ac6af9106..6c2c67700 100644 --- a/src/controls/peoplepicker/PeoplePickerComponent.tsx +++ b/src/controls/peoplepicker/PeoplePickerComponent.tsx @@ -159,15 +159,21 @@ export class PeoplePicker extends React.Component + selectedItems={this._getPeoplePickerItems} + showHiddenInUI={false} + principleTypes={[PrincipalType.User]} /> Date: Mon, 10 Sep 2018 10:34:54 +0200 Subject: [PATCH 18/23] Updated contributors --- CHANGELOG.JSON | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 778432904..3f9949426 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -19,7 +19,7 @@ "`PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117)" ] }, - "contributions": ["Thomas Lamb", "Joel Rodrigues", "Mikael Svenson"] + "contributions": ["[Thomas Lamb](https://github.com/ThomasLamb)", "[Joel Rodrigues](https://github.com/joelfmrodrigues)", "[Mikael Svenson](https://github.com/wobba)"] }, { "version": "1.7.0", From 5dc26f1b7f5b925e68bbabd36657793428efe4ad Mon Sep 17 00:00:00 2001 From: Alex Terentiev Date: Tue, 11 Sep 2018 10:18:19 -0700 Subject: [PATCH 19/23] #116 - double click handler has been added, documentation has been updated --- .../docs/controls/fields/FieldNameRenderer.md | 6 +- .../fieldNameRenderer/FieldNameRenderer.tsx | 55 +++++++++++++++++-- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/docs/documentation/docs/controls/fields/FieldNameRenderer.md b/docs/documentation/docs/controls/fields/FieldNameRenderer.md index 065ff7e9e..c4edb274a 100644 --- a/docs/documentation/docs/controls/fields/FieldNameRenderer.md +++ b/docs/documentation/docs/controls/fields/FieldNameRenderer.md @@ -37,9 +37,9 @@ The FieldNameRenderer component can be configured with the following properties: | isLink | boolean | yes | True if the name should be rendered as a link. | | isNew | boolean | no | True if the document is new. | | filePath | string | no | Path to the document. | -| hasPreview | boolean | no | True if the document has preview (true by default) | -| onClick | (args: INameClickEventArgs) => {} | no | Custom handler for link click. If not set link click will lead to rendering document preview. | - +| hasPreview | boolean | no | True if the document has preview and link href should be constructed to display the preview (instead of direct document's link). The flag works only if `onClick` property is NOT defined. | +| onClick | (args: INameClickEventArgs) => {} | no | Custom handler for link click. If not set link click will lead to rendering document preview. Works if `isLink` is set to `true` | +| onDoubleClick | (args: INameClickEventArgs) => {} | no | Custom handler for link double click. If not set link If not set link will use OOTB behavior. Works if `isLink` is set to `true` | ![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/fields/FieldNameRenderer) diff --git a/src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx b/src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx index dca80c4dc..d5332d504 100644 --- a/src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx +++ b/src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx @@ -1,5 +1,7 @@ import { override } from '@microsoft/decorators'; import * as React from 'react'; +import * as ReactDOM from 'react-dom'; + import { css } from 'office-ui-fabric-react/lib/Utilities'; import { Icon } from 'office-ui-fabric-react/lib/Icon'; import { Link } from 'office-ui-fabric-react/lib/Link'; @@ -28,13 +30,20 @@ export interface IFieldNameRendererProps extends IFieldRendererProps { */ isNew?: boolean; /** - * true if the document type has preview (true by default) + * true if the document type has preview (true by default). + * The flag impacts on the link's href: + * if the flag is tru then the href is constructed like #id=${filePath}&parent=${filePath.substring(0, filePath.lastIndexOf('/'))}, + * otherwise the href will contain filePath only. */ hasPreview?: boolean; /** * custom handler for link click. If not set link click will lead to rendering document preview */ onClick?: (args: IFieldNameClickEventArgs) => {}; + /** + * custom handler for link double click. If not set link will use OOTB behavior. + */ + onDoubleClick?: (args: IFieldNameClickEventArgs) => {}; } /** @@ -57,12 +66,37 @@ export interface IFieldNameClickEventArgs { * - Title */ export class FieldNameRenderer extends React.Component { + private _button: HTMLButtonElement; + public constructor(props: IFieldNameRendererProps, state: IFieldNameRendererState) { super(props, state); telemetry.track('FieldNameRenderer', {}); this.state = {}; + + this._onDoubleClick = this._onDoubleClick.bind(this); + } + + @override + public componentDidMount() { + // + // small hack for double click. + // unfortunately, we can't use React onDoubleClick because React doesn't guaranty the sequence of handlers. + // And stopPropagation could not make effect. + // + if (this.props.onDoubleClick && this.props.isLink) { + const domNode = ReactDOM.findDOMNode(this); + this._button = domNode.querySelector('button'); + this._button.addEventListener('dblclick', this._onDoubleClick, false); + } + } + + @override + public componentWillUnmount() { + if (this._button) { + this._button.removeEventListener('dblclick', this._onDoubleClick); + } } @override @@ -76,7 +110,10 @@ export class FieldNameRenderer extends React.Component{this.props.text}; + value = {this.props.text}; } else { let url: string; @@ -103,13 +140,23 @@ export class FieldNameRenderer extends React.Component; } - private _onClick(e): void { + private _onClick(e): boolean { if (this.props.onClick) { e.stopPropagation(); e.preventDefault(); const args: IFieldNameClickEventArgs = this.props as IFieldNameClickEventArgs; this.props.onClick(args); - return; + return false; + } + } + + private _onDoubleClick(e): boolean { + if (this.props.onDoubleClick) { + e.stopPropagation(); + e.preventDefault(); + const args: IFieldNameClickEventArgs = this.props as IFieldNameClickEventArgs; + this.props.onDoubleClick(args); + return false; } } } From 3e57524508cfc838499c531f5d32882c0e98e642 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 11 Sep 2018 20:44:47 +0200 Subject: [PATCH 20/23] Updated changelog --- CHANGELOG.JSON | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 3f9949426..617f93741 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -5,21 +5,22 @@ "changes": { "new": [], "enhancements": [ - "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", "`PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122)", - "`PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122)", "`WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114)", "`WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121)", "`ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119)", + "`FieldNameRenderer` double click support added [#116](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/116)", "`TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113)", - "`TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109)" + "`PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110)", + "`TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109)", + "`PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#94](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/94)" ], "fixes": [ "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)", "`PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117)" ] }, - "contributions": ["[Thomas Lamb](https://github.com/ThomasLamb)", "[Joel Rodrigues](https://github.com/joelfmrodrigues)", "[Mikael Svenson](https://github.com/wobba)"] + "contributions": ["[Thomas Lamb](https://github.com/ThomasLamb)", "[Joel Rodrigues](https://github.com/joelfmrodrigues)", "[Mikael Svenson](https://github.com/wobba)", "[Alex Terentiev](https://github.com/AJIXuMuK)"] }, { "version": "1.7.0", From 36125a6d086e9289f9c46b27bd8d1a4e5d4fae9d Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 11 Sep 2018 20:53:21 +0200 Subject: [PATCH 21/23] Updated changelogs --- CHANGELOG.md | 5 +++-- docs/documentation/docs/about/release-notes.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e3cbc675..665fd7376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,15 @@ **Enhancements** -- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) -- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +- `FieldNameRenderer` double click support added [#116](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/116) - `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) +- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109) +- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#94](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/94) **Fixes** diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index 6e3cbc675..665fd7376 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -4,14 +4,15 @@ **Enhancements** -- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `PeoplePicker`: Specify to hide or show the users/groups which are hidden in the UI [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) -- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#122](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/122) - `WebPartTitle`: changing font-sizes on different resolutions [#114](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/114) - `WebPartTitle`: Added accessibility tags for web part title [#121](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/121) - `ListView`: Resizable columns - introduced a `isResizable` property [#119](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/119) +- `FieldNameRenderer` double click support added [#116](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/116) - `TaxonomyPicker`: table markup changed to DIV [#113](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/113) +- `PeoplePicker`: ability to specify the source site to load users from [#110](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/110) - `TaxonomyPicker`: Disable the terms which are set as deprecated or unavailable for tagging [#109](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/109) +- `PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#94](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/94) **Fixes** From 88d216904d9a6d81e90a3299fa7244a41b40cf6a Mon Sep 17 00:00:00 2001 From: prokach Date: Wed, 12 Sep 2018 17:38:41 +0300 Subject: [PATCH 22/23] Fix to lookupDispFormUrl --- .../fields/fieldLookupRenderer/FieldLookupRenderer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/fields/fieldLookupRenderer/FieldLookupRenderer.tsx b/src/controls/fields/fieldLookupRenderer/FieldLookupRenderer.tsx index 8dc62edf1..9dd47bc07 100644 --- a/src/controls/fields/fieldLookupRenderer/FieldLookupRenderer.tsx +++ b/src/controls/fields/fieldLookupRenderer/FieldLookupRenderer.tsx @@ -128,7 +128,7 @@ export class FieldLookupRenderer extends React.Component Date: Wed, 12 Sep 2018 17:29:30 +0200 Subject: [PATCH 23/23] Changelog updates --- CHANGELOG.JSON | 1 + CHANGELOG.md | 1 + docs/documentation/docs/about/release-notes.md | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.JSON b/CHANGELOG.JSON index 617f93741..d6eafbeec 100644 --- a/CHANGELOG.JSON +++ b/CHANGELOG.JSON @@ -16,6 +16,7 @@ "`PeoplePicker`: Specify principle type to retrieve (users, groups, ...) [#94](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/94)" ], "fixes": [ + "`FieldLookupRenderer`: Fixed URL querystring params [#126](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/126)", "`IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118)", "`PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117)" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 665fd7376..2328a939e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ **Fixes** +- `FieldLookupRenderer`: Fixed URL querystring params [#126](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/126) - `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) - `PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117) diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index 665fd7376..2328a939e 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -16,6 +16,7 @@ **Fixes** +- `FieldLookupRenderer`: Fixed URL querystring params [#126](https://github.com/SharePoint/sp-dev-fx-controls-react/pull/126) - `IFrameDialog`: dialog width is not correct in IE11 [#118](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/118) - `PeoplePicker`: fix freezes when typing in search values [#117](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/117)