Skip to content

Commit

Permalink
Merge pull request #1126 from pnp/dev
Browse files Browse the repository at this point in the history
v3.6.0
  • Loading branch information
AJIXuMuK committed Feb 12, 2022
2 parents 2f28397 + 4691ad6 commit e082497
Show file tree
Hide file tree
Showing 80 changed files with 4,914 additions and 739 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
registry-url: 'https://registry.npmjs.org'

- name: Install npm dependencies
run: npm i
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
registry-url: 'https://registry.npmjs.org'

- name: Install npm dependencies
run: npm i
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.JSON
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
{
"versions": [
{
"version": "3.6.0",
"changes": {
"new": [
"`AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)"
],
"enhancements": [
"`ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)",
"`FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)",
"`Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)",
"`FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)",
"`FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)",
"`DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)"

],
"fixes": [
"`LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)",
"`ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)",
"Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)",
"`DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)",
"`DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)",
"`DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)",
"`TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)",
"`WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)",
"`LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)",
"`LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)",
"Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)"
]
},
"contributions": [
"[Alexander M](https://github.com/alexanmo)",
"[Carlos Marins Jr](https://github.com/kadu-jr)",
"[Fabio Franzini](https://github.com/fabiofranzini)",
"[Henrik](https://github.com/Henke-visual)",
"[Jasey Waegebaert](https://github.com/Jwaegebaert)",
"[João Mendes](https://github.com/joaojmendes)",
"[Milan Holemans](https://github.com/milanholemans)",
"[MonalisaBaltatescu](https://github.com/MonalisaBaltatescu)",
"[Patrik Hellgren](https://github.com/patrikhellgren)",
"[Tom G](https://github.com/t0mgerman)"
]
},
{
"version": "3.5.0",
"changes": {
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Releases

## 3.6.0

### New control(s)

- `AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)

### Enhancements

- `ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)
- `FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)
- `Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)
- `FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)
- `FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)
- `DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)

### Fixes

- `LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)
- `ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)
- Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)
- `DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)
- `DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)
- `DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)
- `TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)
- `WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)
- `LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)
- `LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)
- Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)

### Contributors

Special thanks to our contributors (in alphabetical order): [Alexander M](https://github.com/alexanmo), [Carlos Marins Jr](https://github.com/kadu-jr), [Fabio Franzini](https://github.com/fabiofranzini), [Henrik](https://github.com/Henke-visual), [Jasey Waegebaert](https://github.com/Jwaegebaert), [João Mendes](https://github.com/joaojmendes), [Milan Holemans](https://github.com/milanholemans), [MonalisaBaltatescu](https://github.com/MonalisaBaltatescu), [Patrik Hellgren](https://github.com/patrikhellgren), [Tom G](https://github.com/t0mgerman).

## 3.5.0

### Enhancements
Expand Down
33 changes: 33 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Releases

## 3.6.0

### New control(s)

- `AdaptiveCardHost`: React control that allows you to render an Adaptive Card as a component [#1096](https://github.com/pnp/sp-dev-fx-controls-react/issues/1096)

### Enhancements

- `ModernTaxonomyPicker`: ability to add action buttons to terms [#1058](https://github.com/pnp/sp-dev-fx-controls-react/pull/1058)
- `FilePicker`: allow to select files from other sites [#907](https://github.com/pnp/sp-dev-fx-controls-react/issues/907)
- `Localization`: Update Swedish translations [#1099](https://github.com/pnp/sp-dev-fx-controls-react/pull/1099)
- `FilePicker`: ability to allow external link and disable file existance chech [commit](https://github.com/pnp/sp-dev-fx-controls-react/commit/41ed4dd2277cf33050f9aeffe743dd684ed9d782)
- `FilePicker`: support for multi-select on additional sources [#1047](https://github.com/pnp/sp-dev-fx-controls-react/pull/1047)
- `DateTimePicker`: new property for allowTextInput [#1094](https://github.com/pnp/sp-dev-fx-controls-react/issues/1094)

### Fixes

- `LivePersona`: Cannot find module '@pnp/spfx-controls-react/lib/LivePersona'[#1069](https://github.com/pnp/sp-dev-fx-controls-react/issues/1069)
- `ListView`: documentation spelling mistake 'ColumndName' [#1063](https://github.com/pnp/sp-dev-fx-controls-react/issues/1063)
- Fixes for Norwegian localization [#1083](https://github.com/pnp/sp-dev-fx-controls-react/pull/1083)
- `DynamicForm`: doesn't load or save correctly when field name starts with a special character [#1077](https://github.com/pnp/sp-dev-fx-controls-react/issues/1077)
- `DynamicForm`: fields in DynamicForm do not honour regional settings [#1075](https://github.com/pnp/sp-dev-fx-controls-react/issues/1075)
- `DynamicForm`: Boolean fields do not honour the default value in list settings [#1073](https://github.com/pnp/sp-dev-fx-controls-react/issues/1073)
- `TaxonomyPicker`: table markdown fix in documentation [#1072](https://github.com/pnp/sp-dev-fx-controls-react/pull/1072)
- `WebPartTitle`: Fix for styling of WebPartTitle to better match the styling of the oob webpart titles. [#1088](https://github.com/pnp/sp-dev-fx-controls-react/pull/1088)
- `LivePersona`: fix for documentation typos [#1106](https://github.com/pnp/sp-dev-fx-controls-react/pull/1106)
- `LivePersona`: remove property for SPFx context [#1108](https://github.com/pnp/sp-dev-fx-controls-react/pull/1108)
- Documentation fix for swedish translations [#1100](https://github.com/pnp/sp-dev-fx-controls-react/pull/1100)

### Contributors

Special thanks to our contributors (in alphabetical order): [Alexander M](https://github.com/alexanmo), [Carlos Marins Jr](https://github.com/kadu-jr), [Fabio Franzini](https://github.com/fabiofranzini), [Henrik](https://github.com/Henke-visual), [Jasey Waegebaert](https://github.com/Jwaegebaert), [João Mendes](https://github.com/joaojmendes), [Milan Holemans](https://github.com/milanholemans), [MonalisaBaltatescu](https://github.com/MonalisaBaltatescu), [Patrik Hellgren](https://github.com/patrikhellgren), [Tom G](https://github.com/t0mgerman).

## 3.5.0

### Enhancements
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.
164 changes: 164 additions & 0 deletions docs/documentation/docs/controls/AdaptiveCardHost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Adaptive Card Host

The motivation behind this control is to have a React control that facilitates the use of Adaptive Cards in SPFx by adding some features such as:

- Graphic integration with SharePoint / Microsoft Teams themes, both as regards the color palette and the use of the Fluent UI React controls instead of the classic HTML controls.

- Automatic use of Adaptive Cards Templating if an object containing data is passed to the control.

For graphic integration, in the case of SharePoint the current theme (page or section theme) or a custom theme is used.
Three custom themes have been created for Microsoft Teams to emulate the colors of the available themes: Default, Dark and Hight Contrast.

All Elements and Actions of Adaptive Cards have been redefined using Fluent UI React, both for SharePoint and Microsoft Teams (in this case the "Fluent UI Northstar" library is not used), adding and improving features that are not managed in Microsoft's implementation of the "adaptivecards-fluentui" library (Theme support for example).

The Adaptive Cards version supported is 1.5, by using the 'adaptivecards' npm package version 2.10.0.

Here is an example of the control in action inside a Web Part:

![Adaptive Card Host control](../assets/AdaptiveCardHost.gif)

Here is an example of the previous Web Part (using different Card), hosted as a Tab in Microsoft Teams:

![Adaptive Card Host control](../assets/AdaptiveCardHostTeams.gif)

## 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.
- In your component file, import the `AdaptiveCardHost` control as follows:

```TypeScript
import { AdaptiveCardHost, IAdaptiveCardHostActionResult, AdaptiveCardHostThemeType } from "@pnp/spfx-controls-react/lib/AdaptiveCardHost";
```

- Example on use the `AdaptiveCardHost` control with only required properties:

```TSX
<AdaptiveCardHost
card={card}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

- Example on use the `AdaptiveCardHost` control with all properties:

```TSX
<AdaptiveCardHost
card={card}
data={data}
style={null}
className={null}
theme={this.props.theme}
themeType={themeType}
hostConfig={null}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
onSetCustomElements={(registry: CardObjectRegistry<CardElement>) => {
registry.register("CustomElementName", CustomElement);
}}
onSetCustomActions={(registry: CardObjectRegistry<Action>) => {
registry.register("CustomActionName", CustomAction);
}}
onUpdateHostCapabilities={(hostCapabilities: HostCapabilities) => {
hostCapabilities.setCustomProperty("CustomPropertyName", Date.now);
}}
isUniqueControlInPage={true}
/>
```

- Example on use the `AdaptiveCardHost` control with SharePoint Theme:

```TSX
<AdaptiveCardHost
card={card}
themeType={AdaptiveCardHostThemeType.SharePoint}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

- Example on use the `AdaptiveCardHost` control with SharePoint Theme "Section Variation" ('this.props.theme' is the theme that come from the Web Part) */):

```TSX
<AdaptiveCardHost
card={card}
theme={this.props.theme}
themeType={AdaptiveCardHostThemeType.SharePoint}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

- Example on use the `AdaptiveCardHost` control with Teams "Default" Theme:

```TSX
<AdaptiveCardHost
card={card}
themeType={AdaptiveCardHostThemeType.Teams}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

- Example on use the `AdaptiveCardHost` control with Teams "Dark" Theme:

```TSX
<AdaptiveCardHost
card={card}
themeType={AdaptiveCardHostThemeType.TeamsDark}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

- Example on use the `AdaptiveCardHost` control with Teams "High Contrast" Theme:

```TSX
<AdaptiveCardHost
card={card}
themeType={AdaptiveCardHostThemeType.TeamsHighContrast}
onInvokeAction={(action) => alert(JSON.stringify(action))}
onError={(error) => alert(error.message)}
/>
```

## Implementation

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

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| card | object | yes | Set Adaptive Card payload. |
| data | { "$root": object } | no | Set Data Source for template rendering. |
| style | React.CSSProperties | no | Set CSS Style. |
| className | string | no | Set CSS Class. |
| theme | IPartialTheme or ITheme | no | Set Fluent UI Theme. Used only if the "themeType" property is set to 'ThemeType.SharePoint'. If not set or set to null or not defined, the theme passed through context will be searched, or the default theme of the page will be loaded. |
| themeType | ThemeType | no | Select the Type of Theme you want to use. If it is not set or set to null or undefined, the 'ThemeType.SharePoint' value will be used and the "theme" property or the theme passed through the context or default page will be loaded. In other cases, the chosen Microsoft Teams theme will be applied. |
| hostConfig | object | no | Set custom HostConfig. |
| onInvokeAction | (action: IAdaptiveCardActionResult) => void | yes | Invoked every time an Action is performed. |
| onError | (error: Error) => void | yes | Invoked every time an exception occurs in the rendering phase. |
| onSetCustomElements | (registry: CardObjectRegistry<CardElement>) => void | no | Invoked to manage Elements to the current Adaptive Card instance. |
| onSetCustomActions | (registry: CardObjectRegistry<Action>) => void | no | Invoked to manage Actions to the current Adaptive Card instance. |
| onUpdateHostCapabilities | (hostCapabilities: HostCapabilities) => void | no | Invoked to manage the HostCapabilities object like add custom properties. |
| isUniqueControlInPage | boolean | no | Set to true if you want to use only one instance of this control per page, false for multiple controls. This affects how CSS variables are set. |

Interface `IAdaptiveCardHostActionResult`

| Property | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| type | string | yes | Type of the Action. |
| title | string | no | Title of the Action. |
| url | string | no | Url of the Action. |
| data | object | no | Data of the Action. |
| verb | string | no | Verb of the Action. |

Enum `AdaptiveCardHostThemeType`

| Type | Description |
| ---- | ---- |
| SharePoint | Use the SharePoint current Theme or Theme Variation |
| Teams | Use the Fluent UI Teams default theme |
| TeamsDark | Use the Fluent UI Teams dark theme |
| TeamsHighContrast | Use the Fluent UI Teams high contrast theme |

![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/AdaptiveCardHost)
1 change: 1 addition & 0 deletions docs/documentation/docs/controls/DateTimePicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The `DateTimePicker` control can be configured with the following properties:
| isMonthPickerVisible | boolean | no | Controls whether the month picker is shown beside the day picker or hidden. |
| showMonthPickerAsOverlay | boolean | no | Show month picker on top of date picker when visible. |
| showWeekNumbers | boolean | no | Controls whether the calendar should show the week number (weeks 1 to 53) before each week row |
| allowTextInput | boolean | no | Whether the user is allowed to enter a date as text instead of picking one from the date picker. |
| strings | IDatePickerStrings | no | Localized strings to use in the DateTimePicker |
| value | Date | no | Default value of the DatePicker, if any |
| onChange | function | no | Callback issued when date or time is changed |
Expand Down
2 changes: 2 additions & 0 deletions docs/documentation/docs/controls/FilePicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The FilePicker component can be configured with the following properties:
| renderCustomMultipleUploadTabContent | (filePickerResult: IFilePickerResult[]) => JSX.Element \| null | no | Optional renderer to add custom user-defined fields to "Multi-Upload" tab |
| renderCustomLinkTabContent | (filePickerResult: IFilePickerResult) => JSX.Element \| null | no | Optional renderer to add custom user-defined fields to "Link" tab |
| includePageLibraries | boolean | no | Specifies if Site Pages library to be visible on Sites tab |
| allowExternalLinks | boolean | no | Specifies if external links should be allowed. |
| checkIfFileExists | boolean | no | When using file links, this property allows the user to choose if the control should check if the link point to a file that exists or not. |

interface `IFilePickerResult`

Expand Down
Loading

0 comments on commit e082497

Please sign in to comment.