New display conditions and bug fixes

:tada: ADDED - Display conditions for modules

Display conditions are now available for some Jira modules. Using display conditions, you can control the visibility of your app modules in the UI. See the modules reference documentation to know which modules you can use display conditions for.

Run npm install -g @forge/cli@latest on the command line to install the latest CLI version with linting for display conditions.

:wrench: BUG FIX for custom UI resolver types

The return type of custom UI resolvers now accurately reflects that you can return a string. This change prevents inaccurate type errors from showing up when using TypeScript with custom UI.

:wrench: BUG FIX for the UI kit useEffect hook

Weā€™ve fixed a bug where the useEffect hook would be called more than once when called with an empty dependency array.

Run npm install -g @forge/cli@latest on the command line to install the latest CLI version.

7 Likes

I cant find anything about display conditions in https://developer.atlassian.com/platform/forge/manifest-reference/modules - Is it described with other words on the page?

Hi @MWulff, apologies for the delay.

The documentation for display conditions is still in the pipeline for publishing. Please try again in an hour.

Iā€™ll also monitor the publishing, and will let you know here once the docs are published.

Again, apologies for the delay. Thanks so much!

2 Likes

Hi @MWulff,

the documentation for display conditions is published: https://developer.atlassian.com/platform/forge/manifest-reference/display-conditions/

Thanks,
Mateusz

2 Likes

Neat! Thank you @mskrzypkowski

This is exciting news! However I was surprised to not see display conditions based on a custom issue property. This would be a much more powerful mechanism and would allow a developer to toggle their issue panel based on whether custom data is present or no. Atlassian Connect has this feature and itā€™s quite popular.

3 Likes

@DmitryPashkevich We will be delivering more features in further iterations and the one youā€™ve mentioned would be definitely on our list!

3 Likes

Great, thanks for the update!

Unfortunately I experience issues when I use the feature with the following configurations:

__
This still shows a jiraIssue Panel for subtasks:

  jira:issuePanel:
    - key: hello-world-panel
      resource: main
      resolver:
        function: resolver
      viewportSize: large
      title: Hello World
      icon: https://developer.atlassian.com/platform/forge/images/issue-panel-icon.svg
      displayConditions:
          not:
            issueType: Subtask

__
this configuration still shows the panel in projects where no subtask type exists. Therefore nobody should be able to ā€œcanCreateSubtasksā€

  jira:issuePanel:
    - key: hello-world-panel
      resource: main
      resolver:
        function: resolver
      viewportSize: large
      title: Hello World
      icon: https://developer.atlassian.com/platform/forge/images/issue-panel-icon.svg
      displayConditions:
          canCreateSubtasks: true

Am I missing something in the docs? Can you verify this behaviour @mskrzypkowski ?

@JulianWolf most probably you are on the ā€œSub-taskā€ issue type. Try adding the dash, it should help. We will come back with the answer to the second point a bit later, have to check it first.

Edit: The canCreateSubtasks field checks issue permissions to determines whether user has permission to create a sub-task. It doesnā€™t check whether the project supports ā€œsub-taskā€ issue type.

1 Like

Thanks Vitalii! @vpetrychuk

1: This helped. it is issueType: Sub-Task ā€“ dashed case AND case-sensitive: The capital T is important. Maybe we could add the possible array value to the docs.
2: Thank you for the clarification. Do you have an idea how to check whether the project supports ā€œsub-taskā€ issue type using conditions? I think it is not possible with the current conditions.

kind regards
Julian

@JulianWolf Iā€™m glad to hear it worked! We will be working on improving the feature and its docs in the future and your feedback will be taken into account!
About option 2 - it is not possible to do it at the moment using display conditions. You may display a message inside the app that the project doesnā€™t support sub-tasks after checking it using public REST API.

Yup, I solved it using a separate REST call. Thanks for your help.

I appreciate the fast progress in Forge. Conditions are cool! Just a few more crucial features and weā€™ll be able to implement some really promising use cases. Keep the good work up! @vpetrychuk @iceman

1 Like

Hi All!

After run npm install -g @forge/cli@latest, I updated to forge version: 1.0.0. Then forge deploy, I get error:
Error: EACCES: permission denied, open ā€˜/Users/art/Library/Preferences/@forge/cli-nodejs/config.json.1237953050ā€™

What happens could you help me please?

RESOLVED: Need to once run forge from sudo

1 Like