Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into dev
  • Loading branch information
joelfmrodrigues committed Feb 6, 2024
2 parents 3d7c7de + 8893c3c commit 289b059
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 19 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
"[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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@

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

### Fixes
Expand Down
10 changes: 10 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@

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

### Fixes
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.17.0";
36 changes: 18 additions & 18 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 @@ -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

0 comments on commit 289b059

Please sign in to comment.