From 6d4e4d48e9c617393273cef52ecd7ce4ca3c5cc8 Mon Sep 17 00:00:00 2001 From: Thomas Prouvot <35368290+tprouvot@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:25:34 +0100 Subject: [PATCH] [popup] Add API Version to Org tab (#295) ## Describe your changes Display API version in the org tab image ## Issue ticket number and link #293 ## Checklist before requesting a review - [x] I have read and understand the [Contributions section](https://github.com/tprouvot/Salesforce-Inspector-reloaded#contributions) - [x] Target branch is releaseCandidate and not master - [x] I have performed a self-review of my code - [x] I ran the [unit tests](https://github.com/tprouvot/Salesforce-Inspector-reloaded#unit-tests) and my PR does not break any tests - [x] I documented the changes I've made on the [CHANGES.md](https://github.com/tprouvot/Salesforce-Inspector-reloaded/blob/master/CHANGES.md) and followed actual conventions - [x] I added a new section on [how-to.md](https://github.com/tprouvot/Salesforce-Inspector-reloaded/blob/master/docs/how-to.md) (optional) --- CHANGES.md | 1 + addon/manifest.json | 4 ++-- addon/popup.js | 12 ++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c7e6a5f2..0c9cd253 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## Version 1.23 +- Display API version in Org tab [feature 293](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/293) (feature by [Camille Guillory](https://github.com/CamilleGuillory)) - Add the possibility to hide fields API names after users clicked "Show fields API names" - Add performance On data export with option to disable in Options/Data Export tab (contribution by [Nathan Shulman](https://github.com/nshulman)) - Clean up popup header and footer (contribution by [Nathan Shulman](https://github.com/nshulman)) diff --git a/addon/manifest.json b/addon/manifest.json index 67da4217..edbe355c 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -1,8 +1,8 @@ { "name": "Salesforce Inspector reloaded", "description": "Productivity tools for Salesforce administrators and developers to inspect data and metadata directly from the Salesforce UI.", - "version": "1.22", - "version_name": "1.22", + "version": "1.23", + "version_name": "1.23", "icons": { "128": "icon128.png" }, diff --git a/addon/popup.js b/addon/popup.js index 24267e4a..69d2eeb6 100644 --- a/addon/popup.js +++ b/addon/popup.js @@ -1154,6 +1154,14 @@ class AllDataBoxOrg extends React.PureComponent { return null; } + getApiVersion(instanceStatus){ + if (instanceStatus){ + let apiVersion = (instanceStatus.releaseNumber.substring(0, 3) / 2) - 64; + return apiVersion; + } + return null; + } + setInstanceStatus(instanceName, sfHost){ let instanceStatusLocal = JSON.parse(sessionStorage.getItem(sfHost + "_instanceStatus")); if (instanceStatusLocal == null){ @@ -1205,6 +1213,10 @@ class AllDataBoxOrg extends React.PureComponent { h("th", {}, "Location:"), h("td", {}, this.state.instanceStatus?.location) ), + h("tr", {}, + h("th", {}, "API version:"), + h("td", {}, this.getApiVersion(this.state.instanceStatus)) + ), h("tr", {}, h("th", {}, h("a", {href: "https://status.salesforce.com/instances/" + orgInfo.InstanceName + "/maintenances", title: "Maintenance List", target: linkTarget}, "Maintenance:")), h("td", {}, this.getNextMajorRelease(this.state.instanceStatus?.Maintenances))