Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/enable permission set summary in shortcut #176

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Version 1.20

- Add a parameter to activate summary view of pset / psetGroup from shortcut tab [feature 175](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/175)
- Display record name (and link) in popup [feature 165](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/165)
- Add documentation link to popup
- Add option to open extension pages in a new tab using keyboard shortcuts (contribution by [Joshua Yarmak](https://github.com/toly11))
Expand All @@ -14,7 +15,7 @@
- Add 'LIMIT 200' when selecting 'FIELDS(' in autocomplete [feature 146](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/146) )
- Change method to get extension id to be compatible with firefox [issue 137](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/137) (issue by [kkorynta](https://github.com/kkorynta))
- Fix hardcoded browser in Generate Token url [issue 137](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/137) (issue by [kkorynta](https://github.com/kkorynta))
- Add "Create New Flow" and "Recycle Bin" shortcuts
- Add "Create New Flow", "Create New Custom Object", "Create New Permission Set", "Create New Custom Permission" and "Recycle Bin" shortcuts
- Update pop-up release note link to github pages
- Detect SObject on listview page [feature 121](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/121) (idea by [Mehdi Cherfaoui](https://github.com/mehdisfdc))
- Automate test setup manual step of contact to multiple accounts [Aidan Majewski](https://github.com/aimaj)
Expand Down
49 changes: 29 additions & 20 deletions addon/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -884,28 +884,37 @@ class AllDataBoxShortcut extends React.PureComponent {
const searchResult = await sfConn.rest("/services/data/v" + apiVersion + "/composite", {method: "POST", body: compositeQuery});
let results = searchResult.compositeResponse.filter((elm) => elm.httpStatusCode == 200 && elm.body.records.length > 0);

let enablePermSetSummary = localStorage.getItem("enablePermSetSummary") === "true";

results.forEach(element => {
element.body.records.forEach(rec => {
switch (rec.attributes.type) {
case "FlowDefinitionView":
rec.link = "/builder_platform_interaction/flowBuilder.app?flowId=" + rec.LatestVersionId;
rec.label = rec.Label;
rec.name = rec.ApiName;
rec.detail = rec.attributes.type + " • " + rec.ProcessType;
break;
case "Profile":
rec.link = "/lightning/setup/EnhancedProfiles/page?address=%2F" + rec.Id;
rec.label = rec.Name;
rec.name = rec.Id;
rec.detail = rec.attributes.type + " • " + rec.UserLicense.Name;
break;
case "PermissionSet":
rec.link = rec.Type === "Group" ? "/lightning/setup/PermSetGroups/page?address=%2F" + rec.PermissionSetGroupId : "/lightning/setup/PermSets/page?address=%2F" + rec.Id;
rec.label = rec.Label;
rec.name = rec.Name;
rec.detail = rec.attributes.type + " • " + rec.Type;
rec.detail += rec.License?.Name != null ? " • " + rec.License?.Name : "";
break;
if (rec.attributes.type === "FlowDefinitionView"){
rec.link = "/builder_platform_interaction/flowBuilder.app?flowId=" + rec.LatestVersionId;
rec.label = rec.Label;
rec.name = rec.ApiName;
rec.detail = rec.attributes.type + " • " + rec.ProcessType;
} else if (rec.attributes.type === "Profile"){
rec.link = "/lightning/setup/EnhancedProfiles/page?address=%2F" + rec.Id;
rec.label = rec.Name;
rec.name = rec.Id;
rec.detail = rec.attributes.type + " • " + rec.UserLicense.Name;
} else if (rec.attributes.type === "PermissionSet"){
rec.label = rec.Label;
rec.name = rec.Name;
rec.detail = rec.attributes.type + " • " + rec.Type;
rec.detail += rec.License?.Name != null ? " • " + rec.License?.Name : "";

let psetOrGroupId;
let type;
if (rec.Type === "Group"){
psetOrGroupId = rec.PermissionSetGroupId;
type = "PermSetGroups";
} else {
psetOrGroupId = rec.Id;
type = "PermSets";
}
let endLink = enablePermSetSummary ? psetOrGroupId + "/summary" : "page?address=%2F" + psetOrGroupId;
rec.link = "/lightning/setup/" + type + "/" + endLink;
}
result.push(rec);
});
Expand Down
12 changes: 12 additions & 0 deletions docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,15 @@ Now you can enter the custom links following this convention:
ET VOILA !

<img width="271" alt="image" src="https://github.com/tprouvot/Salesforce-Inspector-reloaded/assets/35368290/02066229-3af1-435d-9370-1dab91760940">

## Enable summary view of PermissionSet / PermissionSetGroups from shortcut tab

Since Winter 24, there is a beta functionality to view a summary of the PermissionSet / PermissionSetGroups

<img width="718" alt="image" src="https://github.com/tprouvot/Salesforce-Inspector-reloaded/assets/35368290/36448cd1-260e-49bd-9dfd-c61910f813f4">

You can enable this view for the Shortcut search by creating a new localVariable as shown below.

![image](https://github.com/tprouvot/Salesforce-Inspector-reloaded/assets/35368290/f3093e4b-438c-4795-b64a-8d37651906a5)

Then when you click on a PermissionSet / PermissionSetGroups search result, you'll be redirected to the summary.