Enum as Component Param

Hi!

I have made a Shared Component where I am trying to apply an Enum as a Component Param. However, if the Enum parameter input is defined at all (if an Enum is provided as a parameter input) when using the Component, or the Default Value is defined as any of the Enum values or null, an error is shown in Appfarm Dev-Tools under App Validation. If the input is left empty as a parameter or default value, these are all warnings instead. As a result of these errors my conditional styles are not working. Does anyone have any idea what could be the issue?



Hi!

I’ve been working on reproducing your issue and encountered the same error. However, the conditional styles still seem to work on my end, even with the error.

Could you confirm if the conditional styles aren’t working at all for you?

In any case, I’ve reported this bug to the team:)

Emma

The two first images show the definition and the appearance of one instance of use of my component. The two last images show the definition of the component. Without any input to Severity I would assume the background color would be light blue as defined, but it is “Warning Fill” as shown.


image

Here’s another example of the opposite, where I am expecting the conditional style on “Warning” to apply, but it doesn’t. Also, the icon does not come through:
image


Thank you for the additional information! I tried recreating the case again and I experienced the same problem with the conditional styles not working when using an ENUM. The team knows about the bug and it will be taken care of:)

1 Like

Hello! This bug has been fixed in version 117.

1 Like

It appears that most of this was fixed in the new update, but the Icon Value (mentioned in my last post here) is still not affected by the Enum parameter.

My workaround for this is quite cumbersome:

I iterate the Enum and filter so that only the specific Enum I am interested in is iterated. The fix for showing the correct Enum Icon is then simply to use Enum.value as the input value for the Enum parameter, and not the Enum itself. What is very strange is that using a function to return the specific Enum.value OR Enum does NOT work. See pictures below:


The top yellow message is the result of using my workaround, and the below is with just Enum as input.

Hi!

You are right. The functionality you describe is not currently supported by the platform, and I think the workaround you have come up with here is the best solution for now. This feature request was registered internally earlier, and I will note that this has been requested again.

I can’t provide a timeline for this feature right now, but will update this topic when we know more.

1 Like