Skip to content

Commit

Permalink
Merge branch 'releaseCandidate' of https://github.com/tprouvot/Chrome…
Browse files Browse the repository at this point in the history
…-Salesforce-inspector into releaseCandidate
  • Loading branch information
tprouvot committed Nov 20, 2024
2 parents 86cc217 + a563e2a commit d873399
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Version 1.26

- Customize Data Export shortcuts (execute query and insert all fields name in query) [feature 653](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/653) in `chrome://extensions/shortcuts`
- Add [clientId](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_calloptions.htm) header param to identify the extension in EventLogFile [feature 504](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/504)
- Add Apex Classes metadata search in Shortcut tab and new option configuration for the search [feature 591](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/591) request by [mpekacki](https://github.com/mpekacki)
- Add `My Personal Information` shortcuts [feature 627](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/627) request by [Alfredo Chissotti](https://github.com/Astisme)
Expand Down
4 changes: 2 additions & 2 deletions addon/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ chrome.action.onClicked.addListener(() => {
});
});
chrome.commands?.onCommand.addListener((command) => {
if (command !== "open-popup"){
if (!command.startsWith("open-")){
chrome.tabs.create({
url: `chrome-extension://${chrome.i18n.getMessage("@@extension_id")}/${command}.html?host=${sfHost}`
});
} else {
chrome.runtime.sendMessage({
msg: "shortcut_pressed", sfHost
msg: "shortcut_pressed", command, sfHost
});
}
});
Expand Down
10 changes: 10 additions & 0 deletions addon/data-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,15 @@ class App extends React.Component {
model.didUpdate();
}
});
addEventListener("message", e => {
if (e.data.command === "open-export-autocomplete") {
model.queryAutocompleteHandler({ctrlSpace: true});
model.didUpdate();
} else if (e.data.command === "open-export-execute"){
model.doExport();
model.didUpdate();
}
});
addEventListener("keydown", e => {
if ((e.ctrlKey && e.key == "Enter") || e.key == "F5") {
e.preventDefault();
Expand Down Expand Up @@ -1453,6 +1462,7 @@ class App extends React.Component {
" query in the box above and press Export."),
h("p", {}, "Press Ctrl+Space to insert all field name autosuggestions or to load suggestions for field values."),
h("p", {}, "Press Ctrl+Enter or F5 to execute the export."),
h("p", {}, "Those shortcuts can be customized in chrome://extensions/shortcuts"),
h("p", {}, "Supports the full SOQL language. The columns in the CSV output depend on the returned data. Using subqueries may cause the output to grow rapidly. Bulk API is not supported. Large data volumes may freeze or crash your browser.")
)
),
Expand Down
6 changes: 6 additions & 0 deletions addon/manifest-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
"open-popup": {
"description": "Open popup"
},
"open-export-autocomplete": {
"description": "Fields suggestion in Data Export"
},
"open-export-execute": {
"description": "Run Query in Data Export"
},
"data-export": {
"description": "Data Export"
},
Expand Down
6 changes: 6 additions & 0 deletions addon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
"open-popup": {
"description": "Open popup"
},
"open-export-autocomplete": {
"description": "Fields suggestion in Data Export"
},
"open-export-execute": {
"description": "Run Query in Data Export"
},
"data-export": {
"description": "Data Export"
},
Expand Down
6 changes: 5 additions & 1 deletion addon/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ if (typeof browser === "undefined") {
});
chrome.runtime.onMessage.addListener((request) => {
if (request.msg === "shortcut_pressed") {
parent.postMessage({insextOpenPopup: true}, "*");
if (request.command === "open-popup"){
parent.postMessage({insextOpenPopup: true}, "*");
} else {
parent.postMessage({command: request.command}, "*");
}
}
}
);
Expand Down
8 changes: 7 additions & 1 deletion docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,17 @@ From the option page, enable "Use favicon color on sandbox banner"
## Select all fields in a query

This functionality already exists in the legacy version but since many users don't know about it, I would like to document it.
When on the export page, put the cursor between `SaELECT` and `FROM` and press `Ctrl + space` for inserting all fields (if you don't have the rights for a particular field, it wont' be added).
When on the export page, put the cursor between `SELECT` and `FROM` and press `Ctrl + space` for inserting all fields (if you don't have the rights for a particular field, it wont' be added).
If you want to insert only custom fields, enter `__c` between `SELECT` and `FROM`.

![2024-04-16_08-53-32 (1)](https://github.com/tprouvot/Salesforce-Inspector-reloaded/assets/35368290/ef7ba7a0-c9c4-4573-9aaa-b72e64430f64)

## Customize Select all fields in a query shortcut

If the default `Ctrl + space` shortcut is already used by another extension or app, you can customize it in `chrome://extensions/shortcuts` and choose the one you prefer.

<img width="1133" alt="Customize Select all fields in a query shortcut" src="https://github.com/user-attachments/assets/f0bca12a-7c92-4fbe-9ca4-a8db51b050e9">

## Exclude formula fields from data export autocomplete

You can exclude formula fields to be included in the autocomplete by disable the toogle
Expand Down

0 comments on commit d873399

Please sign in to comment.