Code Monkey home page Code Monkey logo

salesforce-indicators's People

Contributors

coriobriensfdo avatar davidmreed avatar github-actions[bot] avatar jodiem avatar jstvz avatar tschug avatar vickymcl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforce-indicators's Issues

Test Classes

We need some good Test Classes for the Controller for CMDT (#10)

Contains Text

It would be nice to have a feature for Contains Text... eg if a picklist value contains this text, then display this indicator instead., otherwise display the default indicator.

Optional Bundle Items

There are a few moving parts.
The Bundle Items are great if you have a complex set of indicators, but for just starting out they may not be necessary.
It would be great to have Indicator Items directly linked to an Indicator Bundle, then if you need to expand at a later date you can move to Indicator Bundle Items which allows you to re-use the same Indicator Item.

I'm not wedded to this idea so if it's too hard, we can drop it.

${getFieldValue(data, definition)}` === 'true'

This code is weird. It may not be correct. Of course I would love to use getObjectInfo and return dataType for each field but that seems like a lot of work doing another Wire for getObjectInfo and then getting the field data types for that, then matching the field names up, just to get "is this a boolean". I will leave this until I get much more used to using all the different Wire services. But yes, good pickup that it is weird.

Packaging

The Component needs to be packaged so it can be installed in orgs easily.

Preferably using the same tools as other Open Source Commons uses - MetaDeploy (similar to DLRS), however that is now a Discussion item because it is bigger than getting it done in this sprint. See #55

Inverse Font

For light coloured icons, allow an inverse font - eg Black. Not sure how this could be done.

Issue: the app doesn't work when fields is missing on the wire call

Nice application, to see the demo I installed it on my DEV org, didn't work properly as without any modifications I was unable to see anything on the UI.

After adding fields property to wire, this seems to be working and I get one icon on the UI. For now to test just hardcoded the Opportunity.Name
@wire(getRecord, { recordId: '$recordId', fields: ['Opportunity.Name'], optionalfields: '$apiFieldnameDefinitions' })

With Security Enforced

When setting up CMDT (#10) it will use an Apex Controller. Let's ensure we use all the new security trimming features of Apex to ensure that users only see the indicators for the fields they have access to.

This one will need a bit of testing.

Add Alternate Colour for False

Eg if the boolean field is false or the text field is "" (also returns as false) then show the Alternate Colouring - which would need to be an alternate icon.

Eg Is Active = green, Is Not Active = red.

Simplest way would be to change the icon to custom:custom (grey) if False.

Workaround for now is to create 2 fields (if you have enough fields available on your object) one for Is Active and one for Is Inactive

Greater than 0

Currently the Indicators only work on Text values or Boolean values. That is a bit limiting because to do something like Is Donor from the NPSPs rollup of Total No. of Gifts or Total Value of Gifts then you have to add another field to turn that count or dollar value into a Boolean. Whereas if we had an option to say npo02__NumberOfClosedOpps__c is Greater than 0 then we save the users having to create another field just for the Indicator.

This also works well in conjunction with DLRS eg counting the No. of Contacts, No. of Cases, No. of Open Opps to drive indicators like Has Contacts, Has Cases, Has Open Opps.

Simplify the Setup Code

At the moment the code loops through all the settings to a) ensure they have all the same length and to put them all into an object. This part of the code was from another component and it worked, so I left it.
Then in the next bit I take that object and change it into another object adding two new fields.

This seems cumbersome, and the getters and setters seem cumbersome, so I would like to simplify all this at some point.

Need an Other Option for Extensions (or Suppress Indicator for Options)

Scenario
I have a rating of Hot, Warm, Cold.
I only want an indicator on Hot or Warm.
I set both Hot and Warm up as Extensions, and they display fine.
But Cold shows as a "ghost indicator" (text and no colours).

I tried entering an Extension as Rating Other with a Priority of 99 and contains text as * and that doesn't work (the * must be literal, not wildcard).
Entering a FALSE value doesn't work because Cold is still a valid value.

An "Other" option is needed to supress the Indicator.

Another Scenario
I have a Picklist of Active with values Yes or No (not a good field setup choice at all though).
I want an indicator to appear for Contains Yes. but no Indicator to appear for Contains No (or any other option that might be added later, or blank).
I can "work around" this by creating a boolean Formula Field for Is Active, but the excellent point of the Extensions is to not have to create a heap of formula fields.

NOTE: We can set the default Icon to show in all cases, but sometimes you don't want to show an icon at all.
Also, I don't want to have to enter an Extension for each and every picklist value as it is too hard to maintain when I add more picklist values. So I just want an "for anything else, suppress the indicator" option for Extensions.

Not Possible to add one Icon

It's actually not possible to add only one icon due to the way the setup is done. It's not really viable to fix this until #10 is addressed.

Validation Rules

CMDT can have Validation Rules.
One example is that the Object on the Indicator Item must match the object on the Indicator Bundle when adding a Bundle Item.
What other Validation Rules should we have?

Description Field

Do we need a description field on the CMDT or Indicators to help people document their Indicators. Eg DLRS has one.

Setup via CMDT

Yes, it is really flexible doing the setup right on the component but you can't deploy it.

Set up via CMDT would probably be a lot nicer.

LDS Standards - Error Handling

My current error handling and alerting users to any errors is atrocious. We need to do better.
Many of the errors I encounter day to day is due to incorrect field names. CMDT (#10) resolves this one.

What other errors might we encounter and need to deal with in a nice way.

See LDS Error Guidelines

Indicators from Parent Records

With the nature of CMDT (#10) where you choose the field that the Indicator will use, it's not going to be easily possible to have an Indicator say on the Contact that uses a field on the Account (eg Account.IsActive__c).

This is a feature of the current Indicators because of the way the getFieldValue returns the data.

The only way I can think of this for now is that the in the CMDT Item you can choose a different Object and field from that Object, and in the Controller we query both sets of data... It may be a bit too hard though.

The work-around is to build a new field on the child record, but sometimes the 15 object spanning limit gets in the way. If we can't do it we need to document the work-around.

Allow for other fields in CMDT

The Field lookup in CMDT does not handle all fields.
Eg you can't use Country as an Indicator field.
And the combined field of "Shipping Address" does not work.
So it would be good to be able to override the selected field with the API Name of a field.
Note: that may make #43 work too!

LDS Standards - Empty List

We need to conform to the LWC Standards eg for Empty Lists to use an illustration to show that there is an empty list.
This would be if they add the Component to the Page, choose a CMDT record to use, and that CMDT record has no Indicator records assigned to it yet.
The images are only available as SVGs
There is this repo that makes it easier to add an illustration image to the LWC, but it may not be suitable for packaging

Simple Contains

Instead of the big item of #79, would it be easy to have a simple Contains option on the Default value.
That way you don't need to have Extensions unless you need to handle multiple Contains.

So if I had a Contains Yes option on my default Indicator Item configuration it would show the indicator if Yes, but nothing if No or blank.

Use Font Awesome or Similar Icons

I would love to expand the icon availability by using Font Awesome Icons.

https://fontawesome.com/docs/web/add-icons/how-to

There should be a field for icon class and the user will enter something like "fa-solid fa-magnifying-glass" to get the https://fontawesome.com/icons/magnifying-glass?s=solid&f=classic icon.

If an icon class is entered it should override the text choice on the Indicator. The background selected from the Salesforce Icons should still be shown (so if the Salesforce Icon is empty the FA Icon will be shown on its own).

We can limit this to the Free Font Awesome icons. Note we need to satisfy the attribution somewhere. Maybe it can be displayed on the Custom Property Editor when adding the component to the page.

These can be black icons by default (we don't really need to add colour as we want to try to ensure that we stick to Salesforce colours and not have admins making a colour explosion on the page).

Indicator Groups

With CMDT (#10) we need to have different Groups of Indicators (eg Contacts, Accounts, Opportunities, Person Accounts). There can be multiple for each Object.

It would be great to be able to re-use the same Indicators on multiple groups.

Custom Colour Icon

Instead of entering a Salesforce Icon colour, be able to enter a hex colour value to have the Icon show as that colour.
It works with style="background:#000000;" but I don't know if there is a better way now with Styling Hooks or similar

Allow for Indicator Items to be Inactive

It would be great in the CMDT (#10) to have the ability to turn off an Indicator temporarily, but without having to delete the setup that you have done. So having a picklist of Active or Inactive and only showing the Active Indicators would be great.

Add Spacer

Add a Spacer somehow.

Half the width of the icon.
Eg enter "space" in Field Names
Or have another setting for Space after "1;3" for example?
As we loop through the settings, find the space and do not treat it as a Field Name but treat it as a spacer.
But then how do the loop of the HTML to get the spacer in the right position?

Custom UI for setting up CMDT

This is one for the way future...

And you can modify CMDT outside the Salesforce UI in multiple ways now (I like Enabler4Excel best). So it is very much a nice to have.

Maybe start with a proof of concept to do it via a Flow?

List Views, Reports, Field Values

I want a way to show the Indicators in Field values so we can use the same CMDT setup but then show them in a field that can be visible in a report, list view, or on a record.

My first thoughts are an Invocable Apex that returns a value that can be placed into a field via Flow.
But Lightning Avatar does not have a way to output from Apex.
So do we simplify and have only the Text Value or Emoji to return via the Invocable Apex.

So maybe - an invocable Apex that takes in a Bundle Name and then loops through the Bundle Items and returns only the text values and separates them by a customisable separator (like the Concatenation option in DLRS). That might work for a simple use-case for now.

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.