updated comments
This commit is contained in:
parent
e42a0a5d69
commit
c72d4351b0
|
@ -109,7 +109,7 @@ export default class OrganisationChart extends React.Component<IOrganisationChar
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getUserProperties(): void {
|
private _getUserProperties(): void {
|
||||||
//Get hold of the webpart's service scope object
|
|
||||||
let serviceScope: ServiceScope;
|
let serviceScope: ServiceScope;
|
||||||
const userProfileServiceKey: ServiceKey<IUserProfileService> = ServiceKey.create<IUserProfileService>("userprofileservicekey", UserProfileService);
|
const userProfileServiceKey: ServiceKey<IUserProfileService> = ServiceKey.create<IUserProfileService>("userprofileservicekey", UserProfileService);
|
||||||
let userProfileServiceInstance: IUserProfileService;
|
let userProfileServiceInstance: IUserProfileService;
|
||||||
|
@ -117,13 +117,14 @@ export default class OrganisationChart extends React.Component<IOrganisationChar
|
||||||
// Based on the type of environment, return the correct instance of the IUserProfileService interface
|
// Based on the type of environment, return the correct instance of the IUserProfileService interface
|
||||||
const currentEnvType = this.props.environmentType;
|
const currentEnvType = this.props.environmentType;
|
||||||
if (currentEnvType == EnvironmentType.SharePoint || currentEnvType == EnvironmentType.ClassicSharePoint) {
|
if (currentEnvType == EnvironmentType.SharePoint || currentEnvType == EnvironmentType.ClassicSharePoint) {
|
||||||
// Mapping to be used when webpart runs in SharePoint
|
// Mapping to be used when webpart runs in SharePoint.
|
||||||
|
// Get hold of the webpart's service scope object
|
||||||
serviceScope = this.props.serviceScope;
|
serviceScope = this.props.serviceScope;
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// This means webpart is running in the local workbench or from a unit test.
|
// This means webpart is running in the local workbench or from a unit test.
|
||||||
// So we will need a non default implementation of the UserProfileService i.e. MockUserProfileService
|
// So we will need a non default implementation of the UserProfileService i.e. MockUserProfileService
|
||||||
// Create a child service scope and include the mapping to the MockUserProfileService
|
// Create a child service scope and include the mapping to the MockUserProfileService
|
||||||
serviceScope = this.props.serviceScope.startNewChild();
|
serviceScope = this.props.serviceScope.startNewChild();
|
||||||
serviceScope.createAndProvide(userProfileServiceKey, MockUserProfileService);
|
serviceScope.createAndProvide(userProfileServiceKey, MockUserProfileService);
|
||||||
|
|
Loading…
Reference in New Issue