From 16f6cf56e44515400195acaa2d5209064aa5e376 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Thu, 27 Aug 2026 00:36:34 +0200 Subject: [PATCH] feat: update version to 1.2.1 and improve title handling in organization chart --- config/package-solution.json | 2 +- package.json | 2 +- src/webparts/organizationChart/OrganizationChartWebPart.ts | 2 +- .../organizationChart/components/OrganizationChart.tsx | 7 ++++--- tests/validate-project.js | 4 +++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/config/package-solution.json b/config/package-solution.json index 18d8fae..4419dd7 100644 --- a/config/package-solution.json +++ b/config/package-solution.json @@ -4,7 +4,7 @@ "name": "organization-chart-webpart", "title": "organization-chart-webpart", "id": "b2f88ea8-f7da-4d0e-a945-6973bf1acd1e", - "version": "1.2.0.0", + "version": "1.2.1.0", "includeClientSideAssets": true, "skipFeatureDeployment": true }, diff --git a/package.json b/package.json index 624344f..c55cd70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "organization-chart-webpart", - "version": "1.2.0", + "version": "1.2.1", "private": true, "main": "lib/index.js", "engines": { "node": ">=6.9.0 <9.0.0" }, diff --git a/src/webparts/organizationChart/OrganizationChartWebPart.ts b/src/webparts/organizationChart/OrganizationChartWebPart.ts index 399e07b..ea44d77 100644 --- a/src/webparts/organizationChart/OrganizationChartWebPart.ts +++ b/src/webparts/organizationChart/OrganizationChartWebPart.ts @@ -101,7 +101,7 @@ export default class OrganizationChartWebPart extends BaseClientSideWebPart = React.createElement(OrganizationChart, { data: data, - title: this.properties.title || strings.DefaultTitle, + title: String(this.properties.title || '').trim(), showPictures: this.properties.showPictures !== false, showContactDetails: this.properties.showContactDetails === true, cardBackgroundColor: this.properties.cardBackgroundColor || '', diff --git a/src/webparts/organizationChart/components/OrganizationChart.tsx b/src/webparts/organizationChart/components/OrganizationChart.tsx index 6fe99af..8179dea 100644 --- a/src/webparts/organizationChart/components/OrganizationChart.tsx +++ b/src/webparts/organizationChart/components/OrganizationChart.tsx @@ -39,9 +39,10 @@ export default class OrganizationChart extends React.Component -
- {this.props.title &&

{this.props.title}

} -
+ {this.props.title && +
+

{this.props.title}

+
} {this.props.data.truncated &&
{this.props.truncatedLabel}
}
{ this.viewportElement = element; }}>
diff --git a/tests/validate-project.js b/tests/validate-project.js index 2be3d67..6034e59 100644 --- a/tests/validate-project.js +++ b/tests/validate-project.js @@ -26,10 +26,12 @@ assert(packageSolution.solution.includeClientSideAssets === true && packageSolut 'Central deployment is not configured.'); assert(!!config.bundles['organization-chart-webpart'], 'Bundle name is inconsistent.'); assert(manifest.componentType === 'WebPart' && manifest.alias === 'OrganizationChartWebPart', 'Manifest is invalid.'); -assert(packageJson.version === '1.2.0' && packageSolution.solution.version === '1.2.0.0', +assert(packageJson.version === '1.2.1' && packageSolution.solution.version === '1.2.1.0', 'Organization Chart version is inconsistent.'); assert(webPart.indexOf("PropertyPaneTextField('title'") >= 0 && component.indexOf('styles.heading') >= 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(service.indexOf('/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor') >= 0, 'User Profile REST access is missing.'); assert(service.indexOf('/_api/SP.UserProfiles.PeopleManager/GetMyProperties') >= 0, 'Reliable current-user profile access is missing.');