Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge for release of v1.3.0 #72

Merged
merged 48 commits into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
17505b2
Pics illustrating ListView.ContextualMenu
mmsharepoint Apr 7, 2018
3714923
Create ListView.ContextualMenu.md
mmsharepoint Apr 7, 2018
7630325
Merge pull request #1 from mmsharepoint/patch-1
mmsharepoint Apr 7, 2018
cc4e096
Delete ListView.ContextualMenu.PNG
mmsharepoint Apr 7, 2018
2930931
Delete ListView.ContextualMenu_clicked.PNG
mmsharepoint Apr 7, 2018
e26f54f
Add files via upload
mmsharepoint Apr 7, 2018
cf3c76b
Update ListView.ContextualMenu.md
mmsharepoint Apr 7, 2018
744ed9a
Update ListView.md
mmsharepoint Apr 7, 2018
b2417f2
Added the SPList entities
parithon Apr 9, 2018
7e19fb4
Added SharePoint services
parithon Apr 9, 2018
f0fe9d9
Added listPicker control
parithon Apr 9, 2018
bf1f084
Added listPicker root control and added listPicker to the index
parithon Apr 9, 2018
76a551d
Fixed ISPService reference error in IListPicker
parithon Apr 9, 2018
7cdcb0c
Merge branch 'dev' into feature_listPicker
parithon Apr 9, 2018
feaf790
Removed my spEntities and added the SP List entities to the existing …
parithon Apr 9, 2018
cf6eded
Panel works only with termset
spdavid Apr 15, 2018
26f237e
AnchorId Implementation
spdavid Apr 15, 2018
fcf0345
Cleaned up Unused objects and interfaces
spdavid Apr 16, 2018
022491c
Removed a few more unused objects
spdavid Apr 16, 2018
99bd333
spelling mistake
spdavid Apr 16, 2018
fa28b54
One last spelling mistake.
spdavid Apr 16, 2018
6e43ef9
Merge branch 'dev' of https://github.com/spdavid/sp-dev-fx-controls-r…
estruyf Apr 17, 2018
50870ba
TermPicker fixes
estruyf Apr 17, 2018
e14f2b5
Merge branch 'spdavid-dev' into dev
estruyf Apr 17, 2018
61f2892
Version update for 1.3.0 + extra group check in termstore fetching
estruyf Apr 17, 2018
879ae38
Fix for #63
estruyf Apr 17, 2018
e62fd8a
Sync changelog
estruyf Apr 17, 2018
b38d90a
Merge branch 'master' of https://github.com/mmsharepoint/sp-dev-fx-co…
estruyf Apr 17, 2018
2b66cf0
Add a contextual menu to the ListView
estruyf Apr 17, 2018
6461e31
Merge branch 'mmsharepoint-master' into dev
estruyf Apr 17, 2018
d15d356
Locale strings + TermSet selection (#64)
estruyf Apr 17, 2018
e015db4
Changelog updates
estruyf Apr 17, 2018
5474e43
Typo in the locale file
estruyf Apr 17, 2018
1bec453
Fix for #65
estruyf Apr 18, 2018
a84f5f7
Taxonomy Picker Documentation. anchorId spelling mistake
spdavid Apr 19, 2018
24492f8
Change Dislpay to Display
hugoabernier Apr 20, 2018
bfd7591
Changed Dislpay to Display
hugoabernier Apr 20, 2018
95f62d2
Changed Dislpay to Display
hugoabernier Apr 20, 2018
5efa159
Merge pull request #68 from hugoabernier/patch-1
estruyf Apr 24, 2018
a6dba6d
Merge pull request #69 from hugoabernier/patch-3
estruyf Apr 24, 2018
a239fb0
Merge pull request #70 from hugoabernier/patch-2
estruyf Apr 24, 2018
4ae5db4
Merge branch 'dev' of https://github.com/spdavid/sp-dev-fx-controls-r…
estruyf Apr 25, 2018
0ad67ca
Small documentation updates
estruyf Apr 25, 2018
ea41fef
Merge branch 'spdavid-dev' into dev
estruyf Apr 25, 2018
4b6d3e3
Merge branch 'feature_listPicker' of https://github.com/parithon/sp-d…
estruyf Apr 25, 2018
7aa3832
Various fixes for the list picker
estruyf Apr 25, 2018
677208b
Merge branch 'parithon-feature_listPicker' into dev
estruyf Apr 25, 2018
b1e96e1
Update changelog
estruyf Apr 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# Releases

## 1.3.0

**New Controls**

- `TaxonomyPicker` control got added [#22](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/22) [#63](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/63) [#64](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/64)
- `ListPicker` control got added [#34](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/34)

**Fixes**

- Issue fixed when the optional `selection` property was not provided to the `ListView` [#65](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/65)

## 1.2.5

**Fixes**

- Undo `ListView` item selection after items array updates [#55](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/55)

## 1.2.4

**Enhancements**
- Hiding placeholder web part on small zones

- Hiding placeholder title on small zones

**Fixes**
- iFrame dialog reference fix [#52 - Need some more implementation documentation on IFrameDialog](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

- iFrame dialog reference fix [#52](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

## 1.2.3

Expand Down
5 changes: 3 additions & 2 deletions config/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"use-named-parameter": true,
"valid-typeof": true,
"variable-name": false,
"whitespace": false
"whitespace": false,
"no-debugger": true
}
}
}
}
25 changes: 22 additions & 3 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# Releases

## 1.3.0

**New Controls**

- `TaxonomyPicker` control got added [#22](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/22) [#63](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/63) [#64](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/64)
- `ListPicker` control got added [#34](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/34)

**Fixes**

- Issue fixed when the optional `selection` property was not provided to the `ListView` [#65](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/65)

## 1.2.5

**Fixes**

- Undo `ListView` item selection after items array updates [#55](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/55)

## 1.2.4

**Enhancements**
- Hiding placeholder web part on small zones

- Hiding placeholder title on small zones

**Fixes**
- iFrame dialog reference fix [#52 - Need some more implementation documentation on IFrameDialog](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

- iFrame dialog reference fix [#52](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

## 1.2.3

Expand Down Expand Up @@ -44,7 +63,7 @@

## 1.1.2

- Fix for WebPartTitle control to inherit color
- Fix for `WebPartTitle` control to inherit color
- Improved telemetry with some object checks

## 1.1.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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/documentation/docs/beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Testing out a beta release ![](https://img.shields.io/npm/v/@pnp/spfx-controls-react/next.svg)

All you need to do for testing out a beta release of `@pnp/spfx-controls-react` is to install the dependency as follows:

```
npm install @pnp/spfx-controls-react@next --save
```

## Beta control documentation

The control documentation is only live for public releases, not for beta versions. If you want to checkout the markdown files of all controls in the `dev` branch: [beta documentation](https://github.com/SharePoint/sp-dev-fx-controls-react/tree/dev/docs/documentation/docs/controls).

## Next Steps

Once you installed the beta version, you can start using the controls in your solution. Go to the homepage to get an overview of all the available controls and the steps to get started: [home](./).

![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/beta)
108 changes: 108 additions & 0 deletions docs/documentation/docs/controls/ListView.ContextualMenu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# ListView: Add a contextual menu

## The ContextualMenu component

In order to create a contextual menu for your list view, you first need to create a new component which will use a combination of an [IconButton](https://developer.microsoft.com/en-us/fabric#/components/button#Variants) and [ContextualMenu](https://developer.microsoft.com/en-us/fabric#/components/contextualmenu) controls from the Office UI Fabric React.

Here is some sample code:

```TypeScript
import * as React from 'react';
import { Layer, IconButton, IButtonProps } from 'office-ui-fabric-react';
import { ContextualMenuItemType } from 'office-ui-fabric-react/lib/ContextualMenu';
// The following are project specific components
import { IECBProps } from './IECBProps';
import styles from './ECB.module.scss';
import { IListitem } from '../../model/IListitem';

export class ECB extends React.Component<IECBProps, {}> {

public constructor(props: IECBProps) {
super(props);

this.state = {
panelOpen: false
};
}

public render() {
return (
<div className={styles.ecb}>
<IconButton id='ContextualMenuButton1'
className={styles.ecbbutton}
text=''
width='30'
split={false}
iconProps={ { iconName: 'MoreVertical' } }
menuIconProps={ { iconName: '' } }
menuProps={{
shouldFocusOnMount: true,
items: [
{
key: 'action1',
name: 'Action 1',
onClick: this.handleClick.bind(this, this.props.item.Firstname + ' Action 1')
},
{
key: 'divider_1',
itemType: ContextualMenuItemType.Divider
},
{
key: 'action2',
name: 'Action 2',
onClick: this.handleClick.bind(this, this.props.item.Firstname + ' Action 2')
},
{
key: 'action3',
name: 'Action 3',
onClick: this.handleClick.bind(this, this.props.item.Lastname + ' Action 3')
},
{
key: 'disabled',
name: 'Disabled action',
disabled: true,
onClick: () => console.error('Disabled action should not be clickable.')
}
]
}} />
</div>
);
}

private handleClick(source:string, event) {
alert(`${source} clicked`);
}
}
```

## The ListView column

Once the ECB component is created, you can add the contextual menu to the `ListView` control. In order to do this, you have to insert another `Viewfield` in code at the position of our choice. For instance after the `Lastname`:

```TypeScript
{
name: "",
sorting: false,
maxWidth: 40,
render: (rowitem: IListitem) => {
const element:React.ReactElement<IECBProps> = React.createElement(
ECB,
{
item: rowitem
}
);
return element;
}
}
```

Inside the render method of the `IViewField`, the ECB component gets created and the current item will be used as a reference for the clicked row.

## The result
The result will look like the following:

![ContextualMenu_shown](../assets/ListView.ContextualMenu.png)

Once you click on an action, you will see the alert:

![ContextualMenu_clicked](../assets/ListView.ContextualMenu_clicked.png)
3 changes: 3 additions & 0 deletions docs/documentation/docs/controls/ListView.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ 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).

## Implementation

The ListView control can be configured with the following properties:
Expand Down
87 changes: 87 additions & 0 deletions docs/documentation/docs/controls/TaxonomyPicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Taxonomy Picker

This control Allows you to select one or more Terms from a TermSet via its name or TermSet ID. You can also configure the control to select the child terms from a specific term in the TermSet by setting the AnchorId.

!!! note "Disclaimer"
This control makes use of the `ProcessQuery` API end-points to retrieve the managed metadata information. This will get changed once the APIs for managing managed metadata will become available.

**Empty term picker**

![Empty term picker](../assets/termpicker-empty.png)

**Selecting terms**

![Selecting terms](../assets/termpicker-selection.png)

**Selected terms in picker**

![Selected terms in the input](../assets/termpicker-selected-terms.png)

**Term picker: Auto Complete**

![Selected terms in the input](../assets/termpicker-autocomplete.png)


## How to use this control in your solutions

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

```TypeScript
import { TaxonomyPicker, IPickerTerms } from "@pnp/spfx-controls-react/lib/TaxonomyPicker";
```

- Use the `TaxonomyPicker` control in your code as follows:

```TypeScript
<TaxonomyPicker
allowMultipleSelections={true}
TermSetNameOrID="Countries"
panelTitle="Select Term"
label="Taxonomy Picker"
context={this.props.context}
onChange={this.onTaxPickerChange}
isTermSetSelectable={false}
/>
```

- With the `onChange` property you can capture the event of when the terms in the picker has changed:

```typescript
private onTaxPickerChange(terms : IPickerTerms) {
console.log("Terms", terms);
}
```

## Implementation

The TaxonomyPicker control can be configured with the following properties:

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| panelTitle | string | yes | TermSet Picker Panel title. |
| label | string | yes | Text displayed above the Taxonomy Picker. |
| disabled | string | no | Specify if the control needs to be disabled. |
| context | WebPartContext | yes | Context of the current web part. |
| initialValues | IPickerTerms | no | Defines the selected by default term sets. |
| allowMultipleSelections | boolean | no | Defines if the user can select only one or many term sets. Default value is false. |
| TermSetNameOrID | string | yes | The name or Id of your TermSet that you would like the Taxonomy Picker to chose terms from. |
| onChange | function | no | captures the event of when the terms in the picker has changed. |
| isTermSetSelectable | boolean | no | Specify if the TermSet itself is selectable in the tree view. |
| anchorId | string | no | Set the anchorid to a child term in the TermSet to be able to select terms from that level and below. |

Interface `IPickerTerm`

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| key | string | yes | The ID of the term |
| name | string | yes | The name of the term |
| path | string | yes | The path of the term |
| termSet | string | yes | The Id of the parent TermSet of the term |
| termSetName | string | no | The Name of the parent TermSet of the term |

Interface `IPickerTerms`

An Array of IPickerTerm

![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/Placeholder)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FieldTitleRenderer control

This control renders title either as a simple text or as a link to the Dislpay Form. Additional actions like Share and Context Menu are not implemented.
This control renders title either as a simple text or as a link to the Display Form. Additional actions like Share and Context Menu are not implemented.

![FieldTitleRenderer control output](../../assets/FieldTitleRenderer.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/docs/controls/fields/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following Field Controls are currently available:
- [FieldNameRenderer](./FieldNameRenderer) (renders document's name as a link)
- [FieldTaxonomyRenderer](./FieldTaxonomyRenderer) (renders terms from Managed Metadata field)
- [FieldTextRenderer](./FieldTextRenderer) (renders simple text)
- [FieldTitleRenderer](./FieldTitleRenderer) (renders title either as a simple text or as a link to the Dislpay Form)
- [FieldTitleRenderer](./FieldTitleRenderer) (renders title either as a simple text or as a link to the Display Form)
- [FieldUrlRenderer](./FieldUrlRenderer) (renders Hyperlink or Picture field value as a link or image)
- [FieldUserRenderer](./FieldUserRenderer) (renders each referenced user/group as a link on a separate line)

Expand Down
11 changes: 8 additions & 3 deletions docs/documentation/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Reusable React controls for your SharePoint Framework solutions
# Reusable React controls for your SharePoint Framework solutions ![](https://img.shields.io/npm/v/@pnp/spfx-controls-react.svg)

This repository provides developers with a set of reusable React controls that can be used in SharePoint Framework (SPFx) solutions. The project provides controls for building web parts and extensions.

!!! attention
The controls project has a minimal dependency on SharePoint Framework version `1.3.0`. Be aware that the controls might not work in solutions your building for on-premises. As for on-premises solutions version `1.1.0` is currently used.

## Getting started

### Installation
Expand Down Expand Up @@ -30,12 +33,14 @@ The following controls are currently available:
- [ListView](./controls/ListView) (List view control)
- [Placeholder](./controls/Placeholder) (Control that can be used to show an initial placeholder if the web part has to be configured)
- [SiteBreadcrumb](./controls/SiteBreadcrumb) (Breadcrumb control)
- [SiteBreadcrumb](./controls/TaxonomyPicker) (Taxonomy Picker)
- [WebPartTitle](./controls/WebPartTitle) (Customizable web part title control)
- [IFrameDialog](./controls/IFrameDialog) (renders a Dialog with an iframe as a content)

Field customizer controls:

> **Note**: If you want to use these controls in your solution, first check out the start guide for these controls: [using the field controls](./controls/fields/main).
!!! note
If you want to use these controls in your solution, first check out the start guide for these controls: [using the field controls](./controls/fields/main).

- [FieldAttachmentsRenderer](./controls/fields/FieldAttachmentsRenderer) (renders Clip icon based on the provided `count` property is defined and greater than 0)
- [FieldDateRenderer](./controls/fields/FieldDateRenderer) (renders date string as a simple text)
Expand All @@ -44,7 +49,7 @@ Field customizer controls:
- [FieldNameRenderer](./controls/fields/FieldNameRenderer) (renders document's name as a link)
- [FieldTaxonomyRenderer](./controls/fields/FieldTaxonomyRenderer) (renders terms from Managed Metadata field)
- [FieldTextRenderer](./controls/fields/FieldTextRenderer) (renders simple text)
- [FieldTitleRenderer](./controls/fields/FieldTitleRenderer) (renders title either as a simple text or as a link to the Dislpay Form)
- [FieldTitleRenderer](./controls/fields/FieldTitleRenderer) (renders title either as a simple text or as a link to the Display Form)
- [FieldUrlRenderer](./controls/fields/FieldUrlRenderer) (renders Hyperlink or Picture field value as a link or image)
- [FieldUserRenderer](./controls/fields/FieldUserRenderer) (renders each referenced user/group as a link on a separate line)

Expand Down
3 changes: 3 additions & 0 deletions docs/documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ pages:
- Controls:
- FileTypeIcon: 'controls/FileTypeIcon.md'
- ListView: 'controls/ListView.md'
- "ListView: add a contextual menu": 'controls/ListView.ContextualMenu.md'
- Placeholder: 'controls/Placeholder.md'
- SiteBreadcrumb: 'controls/SiteBreadcrumb.md'
- WebPartTitle: 'controls/WebPartTitle.md'
- TaxonomyPicker: 'controls/TaxonomyPicker.md'
- IFrameDialog: 'controls/IFrameDialog.md'
- 'Field Controls':
- 'Getting started': 'controls/fields/main.md'
Expand All @@ -21,6 +23,7 @@ pages:
- FieldTitleRenderer: 'controls/fields/FieldTitleRenderer.md'
- FieldUrlRenderer: 'controls/fields/FieldUrlRenderer.md'
- FieldUserRenderer: 'controls/fields/FieldUserRenderer.md'
- 'Beta testing': 'beta.md'
- About:
- 'Release notes': 'about/release-notes.md'
- License: 'about/license.md'
Expand Down
Loading