Code Monkey home page Code Monkey logo

electronforce's Introduction

Lint Status CodeQL Status

ElectronForce

ElectronForce is an Electron based Salesforce Org exploration tool using the JSForce library to leverage the Salesforce APIs. Currently it allows you to query and search data, describe objects, review the Organization object, and list all objects in the org.

Quick Start

Right now, while the project is setup to build native applications on Mac, Windows, and Linux, I'm not maintaining builds. So it's a bit developer focused and you'll need to have Node.js installed. Granted this is a largely an API interface so some technical ability is expected but longer-term not the ability to understand JavaScript. Anyway you don't need to know how to use Node just need to have the tools around.

From your terminal:

git clone https://github.com/acrosman/electronForce.git
cd electronForce
npm install
npm start

ElectronForce will allow you to log into your Salesforce Org and interact with some of the APIs. While all of JSForce's supported APIs are listed, only Query, Search, and Describe are currently support.

Log in

Currently only the standard login is supported, not OAuth2, so you likely will need your security token.

In the login fields provide your username, password, and security token. If you are logging into a production or trailhead instance you can use the default login URL. If you are logging into a Sandbox use: https://test.salesforce.com.

ElectronForce Main screen.

The main interface includes the login information, API selector and parameter fields on the left, raw display of the previous API response on the right, and a processed version of the response at the bottom.

Run Query or Search

The SOQL and SOSL Query APIs allow you to run querys and searches using the appropriate Salesforce syntax. When any of the supported APIs are selected appropriate inputs are provided so you can formulate the details of the query. In the screen shot above, a simple Select of Contacts is shown, with a query requesting the record Id and Contact Name.

SELECT Id, Name FROM Contact

At the bottom of the display ElectronForce provides a grid view of the query results:

ElectronForce Search Result Screen..

Note: Contacts shown are from a Salesforce Trailhead not from a production database.

Run Describe

Beyond exploring the data and testing queries, ElectronForce can also allow you to explore the metadata for a specific object provided via the Describe API. Select the Describe API from the selector and enter the name of the object you would like described. ElectronForce will format the resulting structures as an interactive tree view.

ElectronForce Describe Result Screen..

Run Global Describe

Global Describe retreives a list of all object (custom and standard) in your org.

Fetch the Organization Object

All Salesforce Orgs have a single object that describes the org itself. This function gets a list of all the fields on your org's Organization object (so it adds new fields as they are released) and runs a SOQL query to retreive all available data. Note: Not all fields return data via the API.

Disclaimer

This project has no direct association with Salesforce except the use of the APIs provided under the terms of use of their services.

electronforce's People

Contributors

acrosman avatar aolamide avatar bensun13 avatar dependabot[bot] avatar hwilson2563 avatar parthnamdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

electronforce's Issues

Move login form to a modal

Doesn't need to take up some much screen space. It would be better if there were a button to trigger the form, and then it could remain next to the connection selector and logout button.

Switch to Electron Forge

I initially selected Electron Builder because someone recommended it during a Hacktoberfest a few years ago on another project. Electron project has selected Electron Forge as the default builder, so I'd like to switch this project to use it.

Pull field lists from object describe

Summary
Add feature to only show fields on an object during object describe.

Describe the solution you'd like
A common use case of the object describe is to be able to see a list of all fields by their name and basic details. Currently those are nested inside a large hard to navigate generic structure from the describe calls, it would be easier to find what you want it they were in a table.

Add a checkbox to the form for the describe calls to just display the fields.
Update the display when in that mode to only show the fields in a table (and probably an object summary of some kind above the table).

Add Result Paging

Summary
Add the ability to pull later pages from a query result with lots of data.

Description
While the application is aware of the need for paging in theory, nothing has been done to implement it in practice. Even the simplest org should return more than 10k records for:
SELECT SobjectType, Field, ParentId, PermissionsEdit, PermissionsRead, Parent.Name FROM FieldPermissions

  1. Add paging controls to the interface.
  2. Add support for pulling in subsequent pages see jsforce's [QueryMore()](http://jsforce.github.io/jsforce/doc/Connection.html#queryMore) and this issue for implementation suggestions and discussion.

Finish OWD fetch

Summary
There is a selector to pull in an org's Default Sharing Rules, but it's not connected to actually do anything. It should be completed so that it fetches and displays the OWDs for all objects in the org.

Remove Access token from connection log message

Summary
Currently the connection log message includes that access token. That's bad. Also not needed for anything good. Remove that from the response text sent to the log. Provide the user name and the instance URL values.

Resolve remote fonts

The project uses a bootstrap-based theme, which leverages Roboto from Google. It would be nice to have the font local instead of remote.

Connection switcher does not work

Describe the bug
When connected to multiple orgs the most recent connection is always used.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to two orgs.
  2. Run a basic function against one.
  3. Switch connection selector to the other org.
  4. Re-run function against second org.
  5. You'll get the same response both times.

Expected behavior
Operations should always run against the selected org.

Update Electron to v22

Summary
Electron version 20 is out, this project should be updated to use it.

Known Refactors
Electron 20 adds default support for sandboxing renderer windows. The preload scripts for this project need to refactored to no longer import the list of handlers used for defining the list of send channels. Now that list needs to be hard coded into an array like the receive channels are. You can get the list of functions from the handlers object in the src/electronForce.js file.

Update README Images

Summary
Current readme images are out of date. Would be great to get some updated ones, and a few showing newer features. Generally it's wise to use a Trailhead playground or similar throw away org with all fake data.

Add display of permission set groups

Summary
This should be similar to the existing display of permission sets, but adjusted to pull in the current permission set groups for the org.

It should include:

  • A list of Permission Set Groups and their main metadata.
  • A display of a specific Permission Set Group's detailed information.

Merge console back into main interface to show logging

Summary
The console window is totally useless and adds overhead for very little gain. Recent log messages can be displayed in a popup, and the larger collection of logs stored in the main thread and called when needed.

Add filtering to table displays

Summary
Adding a feature to filter output of tables by a key column like object name.

Describe the solution you'd like
In addition to the find feature in #51, it would be useful to be able to filter the long lists in the tables of results by the name column or some other key context specific field(s).

On Log out remove org from list of active orgs.

When you log out of an org, its connection should be removed from the list of connections. After that last connection is terminated the display should return to the initial setup state of the page.

Fix Screenshots in README file

Describe the bug
All the images in the readme file appear to have stopped working. The images should all be present in the repo so they should be an easy fix.

Add Object Permissions Explorer

Add a what to display all the permissions and access controls for an object (Standard or Custom) and field level controls.

Add API limit information to display

The responses all provide the current API limit information pulled from the response headers by JSForce. But it's not displayed in the interface in a meaningful way.

Add sorting to various table displays

Summary
When looking at the tables it would be helpful to be able to sort them by the columns.

Describe the solution you'd like
For all, or at least most, column headers on the table displays, have them sort on click.

Setup OAuth

Summary

JSForce supports OAuth connections, they should be used.

Is your feature request related to a problem? Please describe.

Using the old security token system is not ideal. OAuth connections would be a better choice for most users.

Solution

Setup to use OAuth connections to Salesforce.

Add Query result paging

Currently query results are just the first page of results, but we should support paging through all results.

Update README Screenshots

The current README screenshots are from an earlier version that displayed both the authentication fields differently and the raw response differently. New screenshots would be helpful.

Picklist Value Lists unreadable

Picklist values are generally unreadable on the object describe displays. It should clearly list the values sorted by, and at least marked as, active and inactive.

Screen Shot 2021-08-01 at 2 28 57 PM

Fetch a list or roles in the org

Summary
Add a call to pull in all of an org's roles and display their information. This should be similar to to existing Permission Set retrieval.

Fix Content Security Policy for images

Describe the bug
Both windows throw an error from an image that's violating policy. Update the content security policy meta tags to resolve.

index.html:1 Refused to load the image 'data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23222' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Fix notice about incorrect Content Security Policy on Console page

Describe the bug
When you start up the app the console window throw a Content Security Policy warning and refuses to load Google fonts.

Refused to load the stylesheet 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

Requires an update to the content policy meta tag. See the main index.html file for solution.

Setup test framework

Summary
Current the project has no automated testing โ€“ it should.

Describe the solution you'd like
I would like to have an automated test framework that works well with electron and can eventually be supported by CircleCI when I get around to setting that up. I have used Mocha and Chai a very little bit on other projects so would default there, but have no strong opinion if you know another framework that might serve the project better.

Refactor render.js to use GenerateTableCell

There are a number of places in render.js that generate table cell nodes. A function has been added to handle that, but the older uses need to be refactored to use the new function.

Render.js Object2ul values only

Describe the bug
Object2ul should display key value pairs, but at least for the object describe field mode it just shows the values.

To Reproduce
Steps to reproduce the behavior:

  1. Log into an org.
  2. Set API selector to Object Describe
  3. Enter an object with Picklists (Account should do), and set the Display fields only checkbox.
  4. Run the query, and review the content of the picklist column

Npm package

Describe the bug
npm install throws an error with the node version 13.11.0

To Reproduce
Steps to reproduce the behavior:

  1. run npm install
  2. npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.0.tgz npm ERR! 404 npm ERR! 404 '[email protected]' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 It was specified as a dependency of 'electronForce' npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. view the following error

Expected behavior
I tried re-installing several times

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) Version 10.15.7 Catalina
    Additional context
    I believe I have solved this by rebuilding the package-lock pr incoming.

Query compare mode

Create a process to run the same query against multiple orgs to compare results.

Helpful to validate data migration between orgs or sandbox and prod

Add mass delete feature

Leverage object describe, limits API, and queries, to create a method for finding and deleting all data in a org. Should allow the user to select which objects will get wiped (listing only those with data) and try to determine a reliable order to attempt deletes.

Should also include a really really clear warning that this is really dangerous 90% of the time.

Detail buttons on PS List don't work

Describe the bug
When attempted to use the buttons on the Permission Set List the describe lookup fails.

To Reproduce
Steps to reproduce the behavior:

  1. Load app
  2. Log into Org
  3. Fetch the permission set list.
  4. Click on one of the detail buttons that appears with the list.
  5. Invalid URL error reported in the raw response area.

Expected behavior
It interface should shift to the detail display for the selected permission set. You can see this behavior by switching to the permission set detail display and entering the name of the permission set. It is worth noting this also triggers the describe query failing above and it runs successfully.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.