Skip to content

Commit 7808818

Browse files
committed
Small updates
1 parent fc08a7f commit 7808818

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

src/controls/filePicker/FilePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { IFilePickerProps } from './IFilePickerProps';
33
import { IFilePickerState } from './IFilePickerState';
44

5-
import { PrimaryButton, IconButton, ActionButton } from 'office-ui-fabric-react/lib/components/Button';
5+
import { PrimaryButton, ActionButton } from 'office-ui-fabric-react/lib/components/Button';
66
import { Panel, PanelType } from 'office-ui-fabric-react/lib/components/Panel';
77
import { Label } from 'office-ui-fabric-react/lib/components/Label';
88
import { Nav, INavLink, INavLinkGroup } from 'office-ui-fabric-react/lib/Nav';
@@ -36,7 +36,7 @@ export class FilePicker extends React.Component<IFilePickerProps, IFilePickerSta
3636
constructor(props: IFilePickerProps) {
3737
super(props);
3838

39-
telemetry.track('FilePicker', {});
39+
telemetry.track('ReactFilePicker', {});
4040

4141
// Initialize file browser services
4242
this.fileBrowserService = new FileBrowserService(props.webPartContext, this.props.itemsCountQueryLimit);

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,26 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
402402
<Link href="https://sharepoint.github.io/sp-dev-fx-controls-react/">See all</Link>
403403
} />
404404

405+
406+
407+
<div>
408+
<FilePicker
409+
bingAPIKey="<BING API KEY>"
410+
accepts={[".gif", ".jpg", ".jpeg", ".bmp", ".dib", ".tif", ".tiff", ".ico", ".png", ".jxr", ".svg"]}
411+
buttonLabel="Upload image"
412+
buttonIcon="FileImage"
413+
onSave={(filePickerResult: IFilePickerResult) => { this.setState({ filePickerResult }); }}
414+
onChanged={(filePickerResult: IFilePickerResult) => { this.setState({ filePickerResult }); }}
415+
webPartContext={this.props.context}
416+
/>
417+
{
418+
this.state.filePickerResult &&
419+
<div>
420+
FileName: {this.state.filePickerResult.fileName}
421+
</div>
422+
}
423+
</div>
424+
405425
<DateTimePicker label="DateTime Picker (unspecified = date and time)" isMonthPickerVisible={false} showSeconds={false} onChange={(value) => console.log("DateTimePicker value:", value)} />
406426
<DateTimePicker label="DateTime Picker (unspecified = date and time)" showSeconds={true} onChange={(value) => console.log("DateTimePicker value:", value)} />
407427
<DateTimePicker label="DateTime Picker (unspecified = date and time)" timeConvention={TimeConvention.Hours24} onChange={(value) => console.log("DateTimePicker value:", value)} />
@@ -801,24 +821,6 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
801821
<SiteBreadcrumb context={this.props.context} />
802822
</div>
803823

804-
<div>
805-
<FilePicker
806-
bingAPIKey="<BING API KEY>"
807-
accepts={[".gif", ".jpg", ".jpeg", ".bmp", ".dib", ".tif", ".tiff", ".ico", ".png", ".jxr", ".svg"]}
808-
buttonLabel="Upload image"
809-
buttonIcon="FileImage"
810-
onSave={(filePickerResult: IFilePickerResult) => { this.setState({ filePickerResult }); }}
811-
onChanged={(filePickerResult: IFilePickerResult) => { this.setState({ filePickerResult }); }}
812-
webPartContext={this.props.context}
813-
/>
814-
{
815-
this.state.filePickerResult &&
816-
<div>
817-
FileName: {this.state.filePickerResult.fileName}
818-
</div>
819-
}
820-
</div>
821-
822824
<p><a href="javascript:;" onClick={this.deleteItem}>Deletes second item</a></p>
823825
<div>
824826
<Progress title={'Progress Test'}

0 commit comments

Comments
 (0)