Skip to content

Commit dab163e

Browse files
authored
Merge branch 'dev' into bugfix/2040-dynamicform-moderntaxpicker-default-value
2 parents 2cba263 + 34ab7a8 commit dab163e

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

+3118
-3001
lines changed

CHANGELOG.json

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
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+
]
23+
},
24+
"contributions": [
25+
"[Antanina Druzhkina](https://github.com/Ateina)",
26+
"[Harminder Singh](https://github.com/HarminderSethi)",
27+
"[Mark Bice](https://github.com/mbice)",
28+
"[Michaël Maillot](https://github.com/michaelmaillot)",
29+
"[moudhafersalhi](https://github.com/moudhafersalhi)",
30+
"[Niels Söth](https://github.com/nsoeth)",
31+
"[SeyedAliAsghari96](https://github.com/SeyedAliAsghari96)"
32+
]
33+
},
334
{
435
"version": "3.22.0",
536
"changes": {
@@ -55,7 +86,6 @@
5586
"Add cs-cz.ts [#1932](https://github.com/pnp/sp-dev-fx-controls-react/pull/1932)",
5687
"`FilterBar`: new control `FilterBar` [#1884](https://github.com/pnp/sp-dev-fx-controls-react/pull/1884)",
5788
"`Calendar`: new controls `Calendar` [#1955](https://github.com/pnp/sp-dev-fx-controls-react/pull/1955)"
58-
5989
],
6090
"enhancements": [
6191
"Update markdown-it to >=13.0.2 [#1916](https://github.com/pnp/sp-dev-fx-controls-react/issues/1916)",
@@ -215,7 +245,7 @@
215245
},
216246
{
217247
"version": "3.17.0",
218-
"changes":{
248+
"changes": {
219249
"new": [],
220250
"enhancements": [
221251
"`DyanmicForm`: Added file handling [#1625](https://github.com/pnp/sp-dev-fx-controls-react/pull/1625)",
@@ -359,7 +389,6 @@
359389
"[Sergei Sergeev](https://github.com/s-KaiNet)",
360390
"[Sharepointalist](https://github.com/sharepointalist)",
361391
"[Zhephyr](https://github.com/Zhephyr54)"
362-
363392
]
364393
},
365394
{
@@ -417,7 +446,6 @@
417446
"`AdaptiveCardHost`: Logic to prevent re-renders (flicker) [#1425](https://github.com/pnp/sp-dev-fx-controls-react/pull/1425)",
418447
"`ListItemComments`: Add new parameter for ListItemComments to highlight comment [#1430](https://github.com/pnp/sp-dev-fx-controls-react/pull/1430)",
419448
"`ComboBoxListItemPicker`: Update ComboBoxListItemPicker.md [#1470](https://github.com/pnp/sp-dev-fx-controls-react/pull/1470)"
420-
421449
],
422450
"fixes": [
423451
"`DateTimePicker`: broken link for `getErrorMessage` property fixed [#1277](https://github.com/pnp/sp-dev-fx-controls-react/pull/1381)",
@@ -438,7 +466,6 @@
438466
"`DateTimePicker`: Date picker locale [#1095](https://github.com/pnp/sp-dev-fx-controls-react/issues/1095)",
439467
"`RichText`: Use theme colors - fix dark mode [#669](https://github.com/pnp/sp-dev-fx-controls-react/issues/669)",
440468
"`FilePicker`: Use theme colors - fix dark mode [#1132](https://github.com/pnp/sp-dev-fx-controls-react/issues/1132)"
441-
442469
]
443470
},
444471
"contributions": [
@@ -460,7 +487,6 @@
460487
"[Samuele Furnari](https://github.com/SamueleFurnari)",
461488
"[sambilfinger](https://github.com/sambilfinger)",
462489
"[wuxiaojun514](https://github.com/wuxiaojun514)"
463-
464490
]
465491
},
466492
{
@@ -513,7 +539,6 @@
513539
"`Placeholder`: Documentation example to only display in edit mode [#1280](https://github.com/pnp/sp-dev-fx-controls-react/issues/1280)",
514540
"`DynamicForm`: Update documentation regarding onBeforeSubmit [#1319](https://github.com/pnp/sp-dev-fx-controls-react/issues/1319)",
515541
"`DynamicForm`: FirstDayOfWeek in DatePickers from webs regional settings [#1317](https://github.com/pnp/sp-dev-fx-controls-react/issues/1317)"
516-
517542
],
518543
"fixes": [
519544
"`PeoplePicker`: fixes where people picker returns no results [#1292](https://github.com/pnp/sp-dev-fx-controls-react/issues/1292)",
@@ -584,7 +609,6 @@
584609
"`PeoplePicker`: PeoplePicker validation on focus out [#1221](https://github.com/pnp/sp-dev-fx-controls-react/pull/1221)",
585610
"`DynamicForm`: Cannot display lookup value when the source field is not Title [#1215](https://github.com/pnp/sp-dev-fx-controls-react/issues/1215)",
586611
"`FilePicker`: the endPoint for webSearch do not work [#1256](https://github.com/pnp/sp-dev-fx-controls-react/issues/1256)"
587-
588612
]
589613
},
590614
"contributions": [

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
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+
23+
### Contributors
24+
25+
Special thanks to our contributors (in alphabetical order): [Antanina Druzhkina](https://github.com/Ateina), [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).
26+
327
## 3.22.0
428

529
### New control(s)

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
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+
23+
### Contributors
24+
25+
Special thanks to our contributors (in alphabetical order): [Antanina Druzhkina](https://github.com/Ateina), [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).
26+
327
## 3.22.0
428

529
### 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)