diff --git a/config/package-solution.json b/config/package-solution.json index 992ba36..6169535 100644 --- a/config/package-solution.json +++ b/config/package-solution.json @@ -4,7 +4,7 @@ "name": "dynamic-poll-web-part", "title": "dynamic-poll-web-part", "id": "900239c9-b6c7-495d-a386-2d08a81a66f3", - "version": "1.3.0.0", + "version": "1.3.1.0", "includeClientSideAssets": true, "skipFeatureDeployment": true }, diff --git a/package.json b/package.json index 1efe62a..746300f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynamic-poll-web-part", - "version": "1.3.0", + "version": "1.3.1", "private": true, "main": "lib/index.js", "engines": { "node": ">=6.9.0 <9.0.0" }, diff --git a/src/webparts/dynamicPoll/DynamicPollWebPart.ts b/src/webparts/dynamicPoll/DynamicPollWebPart.ts index 907cc0c..dfb424d 100644 --- a/src/webparts/dynamicPoll/DynamicPollWebPart.ts +++ b/src/webparts/dynamicPoll/DynamicPollWebPart.ts @@ -172,7 +172,7 @@ export default class DynamicPollWebPart extends BaseClientSideWebPart = React.createElement(DynamicPollCollection, { - title: this.properties.title || strings.DefaultTitle, + title: String(this.properties.title || '').trim(), snapshots: snapshots, displayMode: this.properties.displayMode === 'accordion' ? 'accordion' : 'slider', showResultsBeforeVote: this.properties.showResultsBeforeVote === true, diff --git a/tests/validate-project.js b/tests/validate-project.js index c672b59..f736b6a 100644 --- a/tests/validate-project.js +++ b/tests/validate-project.js @@ -16,7 +16,7 @@ var component = read('src/webparts/dynamicPoll/components/DynamicPoll.tsx'); var collection = read('src/webparts/dynamicPoll/components/DynamicPollCollection.tsx'); var styles = read('src/webparts/dynamicPoll/components/DynamicPoll.module.scss'); -assert(packageJson.version === '1.3.0' && solution.version === '1.3.0.0', 'Version mismatch.'); +assert(packageJson.version === '1.3.1' && solution.version === '1.3.1.0', 'Version mismatch.'); assert(solution.includeClientSideAssets === true && solution.skipFeatureDeployment === true, 'Central deployment missing.'); assert(packageJson.name === 'dynamic-poll-web-part' && solution.name === 'dynamic-poll-web-part' && solution.title === 'dynamic-poll-web-part', 'Dynamic Poll package naming is inconsistent.'); @@ -31,6 +31,8 @@ assert(webPart.indexOf("PropertyPaneDropdown('pollKeyField'") >= 0 && assert(webPart.indexOf("PropertyPaneTextField('title'") >= 0 && collection.indexOf('styles.webPartHeading') >= 0, 'Configurable web part title is missing.'); +assert(webPart.indexOf("String(this.properties.title || '').trim()") >= 0, + 'An empty web part title must remain hidden.'); assert(webPart.indexOf("PropertyPaneDropdown('displayMode'") >= 0 && webPart.indexOf('DynamicPollCollection') >= 0, 'Multiple-poll display mode is missing.'); assert(service.indexOf('getSnapshots') >= 0 && service.indexOf('getActivePolls') >= 0,