Skip to content

Commit

Permalink
[data-export] Add Query Record link (#184)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Prouvot <[email protected]>
  • Loading branch information
AntoineLeleu-Salesforce and tprouvot authored Oct 20, 2023
1 parent 904db2e commit 64a0fba
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Version 1.20

- Add "Query Record" link from data-export page [feature 111](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/111) (contribution by [Antoine Leleu](https://github.com/AntoineLeleu-Salesforce))
- Fix "Edit page layout link" for from show all data and use "openLinksInNewTab" property for those links [issue 181](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/181)
- Update to Salesforce API v 59.0 (Winter '24)
- Add a parameter to activate summary view of pset / psetGroup from shortcut tab [feature 175](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/175)
Expand Down
8 changes: 8 additions & 0 deletions addon/data-load.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@
-webkit-mask-position: center;
}

.pop-menu a.query-record .icon {
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 1rem;
-webkit-mask-image: url('chrome-extension://__MSG_@@extension_id__/images/record_lookup.svg');
-webkit-mask-position: center;
background-color: #706E6B;
}

.pop-menu a.copy-id .icon {
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 1rem;
Expand Down
18 changes: 17 additions & 1 deletion addon/data-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,24 @@ function renderCell(rt, cell, td) {
aShow.textContent = "Show all data";
aShow.className = "view-inspector";
let aShowIcon = document.createElement("div");
aShowIcon.className = "icon"
aShowIcon.className = "icon";
pop.appendChild(aShow);
aShow.prepend(aShowIcon);

//Query Record
let aQuery = document.createElement("a");
let query = "SELECT Id FROM " + objectTypes + " WHERE Id = '" + recordId + "'";
let queryArgs = new URLSearchParams();
queryArgs.set("host", rt.sfHost);
queryArgs.set("query", query);
aQuery.href = "data-export.html?" + queryArgs;
aQuery.target = "_blank";
aQuery.textContent = "Query Record";
aQuery.className = "query-record";
let aqueryIcon = document.createElement("div");
aqueryIcon.className = "icon";
pop.appendChild(aQuery);
aQuery.prepend(aqueryIcon);
}
// If the recordId ends with 0000000000AAA it is a dummy ID such as the ID for the master record type 012000000000000AAA
if (recordId && isRecordId(recordId) && !recordId.endsWith("0000000000AAA")) {
Expand All @@ -195,6 +210,7 @@ function renderCell(rt, cell, td) {
pop.appendChild(aView);
aView.prepend(aviewIcon);
}

//copy to clipboard
let aCopy = document.createElement("a");
aCopy.className = "copy-id";
Expand Down

0 comments on commit 64a0fba

Please sign in to comment.