Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
tprouvot committed Mar 4, 2024
2 parents 22048f3 + 2a08d42 commit bb4a7b6
Show file tree
Hide file tree
Showing 33 changed files with 5,121 additions and 508 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- master
- main
- beta
permissions:
contents: write
jobs:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ yarn.lock
.history/
.sfdx/
venv/
.sf/
.sf/
.vscode/
.DS_Store
21 changes: 19 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release Notes

## Version 1.22

- Add AlertBanner component for Alerts following [SLDS guidelines](https://www.lightningdesignsystem.com/components/alert/) (contribution by [Nathan Shulman](https://github.com/nshulman))
- Add info banner when extension is updated and convert "Generate token" button to alert. [feature 51](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/51) (contribution by [Nathan Shulman](https://github.com/nshulman))
- Add "Hide fields API names" when users clicked "Show fields API names"
- Add "Enable Logs" button in the User tab [feature 245](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/245) (contribution by [Antoine Leleu](https://github.com/AntoineLeleu-Salesforce))
- Add default connected app setting and improve access token renew flow. Note: Due to the simplified redirect url, this is a BREAKING CHANGE for users who have created their own connected app: those users MUST update their connected app Callback URL to the new value before they can use this version of the extension (contribution by [Mehdi Cherfaoui](https://github.com/mehdisfdc))
- Allow users to define REST callout headers on showAllData page. The need is to prevent the auto assignation of Accounts, Cases and Leads. [feature 198](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/198) (issue by [SfdxDieter](https://github.com/SfdxDieter))
- Fix flow scrollability] checkbox on non dev environments [issue 258](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/258) (by [Samuel Krissi](https://github.com/samuelkrissi))
- Fix 'Record Type not displayed' in popup [issue 255](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/255)
- Add "Options" page to manage local storage variables directly from the UX. Allow to reposition the popup button [feature 145](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/145) (contribution by [Pietro Martino](https://github.com/pietromartino))
- Bugfix Delete button does not check for 'toolingApi' parameter [issue 254](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/254) (contribution by [Oscar Gomez Balaguer](https://github.com/ogomezba))
- Add Apex classes documentation in shortcut [feature 247](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/247)
- Disable "Delete records" button when a query returns more than 20k records [feature 251](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/251)
- Automatically request SObject type for data import and SObject record id for data export [feature 45](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/45) SObject record (#45)) (contribution by [Olivier Dufour](https://github.com/dufoli))
- Add support to Hyperforce China Organizations [PR141](https://github.com/tprouvot/Salesforce-Inspector-reloaded/pull/141) (contribution by [Yaacov Elbaz](https://github.com/yaacov9))

## Version 1.21

- Add support for upserting and deleting Custom Metadata (contribution by [Joshua Yarmak](https://github.com/toly11))
Expand All @@ -8,7 +25,7 @@
- Create new records from SObject tab ("New" button) [feature 226](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/226)
- Enhance shortcut search to include any part of the shortcut title, not only the beginning (contribution by [Joshua Yarmak](https://github.com/toly11))
- Org instance in not correct with after Hyperforce migration: store org instance in sessionStorage to retrieve it once per session [issue 167](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/167)
- Add Salesforce SObject documentation links [feature 219](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/219) (idea by [Antoine Audollent])
- Add Salesforce SObject documentation links [feature 219](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/219) (idea by Antoine Audollent)
- Add centering buttons section in footer after edit field (contribution by [Kamil Gadawski](https://github.com/KamilGadawski))
- Add dynamic display text show/hide borders table popup in record field preview setting (contribution by [Kamil Gadawski](https://github.com/KamilGadawski))
- Add "Download" option on event log files (contribution by [Annubis45](https://github.com/Annubis45))
Expand Down Expand Up @@ -104,7 +121,7 @@
- Auto detect SObject on import page when posting data which contain SObject header [feature 30](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/30)
- Update to Salesforce API v 57.0 (Spring '23)
- [Switch background color on import page to alert users that it's a production environnement](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/20)
- Implement Auth2 flow to generate access token for connected App
- Implement OAuth2 flow to generate access token for connected App

## Version 1.13

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ We all know and love Salesforce Inspector: As the great Søren Krabbe did not ha

## New features compared to original SF Inspector

[List of changes](CHANGES.md)

- Allow users to update API Version [feature 58](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/58)
- Add new "Shortcuts" tab to accelerate setup navigation [feature 42](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/42)
- Add shortcuts links to (list of record types, current SObject RecordType and objet details, show all data from user tab) from popup [feature 34](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/34)
- Control access to Salesforce Inspector reloaded with profiles / permissions (Implement Auth2 flow to generate access token for connected App) [how to](https://github.com/tprouvot/Salesforce-Inspector-reloaded/wiki/How-to#use-sf-inspector-with-a-connected-app)
- Control access to Salesforce Inspector reloaded with profiles / permissions (Implement OAuth2 flow to generate access token for connected App) [how to](https://github.com/tprouvot/Salesforce-Inspector-reloaded/wiki/How-to#use-sf-inspector-with-a-connected-app)
- Update manifest version from [v2](https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/) to v3 (extensions using manifest v2 will be removed from the store)
- New UI for Export / Import

Expand All @@ -65,7 +63,7 @@ To validate the accuracy of this description, inspect the source code, monitor t

## Use Salesforce Inspector with a Connected App

Follow steps described in [how-to documentation](https://tprouvot.github.io/Salesforce-Inspector-reloaded/how-to/#use-sf-inspector-with-a-connected-app)
Follow steps described in [how-to documentation](https://tprouvot.github.io/Salesforce-Inspector-reloaded/how-to/#use-sf-inspector-with-a-connected-app). Note: you must complete these steps to use the extension in orgs where "API Access Control" is enabled.

## Installation

Expand Down Expand Up @@ -95,7 +93,7 @@ Thank you for shaping our extension's future! Your feedback makes it better.
2. Checkout the releaseCandidate branch.
3. Open `chrome://extensions/`.
4. Enable `Developer mode`.
5. Click `Load unpacked extension...`.
5. Click `Load unpacked`.
6. Select the **`addon`** subdirectory of this repository.

## Troubleshooting
Expand Down Expand Up @@ -139,7 +137,7 @@ Linting : to assure indentation, formatting and best practices coherence, please
### Unit tests

1. Set up an org (e.g. a Developer Edition) and apply the following customizations:
1. Everything described in metadata in `test/`. Push to org with `sfdx force:source:deploy -p test/ -u [your-test-org-alias]`.
1. Everything described in metadata in `test/`. Push to org with `sf deploy metadata -d test/ -o [your-test-org-alias]` or legacy `sfdx force:source:deploy -p test/ -u [your-test-org-alias]`.
2. Make sure your user language is set to English.
3. Ensure _Allow users to relate a contact to multiple accounts_ is enabled (Setup → Account Settings).
4. Ensure the org has no _namespace prefix_ (Setup → Package Manager).
Expand Down
45 changes: 13 additions & 32 deletions addon/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Firefox does not support incognito split mode, so we use sender.tab.cookieStoreId to select the right cookie store.
// Chrome does not support sender.tab.cookieStoreId, which means it is undefined, and we end up using the default cookie store according to incognito split mode.
if (request.message == "getSfHost") {
const currentDomain = new URL(request.url).hostname;
// When on a *.visual.force.com page, the session in the cookie does not have API access,
// so we read the corresponding session from *.salesforce.com page.
// The first part of the session cookie is the OrgID,
Expand All @@ -12,40 +13,20 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// There is no straight forward way to unambiguously understand if the user authenticated against salesforce.com or cloudforce.com
// (and thereby the domain of the relevant cookie) cookie domains are therefore tried in sequence.
chrome.cookies.get({url: request.url, name: "sid", storeId: sender.tab.cookieStoreId}, cookie => {
const currentDomain = new URL(request.url).hostname;
if (!cookie) {
sendResponse(currentDomain); //default
if (!cookie || currentDomain.endsWith(".mcas.ms")) { //Domain used by Microsoft Defender for Cloud Apps, where sid exists but cannot be read
sendResponse(currentDomain);
return;
}
let [orgId] = cookie.value.split("!");
chrome.cookies.getAll({name: "sid", domain: "salesforce.com", secure: true, storeId: sender.tab.cookieStoreId}, cookies => {
let sessionCookie = cookies.find(c => c.value.startsWith(orgId + "!"));
if (sessionCookie) {
sendResponse(sessionCookie.domain);
} else {
chrome.cookies.getAll({name: "sid", domain: "cloudforce.com", secure: true, storeId: sender.tab.cookieStoreId}, cookies => {
sessionCookie = cookies.find(c => c.value.startsWith(orgId + "!"));
if (sessionCookie) {
sendResponse(sessionCookie.domain);
} else {
chrome.cookies.getAll({name: "sid", domain: "salesforce.mil", secure: true, storeId: sender.tab.cookieStoreId}, cookies => {
sessionCookie = cookies.find(c => c.value.startsWith(orgId + "!"));
if (sessionCookie) {
sendResponse(sessionCookie.domain);
} else {
chrome.cookies.getAll({name: "sid", domain: "cloudforce.mil", secure: true, storeId: sender.tab.cookieStoreId}, cookies => {
sessionCookie = cookies.find(c => c.value.startsWith(orgId + "!"));
if (sessionCookie) {
sendResponse(sessionCookie.domain);
} else {
sendResponse(currentDomain); //default
}
});
}
});
}
});
}
const [orgId] = cookie.value.split("!");
const orderedDomains = ["salesforce.com", "cloudforce.com", "salesforce.mil", "cloudforce.mil", "sfcrmproducts.cn"];

orderedDomains.forEach(currentDomain => {
chrome.cookies.getAll({name: "sid", domain: currentDomain, secure: true, storeId: sender.tab.cookieStoreId}, cookies => {
let sessionCookie = cookies.find(c => c.value.startsWith(orgId + "!"));
if (sessionCookie) {
sendResponse(sessionCookie.domain);
}
});
});
});
return true; // Tell Chrome that we want to call sendResponse asynchronously.
Expand Down
93 changes: 73 additions & 20 deletions addon/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,129 @@
z-index: 1000;
display: block;
position: fixed;
top: 122px;
right: 0;
vertical-align: middle;
}

#insext .insext-popup {
box-sizing: border-box;
width: 280px;
height: 450px;
position:absolute;
background-color: #ffffff;
right: 0;
border-radius: 4px;
border-top-right-radius: 0;
z-index: 1;
box-shadow: 0 -2px 2px 0 rgba(0,0,0,.16);
border: 1px solid #d8dde6;
display: none;
}

#insext .insext-popup-vertical {
right: 0%;
border-top-right-radius: 0;
box-shadow: 0 -2px 2px 0 rgba(0,0,0,.16);
}

#insext .insext-popup-vertical-up {
bottom: 100%;
}

#insext .insext-popup-horizontal {
bottom: 20px;
box-shadow: 2px 0 2px 0 rgba(0,0,0,.16);
}

#insext .insext-popup-horizontal-left {
right: 0%;
}

#insext .insext-popup-horizontal-centered {
right: -380%;
}

#insext .insext-popup-horizontal-right {
left: 0%;
}

#insext.insext-active .insext-popup {
display: block;
}
#insext .insext-btn {
box-sizing: border-box;
width: 15px;
height: 33px;
padding: 3px 1px 2px 0;
background-color: #226b86;
border-width: 4px;
border-style: solid;
border-right-style: none;
border-color: #fff;
opacity: .4;
}
#insext .insext-btn-vertical {
width: 15px;
height: 33px;
padding: 3px 1px 2px 0;
border-right-style: none;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
box-shadow: -2px 0 2px #a0a6ab;
opacity: .4;
}
#insext .insext-btn:hover,
#insext.insext-active .insext-btn {
#insext .insext-btn-horizontal {
height: 15px;
width: 33px;
padding: 0 2px 1px 3px;
border-bottom-style: none;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
box-shadow: 0 -2px 2px #a0a6ab;
}

#insext .insext-btn-vertical:hover,
#insext.insext-active .insext-btn-vertical {
opacity: 1;
width: 20px;
width: 20px;
}

#insext .insext-btn-horizontal:hover,
#insext.insext-active .insext-btn-horizontal {
opacity: 1;
height: 20px;
}

#insext .insext-btn img {
box-sizing: border-box;
}

#insext .insext-btn-vertical img {
width: 10px;
height: 15px;
margin: 2px;
}

#insext .insext-btn-horizontal img {
width: 15px;
height: 10px;
margin: 2px;
}

.checkboxScrollSandbox {
position: fixed;
top: 10px;
right: 78px;
z-index: 100;
z-index: 10000;
}
.checkboxScrollProd{
position: fixed;
top: 21px;
top: 21px;
right: 78px;
z-index: 100;
z-index: 10000;
}
.labelCheckboxScrollSandbox{
position: fixed;
top: 7px;
right: 100px;
top: 7px;
right: 100px;
color: white;
z-index: 100;
z-index: 10000;
}
.labeCheckboxScrollProd{
position: fixed;
top: 15px;
right: 100px;
color: white;
z-index: 100;
z-index: 10000;
}
Loading

0 comments on commit bb4a7b6

Please sign in to comment.