Removed unused web part context from TodoContainer.

Renamed _getTasksLists to _loadTaskLists to match what it does.
This commit is contained in:
chaksc 2016-10-18 09:34:36 -07:00
parent 80bcc329eb
commit 9ed8f8d9c2
3 changed files with 4 additions and 8 deletions

View File

@ -59,7 +59,7 @@ While you can choose from many patterns, this kind of an approach, to break into
### Status Renderers
SharePoint Framework provides status renderers to display information when the web part is performing any time consuming operations such as fetching data from SharePoint. The following status renderers are available via the web part context property:
SharePoint Framework provides status renderers to use when the web part is loading information from SharePoint or display error if the web part run into issues that could prevent it from working properly. The following status renderers are available via the web part context property. Do note that the status renderers take up the entire web part UX.
- Loading indicator
- Used to display the loading indicator. Useful when you are initializing or loading any content in your web part.

View File

@ -7,8 +7,7 @@ import {
PropertyPaneDropdown,
IPropertyPaneField,
PropertyPaneLabel,
IPropertyPaneDropdownOption,
IHtmlProperties
IPropertyPaneDropdownOption
} from '@microsoft/sp-client-preview';
import { EnvironmentType } from '@microsoft/sp-client-base';
import * as lodash from '@microsoft/sp-lodash-subset';
@ -51,7 +50,7 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
/*
Get the list of tasks lists from the current site and populate the property pane dropdown field with the values.
*/
return this._getTaskLists()
return this._loadTaskLists()
.then(() => {
/*
If a list is already selected, then we would have stored the list Id in the associated web part property.
@ -73,7 +72,6 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
TodoContainer,
{
dataProvider: this._dataProvider,
webPartContext: this.context,
webPartDisplayMode: this.displayMode,
configureStartCallback: this._openPropertyPane
}
@ -119,7 +117,7 @@ export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps
};
}
private _getTaskLists(): Promise<void> {
private _loadTaskLists(): Promise<void> {
return this._dataProvider.getTaskLists()
.then((taskLists: ITodoTaskList[]) => {
// Disable dropdown field if there are no results from the server.

View File

@ -1,10 +1,8 @@
import { IWebPartContext } from '@microsoft/sp-client-preview';
import { DisplayMode } from '@microsoft/sp-client-base';
import ITodoDataProvider from '../../dataProviders/ITodoDataProvider';
interface ITodoContainerProps {
dataProvider: ITodoDataProvider;
webPartContext: IWebPartContext;
webPartDisplayMode: DisplayMode;
configureStartCallback: () => void;
}