Skip to content

Commit

Permalink
Release 1.17 (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
tprouvot authored May 15, 2023
2 parents 76e4d4a + 30a5518 commit 9a8ee36
Show file tree
Hide file tree
Showing 13 changed files with 581 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ target/
.idea/
yarn.lock
.history/
.sfdx
.sfdx/
venv/
42 changes: 29 additions & 13 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
Version 1.17
===========

General
-------
* Add toLabel function among autocomplete query suggestions [feature 90](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/90) (idea by [Mickael Gudin](https://github.com/mickaelgudin))
* Update spinner on inspect page when loading or saving records and disable button [feature 69](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/69) (idea by [Camille Guillory](https://github.com/CamilleGuillory))
* Show "Copy Id" from Inspect page [feature 12](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/12)
* Add a configuration option for links to open in a new tab [feature 78](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/78) (idea by [Henri Vilminko](https://github.com/hvilminko))
* Import data as JSON [feature 75](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/75) (idea by [gaelguimini](https://github.com/gaelguimini))
* Fix auto update action on data import [issue 73](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/73) (issue by [Juul1](https://github.com/Juul1))
* Restore focus on suggested fields when pressing tab key in query editor [issue 66](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/66) (idea by [Enrique Muñoz](https://github.com/emunoz-at-wiris))
* Update shortcut indication for mac users
* Fix links for custom object [PR80](https://github.com/tprouvot/Salesforce-Inspector-reloaded/pull/80) (contribution by [Mouloud Habchi](https://github.com/MD931))
* Fix links for custom setting [PR82](https://github.com/tprouvot/Salesforce-Inspector-reloaded/pull/82) (contribution by [Mouloud Habchi](https://github.com/MD931))

Version 1.16
===========

General
-------
* Select "Update" action by default when the data paste in data-import page contains Id column [feature 60](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/60) (by Bilel Morsli)
* Allow users to update API Version [feature 58](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/58)
* Add org instance in the popup and a link to Salesforce trust status website [feature 53](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/53) (by [Camille Guillory](https://github.com/CamilleGuillory) )
* Fix saved query when it contains ":" [issue 55](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/55) (by [Victor Garcia](https://github.com/victorgz/) )
* Select "Update" action by default when the data paste in data-import page contains Id column [feature 60](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/60) (idea by Bilel Morsli)
* Allow users to update API Version [feature 58](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/58)
* Add org instance in the popup and a link to Salesforce trust status website [feature 53](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/53) (idea by [Camille Guillory](https://github.com/CamilleGuillory) )
* Fix saved query when it contains ":" [issue 55](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/55) (bug found by [Victor Garcia](https://github.com/victorgz/) )

Version 1.15
===========

General
-------
* Add "PSet" button to access user permission set assignment from User tab [feature 49](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/49)
* Add shortcut tab to access setup quick links [feature 42](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/42)
* Add "PSet" button to access user permission set assignment from User tab [feature 49](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/49)
* Add shortcut tab to access setup quick links [feature 42](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/42)

Version 1.14
===========
Expand All @@ -25,35 +41,35 @@ General

![image](https://user-images.githubusercontent.com/96471586/226161542-cbedec0a-8988-4559-9152-d067ea6f9cb6.png)

* Fix links (object fields and object list) for custom metadata objects [issue 39](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/39)
* Fix links (object fields and object list) for custom metadata objects [issue 39](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/39)
* Add shortcut link to object list from popup (idea by [Samuel Krissi](https://github.com/samuelkrissi) )
* 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/Chrome-Salesforce-inspector/issues/34)
* 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)
* Update manifest version from [v2](https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/) to v3
* Auto detect SObject on import page when posting data which contain SObject header [feature 30](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/30)
* 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/Chrome-Salesforce-inspector/issues/20)
* [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

Version 1.13
===========

General
-------
* [Automatically remove spaces from column name in import](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/23)
* [Automatically remove spaces from column name in import](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/23)
* Update to Salesforce API v 56.0 (Winter '23)
* Add "Skip all unknown fields" to import page
* Add User Id to pop-up

<img alt="Inspector menu" src="./docs/screenshots/add-user-id.png" height="200">

* Support Enhanced Domain [issue #222](https://github.com/sorenkrabbe/Chrome-Salesforce-inspector/issues/222) from [PR223](https://github.com/sorenkrabbe/Chrome-Salesforce-inspector/pull/223)
* [Add inactive users to search result](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/21)
* [Add inactive users to search result](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/21)

<img alt="Inspector menu" src="./docs/screenshots/issue21.png" height="200">

* Update to Salesforce API v 55.0 (Summer '22)
* Update to Salesforce API v 54.0 (Spring '22)
* [Sticked table header to the top on export](https://github.com/tprouvot/Chrome-Salesforce-inspector/issues/10)
* [Sticked table header to the top on export](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/10)
* Update to Salesforce API v 53.0 (Winter '22)
* Add label to saved query and sort list.
* Remove extra comma when autocomplete query in data export, or select a field from suggested fields juste before 'FROM' keyword.
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<img src="https://github.com/tprouvot/Salesforce-Inspector-reloaded/blob/master/addon/icon128.png?raw=true" align="right">

Salesforce inspector reloaded
Expand Down Expand Up @@ -50,6 +51,18 @@ Troubleshooting
* If Salesforce Inspector is not available after installation, the most likely issue is that your browser is not up to date. See [instructions for Google Chrome](https://productforums.google.com/forum/#!topic/chrome/YK1-o4KoSjc).
* When you enable the My Domain feature in Salesforce, Salesforce Inspector may not work until you have restarted your browser (or until you have deleted the "sid" cookie for the old Salesforce domain by other means).


Contributions
-----

Contributions are welcomed !

To submit a PR, please create a branch from releaseCandidate which is the work in progress next version.
This branch will be merge into master when the new version is published on web store.

Linting : to assure indentation, formatting and best practices coherence, please install ESLint extension.


Development
-----

Expand Down
12 changes: 6 additions & 6 deletions addon/data-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ class Model {
}
})
.concat(
new Enumerable(["FIELDS(ALL)", "FIELDS(STANDARD)", "FIELDS(CUSTOM)", "AVG", "COUNT", "COUNT_DISTINCT", "MIN", "MAX", "SUM", "CALENDAR_MONTH", "CALENDAR_QUARTER", "CALENDAR_YEAR", "DAY_IN_MONTH", "DAY_IN_WEEK", "DAY_IN_YEAR", "DAY_ONLY", "FISCAL_MONTH", "FISCAL_QUARTER", "FISCAL_YEAR", "HOUR_IN_DAY", "WEEK_IN_MONTH", "WEEK_IN_YEAR", "convertTimezone"])
new Enumerable(["FIELDS(ALL)", "FIELDS(STANDARD)", "FIELDS(CUSTOM)", "AVG", "COUNT", "COUNT_DISTINCT", "MIN", "MAX", "SUM", "CALENDAR_MONTH", "CALENDAR_QUARTER", "CALENDAR_YEAR", "DAY_IN_MONTH", "DAY_IN_WEEK", "DAY_IN_YEAR", "DAY_ONLY", "FISCAL_MONTH", "FISCAL_QUARTER", "FISCAL_YEAR", "HOUR_IN_DAY", "WEEK_IN_MONTH", "WEEK_IN_YEAR", "convertTimezone", "toLabel"])
.filter(fn => fn.toLowerCase().startsWith(searchTerm.toLowerCase()))
.map(fn => {
if (fn.includes(")")) { //Exception to easily support functions with hardcoded parameter options
Expand Down Expand Up @@ -1129,7 +1129,7 @@ class App extends React.Component {
h("button", { onClick: this.onClearHistory, title: "Clear Query History" }, "Clear")
),
h("div", { className: "pop-menu saveOptions", hidden: !model.expandSavedOptions },
h("a", { href: "#", onClick: this.onRemoveFromHistory, title: "Remove query from saved history" }, "Removed Saved Query"),
h("a", { href: "#", onClick: this.onRemoveFromHistory, title: "Remove query from saved history" }, "Remove Saved Query"),
h("a", { href: "#", onClick: this.onClearSavedHistory, title: "Clear saved history" }, "Clear Saved Queries")
),
h("div", { className: "button-group" },
Expand Down Expand Up @@ -1162,17 +1162,17 @@ class App extends React.Component {
h("div", { className: "autocomplete-header" },
h("span", {}, model.autocompleteResults.title),
h("div", { className: "flex-right" },
h("button", { disabled: model.isWorking, onClick: this.onExport, title: "Ctrl+Enter / F5", className: "highlighted" }, "Run Export"),
h("a", { className: "button", hidden: !model.autocompleteResults.sobjectName, href: model.showDescribeUrl(), target: "_blank", title: "Show field info for the " + model.autocompleteResults.sobjectName + " object" }, model.autocompleteResults.sobjectName + " Field Info"),
h("button", { href: "#", className: model.expandAutocomplete ? "toggle contract" : "toggle expand", onClick: this.onToggleExpand, title: "Show all suggestions or only the first line" },
h("button", { tabIndex: 1, disabled: model.isWorking, onClick: this.onExport, title: "Ctrl+Enter / F5", className: "highlighted" }, "Run Export"),
h("a", { tabIndex: 2, className: "button", hidden: !model.autocompleteResults.sobjectName, href: model.showDescribeUrl(), target: "_blank", title: "Show field info for the " + model.autocompleteResults.sobjectName + " object" }, model.autocompleteResults.sobjectName + " Field Info"),
h("button", { tabIndex: 3, href: "#", className: model.expandAutocomplete ? "toggle contract" : "toggle expand", onClick: this.onToggleExpand, title: "Show all suggestions or only the first line" },
h("div", { className: "button-icon" }),
h("div", { className: "button-toggle-icon" })
)
),
),
h("div", { className: "autocomplete-results" },
model.autocompleteResults.results.map(r =>
h("div", { className: "autocomplete-result", key: r.value }, h("a", { title: r.title, onClick: e => { e.preventDefault(); model.autocompleteClick(r); model.didUpdate(); }, href: "#", className: r.autocompleteType + ' ' + r.dataType }, h("div", { className: "autocomplete-icon" }), r.value), " ")
h("div", { className: "autocomplete-result", key: r.value }, h("a", { tabIndex: 0, title: r.title, onClick: e => { e.preventDefault(); model.autocompleteClick(r); model.didUpdate(); }, href: "#", className: r.autocompleteType + ' ' + r.dataType }, h("div", { className: "autocomplete-icon" }), r.value), " ")
)
),
),
Expand Down
1 change: 1 addition & 0 deletions addon/data-import-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export async function dataImportTest(test) {
vm.dataFormat = "csv";
vm.didUpdate();
vm.importAction = "delete";
vm.importActionSelected = true;
vm.didUpdate();
vm.setData("Id,_foo*,__Status\r\n" + records[5].Id + ",foo,Queued\r\n" + records[6].Id + ",foo,Succeeded");
assertEquals({ Queued: 1, Processing: 0, Succeeded: 1, Failed: 0 }, vm.importCounts());
Expand Down
37 changes: 34 additions & 3 deletions addon/data-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Model {
this.dataError = "";
this.useToolingApi = false;
this.dataFormat = "excel";
this.importActionSelected = false;
this.importAction = "create";
this.importActionName = "Insert";
this.importType = "Account";
Expand Down Expand Up @@ -85,13 +86,16 @@ class Model {
}

message() {
return this.dataFormat == "excel" ? "Paste Excel data here" : "Paste CSV data here";
return "Paste " + this.dataFormat.toUpperCase() + " data here";
}

setData(text) {
if (this.isWorking()) {
return;
}
if (this.dataFormat == "json") {
text = this.getDataFromJson(text);
}
let separator = this.dataFormat == "excel" ? "\t" : ",";
let data;
try {
Expand Down Expand Up @@ -132,9 +136,33 @@ class Model {
this.importType = sobj;
}
//automatically select update if header contains id
if (this.hasIdColumn(header)) {
if (this.hasIdColumn(header) && !this.importActionSelected) {
this.importAction = "update";
this.importActionName = "Update";
}
}

getDataFromJson(json) {
json = JSON.parse(json);
let csv;
let fields = ["_"].concat(Object.keys(json[0]));
fields = fields.filter(field => field != "attributes");

let sobject = json[0]["attributes"]["type"];
if (sobject) {
csv = json.map(function (row) {
return fields.map(function (fieldName) {
let value = row[fieldName];
if (value && typeof value === "string") {
return fieldName == "_" ? '"[' + sobject + ']"' : JSON.stringify(value)
}
}).join(",")
})
fields = fields.map(str => '"' + str + '"');
csv.unshift(fields.join(","));
csv = csv.join("\r\n");
}
return csv;
}

copyOptions() {
Expand Down Expand Up @@ -723,6 +751,7 @@ class App extends React.Component {
let { model } = this.props;
model.importAction = e.target.value;
model.importActionName = e.target.options[e.target.selectedIndex].text;
model.importActionSelected = true;
model.didUpdate();
}
onImportTypeChange(e) {
Expand Down Expand Up @@ -913,7 +942,9 @@ class App extends React.Component {
h("span", { className: "conf-label" }, "Format"),
h("label", {}, h("input", { type: "radio", name: "data-input-format", value: "excel", checked: model.dataFormat == "excel", onChange: this.onDataFormatChange, disabled: model.isWorking() }), " ", h("span", {}, "Excel")),
" ",
h("label", {}, h("input", { type: "radio", name: "data-input-format", value: "csv", checked: model.dataFormat == "csv", onChange: this.onDataFormatChange, disabled: model.isWorking() }), " ", h("span", {}, "CSV"))
h("label", {}, h("input", { type: "radio", name: "data-input-format", value: "csv", checked: model.dataFormat == "csv", onChange: this.onDataFormatChange, disabled: model.isWorking() }), " ", h("span", {}, "CSV")),
" ",
h("label", {}, h("input", { type: "radio", name: "data-input-format", value: "json", checked: model.dataFormat == "json", onChange: this.onDataFormatChange, disabled: model.isWorking() }), " ", h("span", {}, "JSON"))
),
h("div", { className: "conf-line" },
h("label", { className: "conf-input" },
Expand Down
Loading

0 comments on commit 9a8ee36

Please sign in to comment.