Skip to content

Commit

Permalink
Merge branch 'pnp:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
IRRDC authored Feb 7, 2024
2 parents 7f77c2b + dd5e8fc commit a089158
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 33 deletions.
26 changes: 25 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"versions": [
{
"version": "3.18.0",
"changes": {
"new": [],
"enhancements": [],
"fixes": []
},
"contributions": []
},
{
"version": "3.17.0",
"changes":{
Expand All @@ -13,17 +22,32 @@
"fixes": [
"Build fails due to missing @iconify/react dependency after upgrade to 3.16.0 [#1719](https://github.com/pnp/sp-dev-fx-controls-react/issues/1719)",
"`ModernTaxonomyPicker`: not displaying suggestions when typing in values - API not found error [#1688](https://github.com/pnp/sp-dev-fx-controls-react/issues/1688)",
"`DynamicForm`: Disable issue on fieldOverrides field control when onBeforeSubmit return true [#1715](https://github.com/pnp/sp-dev-fx-controls-react/issues/1715)"
"`DynamicForm`: Disable issue on fieldOverrides field control when onBeforeSubmit return true [#1715](https://github.com/pnp/sp-dev-fx-controls-react/issues/1715)",
"`PeoplePicker`: PeoplePicker returns no results with webAbsoluteUrl and ensureUser [#1669](https://github.com/pnp/sp-dev-fx-controls-react/issues/1669)",
"`DynamicForm`: [DynamicForm] Fixing multi taxonomy field (loading + saving existing item) [#1739](https://github.com/pnp/sp-dev-fx-controls-react/pull/1739)"
]
},
"contributions": [
"[Guido Zambarda](https://github.com/GuidoZam)",
"[Lars Fernhomberg](https://github.com/lafe)",
"[Mark Bice](https://github.com/mbice)",
"[Michaël Maillot](https://github.com/michaelmaillot)",
"[Nishkalank Bezawada](https://github.com/NishkalankBezawada)",
"[Tom G](https://github.com/t0mgerman)",
"[wuxiaojun514](https://github.com/wuxiaojun514)"
]
},
{
"version": "3.16.2",
"changes": {
"fixes": [
"`DynamicForm`: Fixing the previous version's issue [#1736](https://github.com/pnp/sp-dev-fx-controls-react/pull/1736) (introduced in [#1718](https://github.com/pnp/sp-dev-fx-controls-react/pull/1718))"
]
},
"contributions": [
"[IRRDC](https://github.com/IRRDC)"
]
},
{
"version": "3.16.1",
"changes": {
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# Releases

## 3.18.0

## 3.17.0

### Enhancements

- `DyanmicForm`: Added file handling [#1625](https://github.com/pnp/sp-dev-fx-controls-react/pull/1625)
- `DynamicForm`: Custom Formatting and Validation, ControlsTestWebPart updates [#1672](https://github.com/pnp/sp-dev-fx-controls-react/pull/1672)
- `PeoplePicker `: Added custom filter to PeoplePicker selection [#1657](https://github.com/pnp/sp-dev-fx-controls-react/issues/1657)
- `PeoplePicker`: Added custom filter to PeoplePicker selection [#1657](https://github.com/pnp/sp-dev-fx-controls-react/issues/1657)
- `RichText`: Align RichText heading styles and font sizes with OOB SharePoint text web part [#1706](https://github.com/pnp/sp-dev-fx-controls-react/pull/1706)

### Fixes

- Build fails due to missing @iconify/react dependency after upgrade to 3.16.0 [#1719](https://github.com/pnp/sp-dev-fx-controls-react/issues/1719)
- `ModernTaxonomyPicker`: not displaying suggestions when typing in values - API not found error [#1688](https://github.com/pnp/sp-dev-fx-controls-react/issues/1688)
- `DynamicForm`: Disable issue on fieldOverrides field control when onBeforeSubmit return true [#1715](https://github.com/pnp/sp-dev-fx-controls-react/issues/1715)
- `PeoplePicker`: PeoplePicker returns no results with webAbsoluteUrl and ensureUser [#1669](https://github.com/pnp/sp-dev-fx-controls-react/issues/1669)
- `DynamicForm`: [DynamicForm] Fixing multi taxonomy field (loading + saving existing item) [#1739](https://github.com/pnp/sp-dev-fx-controls-react/pull/1739)

### Contributors

Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Tom G](https://github.com/t0mgerman).
Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Lars Fernhomberg](https://github.com/lafe), [Mark Bice](https://github.com/mbice), [Michaël Maillot](https://github.com/michaelmaillot), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [Tom G](https://github.com/t0mgerman), [wuxiaojun514](https://github.com/wuxiaojun514).

## 3.16.2

### Fixes

- `DynamicForm`: Fixing the previous version's issue [#1736](https://github.com/pnp/sp-dev-fx-controls-react/pull/1736) (introduced in [#1718](https://github.com/pnp/sp-dev-fx-controls-react/pull/1718))

### Contributors

Special thanks to our contributor: [IRRDC](https://github.com/IRRDC).

## 3.16.1

Expand Down
21 changes: 19 additions & 2 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# Releases

## 3.18.0

## 3.17.0

### Enhancements

- `DyanmicForm`: Added file handling [#1625](https://github.com/pnp/sp-dev-fx-controls-react/pull/1625)
- `DynamicForm`: Custom Formatting and Validation, ControlsTestWebPart updates [#1672](https://github.com/pnp/sp-dev-fx-controls-react/pull/1672)
- `PeoplePicker `: Added custom filter to PeoplePicker selection [#1657](https://github.com/pnp/sp-dev-fx-controls-react/issues/1657)
- `PeoplePicker`: Added custom filter to PeoplePicker selection [#1657](https://github.com/pnp/sp-dev-fx-controls-react/issues/1657)
- `RichText`: Align RichText heading styles and font sizes with OOB SharePoint text web part [#1706](https://github.com/pnp/sp-dev-fx-controls-react/pull/1706)

### Fixes

- Build fails due to missing @iconify/react dependency after upgrade to 3.16.0 [#1719](https://github.com/pnp/sp-dev-fx-controls-react/issues/1719)
- `ModernTaxonomyPicker`: not displaying suggestions when typing in values - API not found error [#1688](https://github.com/pnp/sp-dev-fx-controls-react/issues/1688)
- `DynamicForm`: Disable issue on fieldOverrides field control when onBeforeSubmit return true [#1715](https://github.com/pnp/sp-dev-fx-controls-react/issues/1715)
- `PeoplePicker`: PeoplePicker returns no results with webAbsoluteUrl and ensureUser [#1669](https://github.com/pnp/sp-dev-fx-controls-react/issues/1669)
- `DynamicForm`: [DynamicForm] Fixing multi taxonomy field (loading + saving existing item) [#1739](https://github.com/pnp/sp-dev-fx-controls-react/pull/1739)

### Contributors

Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Tom G](https://github.com/t0mgerman).
Special thanks to our contributors (in alphabetical order): [Guido Zambarda](https://github.com/GuidoZam), [Lars Fernhomberg](https://github.com/lafe), [Mark Bice](https://github.com/mbice), [Michaël Maillot](https://github.com/michaelmaillot), [Nishkalank Bezawada](https://github.com/NishkalankBezawada), [Tom G](https://github.com/t0mgerman), [wuxiaojun514](https://github.com/wuxiaojun514).

## 3.16.2

### Fixes

- `DynamicForm`: Fixing the previous version's issue [#1736](https://github.com/pnp/sp-dev-fx-controls-react/pull/1736) (introduced in [#1718](https://github.com/pnp/sp-dev-fx-controls-react/pull/1718))

### Contributors

Special thanks to our contributor: [IRRDC](https://github.com/IRRDC).

## 3.16.1

Expand Down
10 changes: 4 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pnp/spfx-controls-react",
"description": "Reusable React controls for SharePoint Framework solutions",
"version": "3.17.0",
"version": "3.18.0",
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0",
"scripts": {
"build": "gulp build",
Expand Down
2 changes: 1 addition & 1 deletion src/common/telemetry/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version: string = "3.17.0";
export const version: string = "3.18.0";
40 changes: 20 additions & 20 deletions src/controls/dynamicForm/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class DynamicForm extends React.Component<
*/
public render(): JSX.Element {
const { customFormatting, fieldCollection, hiddenByFormula, infoErrorMessages, isSaving } = this.state;

const customFormattingDisabled = this.props.useCustomFormatting === false;

// Custom Formatting - Header
Expand Down Expand Up @@ -177,7 +177,7 @@ export class DynamicForm extends React.Component<
footerContent = this._customFormatter.renderCustomFormatContent(customFormatting.footer, this.getFormValuesForValidation(), true) as JSX.Element;
}

// Content Type
// Content Type
let contentTypeId = this.props.contentTypeId;
if (this.state.contentTypeId !== undefined) contentTypeId = this.state.contentTypeId;

Expand Down Expand Up @@ -300,7 +300,7 @@ export class DynamicForm extends React.Component<
);
}

private updateFormMessages(type: MessageBarType, message: string): void {
private updateFormMessages(type: MessageBarType, message: string): void {
const { infoErrorMessages } = this.state;
const newMessages = infoErrorMessages.slice();
newMessages.push({ type, message });
Expand All @@ -319,7 +319,7 @@ export class DynamicForm extends React.Component<
validationErrorDialogProps,
returnListItemInstanceOnSubmit
} = this.props;

let contentTypeId = this.props.contentTypeId;
if (this.state.contentTypeId !== undefined) contentTypeId = this.state.contentTypeId;

Expand Down Expand Up @@ -414,7 +414,7 @@ export class DynamicForm extends React.Component<
if (field.newValue !== null && field.newValue !== undefined) {

let value = field.newValue;
if (["Lookup", "LookupMulti", "User", "UserMulti"].indexOf(fieldType) < 0) {
if (["Lookup", "LookupMulti", "User", "UserMulti", "TaxonomyFieldTypeMulti"].indexOf(fieldType) < 0) {
objects[columnInternalName] = value;
}

Expand Down Expand Up @@ -490,7 +490,7 @@ export class DynamicForm extends React.Component<
} else {
objects[columnInternalName] = null;
}
}
}
}
}

Expand Down Expand Up @@ -614,7 +614,7 @@ export class DynamicForm extends React.Component<
}
console.log("Error", error);
}
}
}

this.setState({
isSaving: false,
Expand Down Expand Up @@ -645,7 +645,7 @@ export class DynamicForm extends React.Component<
returnListItemInstanceOnSubmit
} = this.props;


if (selectedFile !== undefined) {
try {
const idField = "ID";
Expand All @@ -659,14 +659,14 @@ export class DynamicForm extends React.Component<
"_"
) // Replace not allowed chars in folder name
: ""; // Empty string will be replaced by SPO with Folder Item ID

const fileCreatedResult = await library.rootFolder.files.addChunked(encodeURI(itemTitle), await selectedFile.downloadFileContent());
const fields = await fileCreatedResult.file.listItemAllFields();

if (fields[idField]) {
// Read the ID of the just created folder or Document Set
const folderId = fields[idField];

// Set the content type ID for the target item
objects[contentTypeIdField] = contentTypeId;
// Update the just created folder or Document Set
Expand Down Expand Up @@ -783,7 +783,7 @@ export class DynamicForm extends React.Component<
fieldCollection: fieldCol,
validationErrors
}, () => {
if (validate) this.performValidation();
if (validate) this.performValidation();
});
};

Expand Down Expand Up @@ -820,7 +820,7 @@ export class DynamicForm extends React.Component<
* @param formulas A Record / dictionary-like object, where key is internal column name and value is an object with ValidationFormula and ValidationMessage properties
* @param returnMessages Determines whether a Record of error messages is returned or an array of column names that have failed validation
* @param requireValue Set to true if the formula should only be evaluated when the field has a value
* @returns
* @returns
*/
private evaluateFormulas = (
formulas: Record<string, Pick<ISPField, "ValidationFormula" | "ValidationMessage">>,
Expand Down Expand Up @@ -852,12 +852,12 @@ export class DynamicForm extends React.Component<
}

/**
* Used for validation. Returns a Record of field values, where key is internal column name and value is the field value.
* Used for validation. Returns a Record of field values, where key is internal column name and value is the field value.
* Expands certain properties and stores many of them as primitives (strings, numbers or bools) so the expression evaluator
* can process them. For example: a User column named Person will have values stored as Person, Person.email, Person.title etc.
* This is so the expression evaluator can process expressions like '=[$Person.title] == "Contoso Employee 1138"'
* This is so the expression evaluator can process expressions like '=[$Person.title] == "Contoso Employee 1138"'
* @param fieldCollection Optional. Could be used to compare field values in state with previous state.
* @returns
* @returns
*/
private getFormValuesForValidation = (fieldCollection?: IDynamicFieldProps[]): Context => {
const { fieldCollection: fieldColFromState } = this.state;
Expand Down Expand Up @@ -911,7 +911,7 @@ export class DynamicForm extends React.Component<
onListItemLoaded,
} = this.props;
let contentTypeId = this.props.contentTypeId;

try {

// Fetch form rendering information from SharePoint
Expand Down Expand Up @@ -992,7 +992,7 @@ export class DynamicForm extends React.Component<
// Get installed languages for Currency fields
let installedLanguages: IInstalledLanguageInfo[];
if (tempFields.filter(f => f.fieldType === "Currency").length > 0) {
installedLanguages = await sp.web.regionalSettings.getInstalledLanguages();
installedLanguages = await sp.web.regionalSettings.getInstalledLanguages();
}

this.setState({
Expand Down Expand Up @@ -1025,7 +1025,7 @@ export class DynamicForm extends React.Component<
* @param listId SharePoint List ID
* @param listItemId SharePoint List Item ID
* @param disabledFields Fields that should be disabled due to configuration
* @returns
* @returns
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private async buildFieldCollection(listInfo: IRenderListDataAsStreamClientFormResult, contentTypeName: string, item: any, numberFields: ISPField[], listId: string, listItemId: number, disabledFields: string[]): Promise<IDynamicFieldProps[]> {
Expand Down Expand Up @@ -1203,7 +1203,7 @@ export class DynamicForm extends React.Component<
});
});

defaultValue = selectedTags;
value = selectedTags;
} else {
if (defaultValue && defaultValue !== "") {
defaultValue.split(/#|;/).forEach((element) => {
Expand Down
3 changes: 3 additions & 0 deletions src/services/PeopleSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ export default class SPPeopleSearchService {
if (userIdx !== -1) {
return users[userIdx].Id;
}
} //initialize the array if it doesnt exist with the siteUrl
else if(!this.cachedLocalUsers[siteUrl]) {
this.cachedLocalUsers[siteUrl] = [];
}

const restApi = `${siteUrl}/_api/web/ensureuser`;
Expand Down

0 comments on commit a089158

Please sign in to comment.