tprouvot / Salesforce-Inspector-reloaded

Chrome extension to add a metadata layout on top of the standard Salesforce UI to improve the productivity and joy of Salesforce configuration, development, and integration.
https://chrome.google.com/webstore/detail/salesforce-inspector-relo/hpijlohoihegkfehhibggnkbjhoemldh
MIT License
191 stars 61 forks source link

[popup] Search for Apex Classes in Shortcuts #591

Open mpekacki opened 4 days ago

mpekacki commented 4 days ago

It would be very useful to be able to search for Apex Classes in Shortcuts. Sometimes there is a need to check how a particular class looks in a particular environment (for example, production). The standard Setup menu for classes does not allow for search, only filtering by first letter, and it is hard to use, especially in orgs with a large number of classes. Developer Console is a bit better as it allows searching, but it is not always available due to user permissions, especially in production.

Apex Classes in Shortcuts search results would solve this issue. Class name, namespace prefix (if available) and API version could be displayed. Clicking on the class would redirect to Setup page displaying it (/lightning/setup/ApexClasses/page?address=%2F{ApexClassId}). If there is a concern that the user will be overwhelmed with too many search results, then an option in configuration (default off) could be added.

I've already added the appropriate code to async getMatches(shortcutSearch) in popup.js and tested it locally, so if it's OK I can submit a PR.

tprouvot commented 3 days ago

Hi @mpekacki, Why not !

The only concern I have is the performance for the search. I already had in mind to add an option to let users decide which metadata they want to search for. ie only on profiles but not on flow, or apex classes and custom permissions ..

mpekacki commented 2 days ago

Hi @tprouvot, I tested it in an org with a fairly large number of classes and I did not notice any performance degradation. I also ran queries like SELECT Id, Name FROM ApexClass WHERE Name LIKE '%a%' LIMIT 30 manually and they also perform almost instantly. But having it configurable would be ideal, I can even try to include it in my PR, it that's OK. Would it mean getting rid of metadataShortcutSearch option and replacing it with metadataFlowsShortcutSearch, metadataProfilesShortcutSearch, metadataPermSetsShortcutSearch and metadataApexClassesShortcutSearch?