Skip to content

Commit 532e188

Browse files
Merge branch 'dev' of https://github.com/NishkalankBezawada/sp-dev-fx-controls-react into Add-Component-ListItemComments
2 parents 0d423e7 + 8e15bc8 commit 532e188

File tree

14 files changed

+174
-142
lines changed

14 files changed

+174
-142
lines changed

CHANGELOG.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,27 @@
77
"`ViewPicker`: new control ViewPicker [#1439](https://github.com/pnp/sp-dev-fx-controls-react/issues/1439)"
88
],
99
"enhancements": [
10-
"`FieldCollectionData`: render on page instead of panel and added combobox and peoplepicker controls [#1588](https://github.com/pnp/sp-dev-fx-controls-react/pull/1588)"
10+
"`FieldCollectionData`: render on page instead of panel and added combobox and peoplepicker controls [#1588](https://github.com/pnp/sp-dev-fx-controls-react/pull/1588)",
11+
"`FieldCollectionData`: added date field control and updated number field [#1600](https://github.com/pnp/sp-dev-fx-controls-react/pull/1600)"
1112
],
1213
"fixes": [
1314
"`AccessibleAccordion`: fix typo in documentation [#1634](https://github.com/pnp/sp-dev-fx-controls-react/pull/1634)",
1415
"`DynamicForm`: fix issue with MultiChoice field [#1510](https://github.com/pnp/sp-dev-fx-controls-react/issues/1510)",
1516
"`Localization`: Update dutch translations [#1635](https://github.com/pnp/sp-dev-fx-controls-react/issues/1635)",
16-
"`TaxonomyPicker`: suggested item contains double termset name [#1597](https://github.com/pnp/sp-dev-fx-controls-react/issues/1597)"
17+
"`TaxonomyPicker`: suggested item contains double termset name [#1597](https://github.com/pnp/sp-dev-fx-controls-react/issues/1597)",
18+
"`DynamicForm`: DynamicForm does not properly handle NULL default values for Taxonomy fields [#1267](https://github.com/pnp/sp-dev-fx-controls-react/issues/1267)",
19+
"`DynamicForm`: New items are always created with the default content type if the list has multiple content types [#1626](https://github.com/pnp/sp-dev-fx-controls-react/pull/1626)",
20+
"`PeoplePicker`:PeoplePicker won't accept Multiple Users with the same name [#1620] (https://github.com/pnp/sp-dev-fx-controls-react/pull/1620)",
21+
"`DynamicForm`: Dynamic Form accessed TaxonomyFieldTypeMulti without considering sub-array results [#1614](https://github.com/pnp/sp-dev-fx-controls-react/pull/1614)"
1722
]
1823
},
1924
"contributions": [
2025
"[Guido Zambarda](https://github.com/GuidoZam)",
26+
"[Michaël Maillot](https://github.com/michaelmaillot)",
2127
"[Nils Andresen](https://github.com/nils-a)",
2228
"[Nishkalank Bezawada](https://github.com/NishkalankBezawada)",
2329
"[Rico van de Ven](https://github.com/RicoNL)",
24-
"[wuxiaojun514](https://github.com/wuxiaojun514)",
30+
"[wuxiaojun514](https://github.com/wuxiaojun514)"
2531
]
2632
},
2733
{

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.16.0
4+
5+
### New control(s)
6+
7+
- `ViewPicker`: new control ViewPicker [#1439](https://github.com/pnp/sp-dev-fx-controls-react/issues/1439)
8+
9+
### Enhancements
10+
11+
- `FieldCollectionData`: render on page instead of panel and added combobox and peoplepicker controls [#1588](https://github.com/pnp/sp-dev-fx-controls-react/pull/1588)
12+
- `FieldCollectionData`: added date field control and updated number field [#1600](https://github.com/pnp/sp-dev-fx-controls-react/pull/1600)
13+
14+
### Fixes
15+
16+
- `AccessibleAccordion`: fix typo in documentation [#1634](https://github.com/pnp/sp-dev-fx-controls-react/pull/1634)
17+
- `DynamicForm`: fix issue with MultiChoice field [#1510](https://github.com/pnp/sp-dev-fx-controls-react/issues/1510)
18+
- `Localization`: Update dutch translations [#1635](https://github.com/pnp/sp-dev-fx-controls-react/issues/1635)
19+
- `TaxonomyPicker`: suggested item contains double termset name [#1597](https://github.com/pnp/sp-dev-fx-controls-react/issues/1597)
20+
- `DynamicForm`: DynamicForm does not properly handle NULL default values for Taxonomy fields [#1267](https://github.com/pnp/sp-dev-fx-controls-react/issues/1267)
21+
- `DynamicForm`: DynamicForm errors when submitting blank Taxonomy field values [#1268](https://github.com/pnp/sp-dev-fx-controls-react/issues/1268)
22+
23+
### Contributors
24+
25+
Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Michaël Maillot](https://github.com/michaelmaillot), [Nils Andresen](https://github.com/nils-a), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [Rico van de Ven](https://github.com/RicoNL), [wuxiaojun514](https://github.com/wuxiaojun514).
26+
327
## 3.15.0
428

529
### New control(s)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Please use following logic on submitting your questions or issues to right locat
1515
* You have general question or challenge with SPFx - use [sp-dev-docs repository issue list](https://github.com/sharepoint/sp-dev-docs/issues).
1616
* You have issue on specific controls in this package - use [issue list in this repository](https://github.com/pnp/sp-dev-fx-controls-react/issues).
1717

18-
1918
## Contributing
2019

2120
We'd love your help! If you have ideas for new features or feedback, let us know by creating an issue in the [issues list](https://github.com/pnp/sp-dev-fx-controls-react/issues). Before you submit a PR with your improvements, please review our [project guides](https://pnp.github.io/sp-dev-fx-controls-react/guides).

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.16.0
4+
5+
### New control(s)
6+
7+
- `ViewPicker`: new control ViewPicker [#1439](https://github.com/pnp/sp-dev-fx-controls-react/issues/1439)
8+
9+
### Enhancements
10+
11+
- `FieldCollectionData`: render on page instead of panel and added combobox and peoplepicker controls [#1588](https://github.com/pnp/sp-dev-fx-controls-react/pull/1588)
12+
- `FieldCollectionData`: added date field control and updated number field [#1600](https://github.com/pnp/sp-dev-fx-controls-react/pull/1600)
13+
14+
### Fixes
15+
16+
- `AccessibleAccordion`: fix typo in documentation [#1634](https://github.com/pnp/sp-dev-fx-controls-react/pull/1634)
17+
- `DynamicForm`: fix issue with MultiChoice field [#1510](https://github.com/pnp/sp-dev-fx-controls-react/issues/1510)
18+
- `Localization`: Update dutch translations [#1635](https://github.com/pnp/sp-dev-fx-controls-react/issues/1635)
19+
- `TaxonomyPicker`: suggested item contains double termset name [#1597](https://github.com/pnp/sp-dev-fx-controls-react/issues/1597)
20+
- `DynamicForm`: DynamicForm does not properly handle NULL default values for Taxonomy fields [#1267](https://github.com/pnp/sp-dev-fx-controls-react/issues/1267)
21+
- `DynamicForm`: DynamicForm errors when submitting blank Taxonomy field values [#1268](https://github.com/pnp/sp-dev-fx-controls-react/issues/1268)
22+
23+
### Contributors
24+
25+
Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Michaël Maillot](https://github.com/michaelmaillot), [Nils Andresen](https://github.com/nils-a), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [Rico van de Ven](https://github.com/RicoNL), [wuxiaojun514](https://github.com/wuxiaojun514).
26+
327
## 3.15.0
428

529
### New control(s)

src/common/telemetry/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version: string = "3.15.0";
1+
export const version: string = "3.16.0";

src/controls/dynamicForm/DynamicForm.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ export class DynamicForm extends React.Component<
255255
} else if (fieldType === "TaxonomyFieldType") {
256256
objects[columnInternalName] = {
257257
__metadata: { type: "SP.Taxonomy.TaxonomyFieldValue" },
258-
Label: value[0].name,
259-
TermGuid: value[0].key,
258+
Label: value[0]?.name ?? "",
259+
TermGuid: value[0]?.key ?? "11111111-1111-1111-1111-111111111111",
260260
WssId: "-1",
261261
};
262262
} else if (fieldType === "TaxonomyFieldTypeMulti") {
@@ -287,7 +287,8 @@ export class DynamicForm extends React.Component<
287287
} else {
288288
objects[columnInternalName] = null;
289289
}
290-
} else {
290+
}
291+
else {
291292
objects[columnInternalName] = val.newValue;
292293
}
293294
}
@@ -332,10 +333,14 @@ export class DynamicForm extends React.Component<
332333
else if (
333334
contentTypeId === undefined ||
334335
contentTypeId === "" ||
335-
!contentTypeId.startsWith("0x0120")
336+
!contentTypeId.startsWith("0x0120")||
337+
contentTypeId.startsWith("0x01")
336338
) {
337339
// We are adding a new list item
338340
try {
341+
const contentTypeIdField = "ContentTypeId";
342+
//check if item contenttype is passed, then update the object with content type id, else, pass the object
343+
contentTypeId !== undefined && contentTypeId.startsWith("0x01") ? objects[contentTypeIdField] = contentTypeId : objects;
339344
const iar = await sp.web.lists.getById(listId).items.add(objects);
340345
if (onSubmitted) {
341346
onSubmitted(
@@ -351,7 +356,8 @@ export class DynamicForm extends React.Component<
351356
}
352357
console.log("Error", error);
353358
}
354-
} else if (contentTypeId.startsWith("0x0120")) {
359+
}
360+
else if (contentTypeId.startsWith("0x0120")) {
355361
// We are adding a folder or a Document Set
356362
try {
357363
const idField = "ID";
@@ -414,6 +420,7 @@ export class DynamicForm extends React.Component<
414420
// trigger when the user change any value in the form
415421
private onChange = async (
416422
internalName: string,
423+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
417424
newValue: any,
418425
additionalData?: FieldChangeAdditionalData
419426
): Promise<void> => {
@@ -774,6 +781,7 @@ export class DynamicForm extends React.Component<
774781
listId: string,
775782
contentTypeId: string | undefined,
776783
webUrl?: string
784+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
777785
): Promise<any> => {
778786
// eslint-disable-line @typescript-eslint/no-explicit-any
779787
try {

src/controls/fieldCollectionData/ICustomCollectionField.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ export enum CustomCollectionFieldType {
9797
peoplepicker,
9898
fabricIcon,
9999
url,
100+
date,
100101
custom
101102
}

src/controls/fieldCollectionData/collectionDataItem/CollectionDataItem.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { PeoplePicker, PrincipalType } from "../../peoplepicker";
1414
import { Callout, DirectionalHint } from 'office-ui-fabric-react/lib/components/Callout';
1515
import { CollectionIconField } from '../collectionIconField';
1616
import { clone, findIndex, sortBy } from '@microsoft/sp-lodash-subset';
17-
import { CollectionNumberField } from '../collectionNumberField';
1817
import { Guid } from '@microsoft/sp-core-library';
1918
import { FieldValidator } from '../FieldValidator';
19+
import { DatePicker } from 'office-ui-fabric-react/lib/DatePicker';
2020
import { IPersonaProps } from 'office-ui-fabric-react/lib/Persona';
2121

2222
export class CollectionDataItem extends React.Component<ICollectionDataItemProps, ICollectionDataItemState> {
@@ -487,9 +487,16 @@ export class CollectionDataItem extends React.Component<ICollectionDataItemProps
487487
onRenderOption={field.onRenderOption}
488488
className="PropertyFieldCollectionData__panel__dropdown-field" />;
489489
case CustomCollectionFieldType.number:
490-
return (
491-
<CollectionNumberField field={field} item={item} disableEdit={disableFieldOnEdit} fOnValueChange={this.onValueChanged} fValidation={this.fieldValidation} />
492-
);
490+
return <TextField placeholder={field.placeholder || field.title}
491+
className={styles.collectionDataField}
492+
value={item[field.id] ? item[field.id] : ""}
493+
required={field.required}
494+
disabled={disableFieldOnEdit}
495+
type='number'
496+
onChange={(e, value) => this.onValueChanged(field.id, value)}
497+
deferredValidationTime={field.deferredValidationTime || field.deferredValidationTime >= 0 ? field.deferredValidationTime : 200}
498+
onGetErrorMessage={async (value: string) => await this.fieldValidation(field, value)}
499+
inputClassName="PropertyFieldCollectionData__panel__number-field" />;
493500
case CustomCollectionFieldType.fabricIcon:
494501
return (
495502
<CollectionIconField field={field} item={item} disableEdit={disableFieldOnEdit} fOnValueChange={this.onValueChanged} fValidation={this.fieldValidation} />
@@ -504,6 +511,16 @@ export class CollectionDataItem extends React.Component<ICollectionDataItemProps
504511
deferredValidationTime={field.deferredValidationTime || field.deferredValidationTime >= 0 ? field.deferredValidationTime : 200}
505512
onGetErrorMessage={async (value: string) => this.urlFieldValidation(field, value, item)}
506513
inputClassName="PropertyFieldCollectionData__panel__url-field" />;
514+
case CustomCollectionFieldType.date:
515+
return <DatePicker
516+
className={styles.collectionDataField}
517+
placeholder={field.placeholder || field.title}
518+
isRequired={field.required}
519+
disabled={disableFieldOnEdit}
520+
value={item[field.id] ? new Date(item[field.id]) : undefined}
521+
onSelectDate={(date) => { this.onValueChanged(field.id, date) }}
522+
formatDate={(date) => { return date ? date?.toLocaleDateString() : ""; }}
523+
/>;
507524
case CustomCollectionFieldType.custom:
508525
if (field.onCustomRender) {
509526
return field.onCustomRender(field, item[field.id], this.onValueChanged, item, item.uniqueId, this.onCustomFieldValidation);

src/controls/fieldCollectionData/collectionNumberField/CollectionNumberField.tsx

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/controls/fieldCollectionData/collectionNumberField/ICollectionNumberFieldProps.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)