Skip to content

Commit ce500e2

Browse files
committed
ControlsTest Updated for FieldCollectionData chges
1 parent 68a4b1d commit ce500e2

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/webparts/controlsTest/components/ControlsTest.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ $themePrimary: '[theme:themePrimary, default:#0078d7]';
22

33
.controlsTest {
44
.container {
5-
max-width: 700px;
5+
max-width: 1200px;
66
margin: 0px auto 20px auto;
77
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1);
88
}

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,8 +2040,26 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
20402040
{ id: "Field2", title: "Number field", type: CustomCollectionFieldType.number },
20412041
{ id: "Field3", title: "URL field", type: CustomCollectionFieldType.url },
20422042
{ id: "Field4", title: "Boolean field", type: CustomCollectionFieldType.boolean },
2043+
{
2044+
id: "Field5", title: "People picker", type: CustomCollectionFieldType.peoplepicker, required: true,
2045+
minimumUsers: 2, minimumUsersMessage: "2 Users is the minimum", maximumUsers: 3,
2046+
},
2047+
{
2048+
id: "Field6", title: "Combo Single", type: CustomCollectionFieldType.combobox, required: true,
2049+
multiSelect: false, options: [{key: "choice 1", text: "choice 1"}, {key: "choice 2", text: "choice 2"}, {key: "choice 3", text: "choice 3"}]
2050+
},
2051+
{
2052+
id: "Field7", title: "Combo Multi", type: CustomCollectionFieldType.combobox,
2053+
allowFreeform: true, multiSelect: true, options: [{key: "choice 1", text: "choice 1"}, {key: "choice 2", text: "choice 2"}, {key: "choice 3", text: "choice 3"}]
2054+
},
2055+
20432056
]}
20442057
value={this.getRandomCollectionFieldData()}
2058+
2059+
// value = {null}
2060+
context={this.props.context as any} //error when this is omitted and people picker is used
2061+
usePanel={true}
2062+
noDataMessage="No data is selected" //overrides the default message
20452063
/>
20462064
</div>
20472065
<div id="DashboardDiv" className={styles.container} hidden={!isDashboardDivVisible}>
@@ -2635,7 +2653,15 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
26352653
private getRandomCollectionFieldData = () => {
26362654
let result = [];
26372655
for (let i = 1; i < 16; i++) {
2638-
result.push({ "Field1": `String${i}`, "Field2": i, "Field3": "https://pnp.github.io/", "Field4": true });
2656+
result.push({
2657+
"Field1": `String${i}`,
2658+
"Field2": i,
2659+
"Field3": "https://pnp.github.io/",
2660+
"Field4": true,
2661+
"Field5": null,
2662+
"Field6": {key: "choice 1", text: "choice 1"},
2663+
"Field7": [{key: "choice 1", text: "choice 1"}, {key: "choice 2", text: "choice 2"}]
2664+
});
26392665
}
26402666
return result;
26412667
}

0 commit comments

Comments
 (0)