@@ -17,6 +17,7 @@ import { IFrameDialog } from '../../../IFrameDialog';
17
17
import { Environment , EnvironmentType } from '@microsoft/sp-core-library' ;
18
18
import { SecurityTrimmedControl , PermissionLevel } from '../../../SecurityTrimmedControl' ;
19
19
import { SPPermission } from '@microsoft/sp-page-context' ;
20
+ import { PeoplePicker } from '../../../PeoplePicker' ;
20
21
21
22
/**
22
23
* Component that can be used to test out the React controls from this project
@@ -39,8 +40,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
39
40
* React componentDidMount lifecycle hook
40
41
*/
41
42
public componentDidMount ( ) {
42
- //const restApi = `${this.props.context.pageContext.web.absoluteUrl}/_api/web/GetFolderByServerRelativeUrl('Shared%20Documents')/files?$expand=ListItemAllFields`;
43
- const restApi = `${ this . props . context . pageContext . web . absoluteUrl } /_api/web/lists(guid'40e24fbb-120a-4651-9dc2-34700a58297b')/items` ;
43
+ const restApi = `${ this . props . context . pageContext . web . absoluteUrl } /_api/web/GetFolderByServerRelativeUrl('Shared%20Documents')/files?$expand=ListItemAllFields` ;
44
44
this . props . context . spHttpClient . get ( restApi , SPHttpClient . configurations . v1 )
45
45
. then ( resp => { return resp . json ( ) ; } )
46
46
. then ( items => {
@@ -133,53 +133,22 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
133
133
}
134
134
] ;
135
135
136
- // // Specify the fields that need to be viewed in the listview
137
- // const viewFields: IViewField[] = [
138
- // {
139
- // name: 'ListItemAllFields.Id',
140
- // displayName: 'ID',
141
- // maxWidth: 40,
142
- // sorting: true
143
- // },
144
- // {
145
- // name: 'ListItemAllFields.Underscore_Field',
146
- // displayName: "Underscore_Field",
147
- // sorting: true
148
- // },
149
- // {
150
- // name: 'Name',
151
- // linkPropertyName: 'ServerRelativeUrl',
152
- // sorting: true
153
- // },
154
- // {
155
- // name: 'ServerRelativeUrl',
156
- // displayName: 'Path',
157
- // render: (item: any) => {
158
- // return <a href={item['ServerRelativeUrl']}>Link</a>;
159
- // }
160
- // },
161
- // {
162
- // name: 'Title'
163
- // }
164
- // ];
165
-
166
136
// Specify the fields that need to be viewed in the listview
167
137
const viewFields : IViewField [ ] = [
168
138
{
169
- name : 'Id' ,
139
+ name : 'ListItemAllFields. Id' ,
170
140
displayName : 'ID' ,
171
141
maxWidth : 40 ,
172
142
sorting : true
173
143
} ,
174
144
{
175
- name : 'Students_x0020_Strength ' ,
176
- displayName : "Students Strength " ,
145
+ name : 'ListItemAllFields.Underscore_Field ' ,
146
+ displayName : "Underscore_Field " ,
177
147
sorting : true
178
148
} ,
179
149
{
180
- name : 'Training_x0020_site.Description' ,
181
- linkPropertyName : 'Training_x0020_site.Url' ,
182
- displayName : 'Training Site' ,
150
+ name : 'Name' ,
151
+ linkPropertyName : 'ServerRelativeUrl' ,
183
152
sorting : true
184
153
} ,
185
154
{
@@ -310,9 +279,9 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
310
279
selectionMode = { SelectionMode . multiple }
311
280
selection = { this . _getSelection } />
312
281
313
- < p > < a href = "javascript:;" onClick = { this . deleteItem } > Deletes second item</ a > </ p >
282
+ < p > < a href = "javascript:;" onClick = { this . deleteItem } > Deletes second item</ a > </ p >
314
283
315
- < SPPeoplePicker
284
+ < PeoplePicker
316
285
context = { this . props . context }
317
286
titleText = "People Picker"
318
287
getAllUsers = { false }
0 commit comments