diff --git a/package.json b/package.json index 508341ef..771a3796 100644 --- a/package.json +++ b/package.json @@ -6,31 +6,31 @@ "node": ">=0.10.0" }, "dependencies": { - "@microsoft/sp-client-base": "~1.0.0", - "@microsoft/sp-core-library": "~1.1.0", + "@microsoft/sp-client-base": "~1.0.0", + "@microsoft/sp-core-library": "~1.3.0", "@microsoft/sp-http": "^1.1.1", "@microsoft/sp-loader": "^1.1.1", - "@microsoft/sp-webpart-base": "~1.1.1", - "@types/react": "0.14.46", + "@microsoft/sp-webpart-base": "~1.3.0", + "@types/react": "15.0.38", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-test-utils": "0.14.15", "@types/react-addons-update": "0.14.14", "@types/react-dom": "0.14.18", "@types/webpack-env": ">=1.12.1 <1.14.0", - "office-ui-fabric-react": "2.17.0", + "office-ui-fabric-react": "5.29.0", "jquery": "2.2.4", "jqueryui": "^1.11.1", "react": "15.4.2", "react-dom": "15.4.2", "orchestrator": "^0.3.8", - "sp-client-custom-fields": "^1.3.5", + "sp-client-custom-fields": ">=1.3.5 <1.3.7", "through2": "^2.0.3", "typewriting": "^1.2.2" }, "devDependencies": { - "@microsoft/sp-build-web": "~1.1.0", - "@microsoft/sp-module-interfaces": "~1.1.0", - "@microsoft/sp-webpart-workbench": "~1.1.0", + "@microsoft/sp-build-web": "~1.3.0", + "@microsoft/sp-module-interfaces": "~1.3.0", + "@microsoft/sp-webpart-workbench": "~1.3.0", "@types/chai": ">=3.4.34 <3.6.0", "@types/mocha": ">=2.2.33 <2.6.0", "gulp": "~3.9.1" diff --git a/src/webparts/simplePoll/components/SimplePollWebPartHost.tsx b/src/webparts/simplePoll/components/SimplePollWebPartHost.tsx index c17fee88..405499fa 100644 --- a/src/webparts/simplePoll/components/SimplePollWebPartHost.tsx +++ b/src/webparts/simplePoll/components/SimplePollWebPartHost.tsx @@ -206,61 +206,68 @@ export default class SimplePollWebPartHost extends React.Component { - this.state.popupOpened = true; - this.state.resultsLoaded = false; - this.state.results = []; - this.setState(this.state); + this.setState({ + popupOpened: true, + resultsLoaded: false, + results: [] + }); }); } } private closeError(): void { - this.state.popupErrorOpened = false; - this.setState(this.state); + this.setState({ + popupErrorOpened: false + }); } private closeVote(): void { - this.state.popupOpened = false; - this.state.alreadyVote = true; - this.setState(this.state); + this.setState({ + popupOpened: false, + alreadyVote: true + }); } private viewResultsBack(elm?: any): void { - this.state.viewResults = false; - this.setState(this.state); + this.setState({ + viewResults: false + }); } private viewResults(elm?: any): void { - this.state.viewResults = true; + this.setState({ + viewResults: true + }); if (this.state.resultsLoaded != true) { - this.state.loaded = false; - this.setState(this.state); + this.setState({ + loaded: false + }); const listService: SPSurveyService = new SPSurveyService(this.props, this.myPageContext); listService.getResults(this.props.surveyList, this.state.questionInternalName, this.state.choices).then((num: number[]) => { - this.state.results = num; - this.state.loaded = true; - this.setState(this.state); - this.loadChart(); + this.setState({ + results: num, + loaded: true + }); + this.loadChart(); }); } - else { - this.setState(this.state); - } } private getColors(choices: string[]): string[] { @@ -378,8 +385,9 @@ export default class SimplePollWebPartHost extends React.Component { var responseVoteVal = responseVote.value; if (responseVoteVal.length > 0) { - this.state.alreadyVote = true; - this.state.selectedValue = responseVoteVal[0].Title; + this.setState({ + alreadyVote: true, + selectedValue: responseVoteVal[0].Title + }); } else - this.state.alreadyVote = false; + this.setState({ + alreadyVote: false + }); - this.state.loaded = true; - this.setState(this.state); + this.setState({ + loaded: true + }); }); }); } @@ -428,9 +443,10 @@ export default class SimplePollWebPartHost extends React.Component