@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
import { IFilePickerProps } from './IFilePickerProps' ;
3
3
import { IFilePickerState } from './IFilePickerState' ;
4
4
5
- import { PrimaryButton , ActionButton } from 'office-ui-fabric-react/lib/components/Button' ;
5
+ import { PrimaryButton , ActionButton } from 'office-ui-fabric-react/lib/components/Button' ;
6
6
import { Panel , PanelType } from 'office-ui-fabric-react/lib/components/Panel' ;
7
7
import { Label } from 'office-ui-fabric-react/lib/components/Label' ;
8
8
import { Nav , INavLink , INavLinkGroup } from 'office-ui-fabric-react/lib/Nav' ;
@@ -54,19 +54,22 @@ export class FilePicker extends React.Component<IFilePickerProps, IFilePickerSta
54
54
55
55
public async componentDidMount ( ) {
56
56
// Load information about Organisation Assets Library
57
- const orgAssetsLibraries = await this . orgAssetsService . getSiteMediaLibraries ( ) ;
58
- const organisationAssetsEnabled = orgAssetsLibraries ? true : false ;
57
+ let orgAssetsEnabled : boolean = false ;
58
+ if ( this . props . hideOrganisationalAssetTab != undefined && ! this . props . hideOrganisationalAssetTab ) {
59
+ const orgAssetsLibraries = await this . orgAssetsService . getSiteMediaLibraries ( ) ;
60
+ orgAssetsEnabled = orgAssetsLibraries ? true : false ;
61
+ }
59
62
60
63
this . setState ( {
61
- organisationAssetsEnabled
64
+ organisationAssetsEnabled : orgAssetsEnabled
62
65
} ) ;
63
66
}
64
67
65
68
public render ( ) : JSX . Element {
66
69
// If no acceptable file type was passed, and we're expecting images, set the default image filter
67
70
const accepts : string [ ] = this . props . accepts ;
68
- const buttonClassName : string = this . props . buttonClassName ? this . props . buttonClassName : '' ;
69
- const panelClassName : string = this . props . panelClassName ? this . props . panelClassName : '' ;
71
+ const buttonClassName : string = this . props . buttonClassName ? this . props . buttonClassName : '' ;
72
+ const panelClassName : string = this . props . panelClassName ? this . props . panelClassName : '' ;
70
73
71
74
const linkTabProps = {
72
75
accepts : accepts ,
@@ -281,7 +284,7 @@ export class FilePicker extends React.Component<IFilePickerProps, IFilePickerSta
281
284
} ) ;
282
285
}
283
286
284
- let groups : INavLinkGroup [ ] = [ { links} ] ;
287
+ let groups : INavLinkGroup [ ] = [ { links } ] ;
285
288
return groups ;
286
289
}
287
290
0 commit comments