updated comments

This commit is contained in:
vman 2016-09-14 23:23:34 +01:00
parent e42a0a5d69
commit c72d4351b0
1 changed files with 4 additions and 3 deletions

View File

@ -109,7 +109,7 @@ export default class OrganisationChart extends React.Component<IOrganisationChar
}
private _getUserProperties(): void {
//Get hold of the webpart's service scope object
let serviceScope: ServiceScope;
const userProfileServiceKey: ServiceKey<IUserProfileService> = ServiceKey.create<IUserProfileService>("userprofileservicekey", UserProfileService);
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
const currentEnvType = this.props.environmentType;
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;
}
else {
// 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
serviceScope = this.props.serviceScope.startNewChild();
serviceScope.createAndProvide(userProfileServiceKey, MockUserProfileService);