Skip to content

Commit 5a3ee00

Browse files
authored
Merge pull request #2067 from pnp/dev
3.23.0
2 parents 9cfb9d6 + f31e566 commit 5a3ee00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3138
-3010
lines changed

CHANGELOG.json

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
{
22
"versions": [
3+
{
4+
"version": "3.23.0",
5+
"changes": {
6+
"new": [],
7+
"enhancements": [
8+
"Update MPA page with compatibility matrix [#2063](https://github.com/pnp/sp-dev-fx-controls-react/pull/2063)",
9+
"`fast-serve`: Update spfx-fast-serve-helpers to 1.21.1 [#2038](https://github.com/pnp/sp-dev-fx-controls-react/pull/2038)",
10+
"`DynamicForm`: Add itemsQueryCountLimit for Lookup fields [#2033](https://github.com/pnp/sp-dev-fx-controls-react/issues/2033)",
11+
"`ImagePicker`: FluentProvider to SelectFromSharePoint component so token is not undefined [#2046](https://github.com/pnp/sp-dev-fx-controls-react/pull/2046)"
12+
],
13+
"fixes": [
14+
"`RichText`: Rich Text in v 3.22 ribbon renders incorrectly [#2036](https://github.com/pnp/sp-dev-fx-controls-react/issues/2036)",
15+
"`Carousel`: links not opening on a new tab with target: _blank [#2022](https://github.com/pnp/sp-dev-fx-controls-react/issues/2022)",
16+
"`ListItemPicker`: calculated column as columnInternalName not working [#1870](https://github.com/pnp/sp-dev-fx-controls-react/issues/1870)",
17+
"`Calendar`: not displaying items [#2025](https://github.com/pnp/sp-dev-fx-controls-react/issues/2025)",
18+
"`ListItemComments`: Error when using some special characters in text [#2047](https://github.com/pnp/sp-dev-fx-controls-react/issues/2047)",
19+
"Update `FolderExplorerService.ts` to add import @pnp/sp/files [#2050](https://github.com/pnp/sp-dev-fx-controls-react/pull/2050)",
20+
"`RichText`: indent controls missing icons [#2045](https://github.com/pnp/sp-dev-fx-controls-react/issues/2045)",
21+
"Using `ListItemAttachments` to add/remove attachments causes ETag errors [#2051](https://github.com/pnp/sp-dev-fx-controls-react/issues/2051)",
22+
"`DynamicForm` and `ModernTaxonomyPicker`: using default value in taxonomy column does not work [#2040](https://github.com/pnp/sp-dev-fx-controls-react/issues/2040)"
23+
]
24+
},
25+
"contributions": [
26+
"[Antanina Druzhkina](https://github.com/Ateina)",
27+
"[diabhoil](https://github.com/diabhoil)",
28+
"[Harminder Singh](https://github.com/HarminderSethi)",
29+
"[Mark Bice](https://github.com/mbice)",
30+
"[Michaël Maillot](https://github.com/michaelmaillot)",
31+
"[moudhafersalhi](https://github.com/moudhafersalhi)",
32+
"[Niels Söth](https://github.com/nsoeth)",
33+
"[SeyedAliAsghari96](https://github.com/SeyedAliAsghari96)"
34+
]
35+
},
336
{
437
"version": "3.22.0",
538
"changes": {
@@ -55,7 +88,6 @@
5588
"Add cs-cz.ts [#1932](https://github.com/pnp/sp-dev-fx-controls-react/pull/1932)",
5689
"`FilterBar`: new control `FilterBar` [#1884](https://github.com/pnp/sp-dev-fx-controls-react/pull/1884)",
5790
"`Calendar`: new controls `Calendar` [#1955](https://github.com/pnp/sp-dev-fx-controls-react/pull/1955)"
58-
5991
],
6092
"enhancements": [
6193
"Update markdown-it to >=13.0.2 [#1916](https://github.com/pnp/sp-dev-fx-controls-react/issues/1916)",
@@ -215,7 +247,7 @@
215247
},
216248
{
217249
"version": "3.17.0",
218-
"changes":{
250+
"changes": {
219251
"new": [],
220252
"enhancements": [
221253
"`DyanmicForm`: Added file handling [#1625](https://github.com/pnp/sp-dev-fx-controls-react/pull/1625)",
@@ -359,7 +391,6 @@
359391
"[Sergei Sergeev](https://github.com/s-KaiNet)",
360392
"[Sharepointalist](https://github.com/sharepointalist)",
361393
"[Zhephyr](https://github.com/Zhephyr54)"
362-
363394
]
364395
},
365396
{
@@ -417,7 +448,6 @@
417448
"`AdaptiveCardHost`: Logic to prevent re-renders (flicker) [#1425](https://github.com/pnp/sp-dev-fx-controls-react/pull/1425)",
418449
"`ListItemComments`: Add new parameter for ListItemComments to highlight comment [#1430](https://github.com/pnp/sp-dev-fx-controls-react/pull/1430)",
419450
"`ComboBoxListItemPicker`: Update ComboBoxListItemPicker.md [#1470](https://github.com/pnp/sp-dev-fx-controls-react/pull/1470)"
420-
421451
],
422452
"fixes": [
423453
"`DateTimePicker`: broken link for `getErrorMessage` property fixed [#1277](https://github.com/pnp/sp-dev-fx-controls-react/pull/1381)",
@@ -438,7 +468,6 @@
438468
"`DateTimePicker`: Date picker locale [#1095](https://github.com/pnp/sp-dev-fx-controls-react/issues/1095)",
439469
"`RichText`: Use theme colors - fix dark mode [#669](https://github.com/pnp/sp-dev-fx-controls-react/issues/669)",
440470
"`FilePicker`: Use theme colors - fix dark mode [#1132](https://github.com/pnp/sp-dev-fx-controls-react/issues/1132)"
441-
442471
]
443472
},
444473
"contributions": [
@@ -460,7 +489,6 @@
460489
"[Samuele Furnari](https://github.com/SamueleFurnari)",
461490
"[sambilfinger](https://github.com/sambilfinger)",
462491
"[wuxiaojun514](https://github.com/wuxiaojun514)"
463-
464492
]
465493
},
466494
{
@@ -513,7 +541,6 @@
513541
"`Placeholder`: Documentation example to only display in edit mode [#1280](https://github.com/pnp/sp-dev-fx-controls-react/issues/1280)",
514542
"`DynamicForm`: Update documentation regarding onBeforeSubmit [#1319](https://github.com/pnp/sp-dev-fx-controls-react/issues/1319)",
515543
"`DynamicForm`: FirstDayOfWeek in DatePickers from webs regional settings [#1317](https://github.com/pnp/sp-dev-fx-controls-react/issues/1317)"
516-
517544
],
518545
"fixes": [
519546
"`PeoplePicker`: fixes where people picker returns no results [#1292](https://github.com/pnp/sp-dev-fx-controls-react/issues/1292)",
@@ -584,7 +611,6 @@
584611
"`PeoplePicker`: PeoplePicker validation on focus out [#1221](https://github.com/pnp/sp-dev-fx-controls-react/pull/1221)",
585612
"`DynamicForm`: Cannot display lookup value when the source field is not Title [#1215](https://github.com/pnp/sp-dev-fx-controls-react/issues/1215)",
586613
"`FilePicker`: the endPoint for webSearch do not work [#1256](https://github.com/pnp/sp-dev-fx-controls-react/issues/1256)"
587-
588614
]
589615
},
590616
"contributions": [

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Releases
22

3+
## 3.23.0
4+
5+
### Enhancements
6+
7+
- Update MPA page with compatibility matrix [#2063](https://github.com/pnp/sp-dev-fx-controls-react/pull/2063)
8+
- `fast-serve`: Update spfx-fast-serve-helpers to 1.21.1 [#2038](https://github.com/pnp/sp-dev-fx-controls-react/pull/2038)
9+
- `DynamicForm`: Add itemsQueryCountLimit for Lookup fields [#2033](https://github.com/pnp/sp-dev-fx-controls-react/issues/2033)
10+
- `ImagePicker`: FluentProvider to SelectFromSharePoint component so token is not undefined [#2046](https://github.com/pnp/sp-dev-fx-controls-react/pull/2046)
11+
12+
### Fixes
13+
14+
- `RichText`: Rich Text in v 3.22 ribbon renders incorrectly [#2036](https://github.com/pnp/sp-dev-fx-controls-react/issues/2036)
15+
- `Carousel`: links not opening on a new tab with target: _blank [#2022](https://github.com/pnp/sp-dev-fx-controls-react/issues/2022)
16+
- `ListItemPicker`: calculated column as columnInternalName not working [#1870](https://github.com/pnp/sp-dev-fx-controls-react/issues/1870)
17+
- `Calendar`: not displaying items [#2025](https://github.com/pnp/sp-dev-fx-controls-react/issues/2025)
18+
- `ListItemComments`: Error when using some special characters in text [#2047](https://github.com/pnp/sp-dev-fx-controls-react/issues/2047)
19+
- Update `FolderExplorerService.ts` to add import @pnp/sp/files [#2050](https://github.com/pnp/sp-dev-fx-controls-react/pull/2050)
20+
- `RichText`: indent controls missing icons [#2045](https://github.com/pnp/sp-dev-fx-controls-react/issues/2045)
21+
- Using `ListItemAttachments` to add/remove attachments causes ETag errors [#2051](https://github.com/pnp/sp-dev-fx-controls-react/issues/2051)
22+
- `DynamicForm` and `ModernTaxonomyPicker`: using default value in taxonomy column does not work [#2040](https://github.com/pnp/sp-dev-fx-controls-react/issues/2040)
23+
24+
### Contributors
25+
26+
Special thanks to our contributors (in alphabetical order): [Antanina Druzhkina](https://github.com/Ateina), [diabhoil](https://github.com/diabhoil), [Harminder Singh](https://github.com/HarminderSethi), [Mark Bice](https://github.com/mbice), [Michaël Maillot](https://github.com/michaelmaillot), [moudhafersalhi](https://github.com/moudhafersalhi), [Niels Söth](https://github.com/nsoeth), [SeyedAliAsghari96](https://github.com/SeyedAliAsghari96).
27+
328
## 3.22.0
429

530
### New control(s)

docs/documentation/docs/about/release-notes.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Releases
22

3+
## 3.23.0
4+
5+
### Enhancements
6+
7+
- Update MPA page with compatibility matrix [#2063](https://github.com/pnp/sp-dev-fx-controls-react/pull/2063)
8+
- `fast-serve`: Update spfx-fast-serve-helpers to 1.21.1 [#2038](https://github.com/pnp/sp-dev-fx-controls-react/pull/2038)
9+
- `DynamicForm`: Add itemsQueryCountLimit for Lookup fields [#2033](https://github.com/pnp/sp-dev-fx-controls-react/issues/2033)
10+
- `ImagePicker`: FluentProvider to SelectFromSharePoint component so token is not undefined [#2046](https://github.com/pnp/sp-dev-fx-controls-react/pull/2046)
11+
12+
### Fixes
13+
14+
- `RichText`: Rich Text in v 3.22 ribbon renders incorrectly [#2036](https://github.com/pnp/sp-dev-fx-controls-react/issues/2036)
15+
- `Carousel`: links not opening on a new tab with target: _blank [#2022](https://github.com/pnp/sp-dev-fx-controls-react/issues/2022)
16+
- `ListItemPicker`: calculated column as columnInternalName not working [#1870](https://github.com/pnp/sp-dev-fx-controls-react/issues/1870)
17+
- `Calendar`: not displaying items [#2025](https://github.com/pnp/sp-dev-fx-controls-react/issues/2025)
18+
- `ListItemComments`: Error when using some special characters in text [#2047](https://github.com/pnp/sp-dev-fx-controls-react/issues/2047)
19+
- Update `FolderExplorerService.ts` to add import @pnp/sp/files [#2050](https://github.com/pnp/sp-dev-fx-controls-react/pull/2050)
20+
- `RichText`: indent controls missing icons [#2045](https://github.com/pnp/sp-dev-fx-controls-react/issues/2045)
21+
- Using `ListItemAttachments` to add/remove attachments causes ETag errors [#2051](https://github.com/pnp/sp-dev-fx-controls-react/issues/2051)
22+
- `DynamicForm` and `ModernTaxonomyPicker`: using default value in taxonomy column does not work [#2040](https://github.com/pnp/sp-dev-fx-controls-react/issues/2040)
23+
24+
### Contributors
25+
26+
Special thanks to our contributors (in alphabetical order): [Antanina Druzhkina](https://github.com/Ateina), [diabhoil](https://github.com/diabhoil), [Harminder Singh](https://github.com/HarminderSethi), [Mark Bice](https://github.com/mbice), [Michaël Maillot](https://github.com/michaelmaillot), [moudhafersalhi](https://github.com/moudhafersalhi), [Niels Söth](https://github.com/nsoeth), [SeyedAliAsghari96](https://github.com/SeyedAliAsghari96).
27+
328
## 3.22.0
429

530
### New control(s)

docs/documentation/docs/controls/Dashboard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Provides settings of Dashboard's widget
111111
| controlOptions | IWidgetControlOptions | no | Component rendering options. |
112112
| body | IWidgetBodyContent[] | no | Widget's content (children) rendered as tabs. |
113113
| link | IWidgetLink | no | Widget's link rendered at the bottom part of the widget. |
114+
| rowSpan | number | no | Number of rows the widget should span. If specified, it will override any vertical value set from the size property. |
114115

115116
Interface `IWidgetActionKey`
116117

docs/documentation/docs/controls/DynamicForm.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ The `DynamicForm` can be configured with the following properties:
7272
| useModernTaxonomyPicker | boolean | no | Specifies if the form should render [ModernTaxonomyPicker](./ModernTaxonomyPicker.md) control for Managed metadata fields. If set to `true`, Dynamic form will render ModernTaxonomyPicker control. If set to `false`, Dynamic form will render TaxonomyPicker control. Default is `false` |
7373
| className | string | no | Set CSS Class. |
7474
| styles | IStyleFunctionOrObject<IDynamicFormStyleProps, [IDynamicFormStyles](#idynamicformstyles-interface)> | no | Styles to apply on control. See the example [here](#how-to-use-styles-property) |
75+
| itemsQueryCountLimit | number | no | Number of items to display in the lookup fields of the form | |
7576

7677
## Validation Error Dialog Properties `IValidationErrorDialogProps`
7778

@@ -119,6 +120,56 @@ The `DynamicForm` can be configured with the following properties:
119120
| thumbnailFieldButtons | IStyle | styles for button when field type is 'Thumbnail' |
120121
| selectedFileContainer | IStyle | styles for File Selection Control |
121122

123+
## Public Methods
124+
125+
The `DynamicForm` control exposes the following public methods that can be called using a ref:
126+
127+
### updateETag(itemData: any): void
128+
129+
Updates the ETag stored in the component's state. This is useful when the list item has been modified externally (e.g., by adding/removing attachments using the ListItemAttachments control) and you need to update the ETag to prevent 412 conflict errors on save.
130+
131+
**Parameters:**
132+
- `itemData` - The updated item data containing the new ETag (typically from SharePoint REST API response with `odata.etag` property)
133+
134+
**Example:**
135+
136+
```TypeScript
137+
import * as React from 'react';
138+
import { DynamicForm } from '@pnp/spfx-controls-react/lib/DynamicForm';
139+
import { ListItemAttachments } from '@pnp/spfx-controls-react/lib/ListItemAttachments';
140+
141+
export class MyComponent extends React.Component {
142+
private dynamicFormRef = React.createRef<DynamicForm>();
143+
144+
private onAttachmentChange = (itemData: any): void => {
145+
// Update the DynamicForm's ETag when attachments are modified
146+
if (this.dynamicFormRef.current) {
147+
this.dynamicFormRef.current.updateETag(itemData);
148+
}
149+
}
150+
151+
public render() {
152+
return (
153+
<div>
154+
<ListItemAttachments
155+
listId={this.props.listId}
156+
itemId={this.props.itemId}
157+
context={this.props.context}
158+
onAttachmentChange={this.onAttachmentChange}
159+
/>
160+
<DynamicForm
161+
ref={this.dynamicFormRef}
162+
context={this.props.context}
163+
listId={this.props.listId}
164+
listItemId={this.props.itemId}
165+
respectETag={true}
166+
/>
167+
</div>
168+
);
169+
}
170+
}
171+
```
172+
122173
## How to use styles property
123174

124175
Property styles of Dynamic Form gives you a set of properties which you can use to modify styles.

docs/documentation/docs/controls/GridLayout.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,10 @@ The grid layout control can be configured with the following properties:
147147
| items | any[] | yes | The array of items you wish to display. |
148148
| listProps | IListProps | no | Provides additional list properties to customize the underlying list. |
149149
| onRenderGridItem | function | yes | onRenderGridItem handler for the grid layout. Use this handler to specify how you wish to render each grid item |
150+
| itemPadding | number | no | Gap between items. |
151+
| itemMinWidth | number | no | Minimum width for each item. |
152+
| itemMaxWidth | number | no | Maximum width for each item. |
153+
| compactThreshold | number | no | Threshold width below which the compact layout is activated. |
154+
| rowsPerPage | number | no | Number of rows displayed per page. |
150155

151156
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/gridlayout)

docs/documentation/docs/controls/ListItemAttachments.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,53 @@ The `ListItemAttachments` control can be configured with the following propertie
6363
| description | string | no | Description text to display on the placeholder, below the main text and icon. |
6464
| disabled | boolean | no | Specifies if the control is disabled or not. |
6565
| openAttachmentsInNewWindow | boolean | no | Specifies if the attachment should be opened in a separate browser tab. Use this property set to `true` if you plan to use the component in Microsoft Teams. |
66+
| onAttachmentChange | (itemData: any) => void | no | Callback function invoked when attachments are added or removed. Receives the updated item data including the new ETag. This is useful when using the control within a form (like DynamicForm) that tracks ETags for optimistic concurrency control. |
67+
68+
## Usage with DynamicForm
69+
70+
When using `ListItemAttachments` within a `DynamicForm` or any component that uses ETags for optimistic concurrency control, you should use the `onAttachmentChange` callback to update the ETag when attachments are modified:
71+
72+
```TypeScript
73+
import * as React from 'react';
74+
import { DynamicForm } from '@pnp/spfx-controls-react/lib/DynamicForm';
75+
import { ListItemAttachments } from '@pnp/spfx-controls-react/lib/ListItemAttachments';
76+
77+
export class MyFormComponent extends React.Component<any, any> {
78+
private dynamicFormRef = React.createRef<DynamicForm>();
79+
80+
/**
81+
* Callback invoked when attachments are added or removed
82+
* Updates the ETag in DynamicForm to prevent 412 conflicts
83+
*/
84+
private onAttachmentChange = (itemData: any): void => {
85+
if (this.dynamicFormRef.current) {
86+
this.dynamicFormRef.current.updateETag(itemData);
87+
}
88+
}
89+
90+
public render(): React.ReactElement {
91+
return (
92+
<div>
93+
<ListItemAttachments
94+
listId={listId}
95+
itemId={itemId}
96+
context={this.props.context}
97+
onAttachmentChange={this.onAttachmentChange}
98+
/>
99+
100+
<DynamicForm
101+
ref={this.dynamicFormRef}
102+
context={this.props.context}
103+
listId={listId}
104+
listItemId={itemId}
105+
respectETag={true}
106+
/>
107+
</div>
108+
);
109+
}
110+
}
111+
```
112+
113+
This prevents 412 ETag conflict errors when saving the form after adding or removing attachments.
66114

67115
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/ListItemAttachments)

0 commit comments

Comments
 (0)