issueContext display based on project configuration

Hello,

I have a issueContext module in my Forge app. The user has a project level configuration page where they can opt to show or not to show the panel created by the issueContext. This configuration is saved in Forge key-value store. Looking at the documentation I didn’t see how could I check the value dinamically in order to show or hide the panel altogether (i. e.: not showing the panel at all, not just an empty panel).

Did I miss anything? Is there any way to achieve this behavior?

Thanks.

If I understood your requirements properly, you want to display/load or not your module depending on some business rules.
For this, you need to use the displayConditions of the module, but it cannot access values in Forge KV storage.
A possible work-around is to set a value into an issue property at the same time you write into the KV storage, then use entityPropertyEqualTo from the displayConditions.

I have no idea if it works, so I will be happy if you can report your finding here.

1 Like

Hi @SilvreLestang,

Yes, that I was trying to achieve. The workaround works. I have added a project property and used the following displayConditions in my component:

displayConditions:
        entityPropertyEqualTo:
          entity: project
          propertyKey: showMyPanel
          objectName: enabled
          value: "true"

It’s worth noting that the value should be a string. Otherwise, the forge lint will mark it as an error.

1 Like