Forge application with multiple global pages

Hi,

I’m migrating my Connect app to Forge with Custom UI.
My app has two completely different features, and I want to include them in two separate global pages.
The structure of my project is:

/App
	/src  						--> Server
		...

	/static/					--> Front-end
	  	/functionality-1/
		    /public
		    	index.html		--> Load necessary .js  and .css libraries
		    	/css
		    		...
		    	/js
		    		...
		    	/images
		    		...
		    /src
		    	index.js
		    	App.js

	  	/functionality-2/
		    /public
		    	index.html		--> Load necessary .js and .css libraries
		    	/css
		    		...
		    	/js
		    		...
		    	/images
		    		...
		    /src
		    	index.js
		    	App.js

Only one global page module can be declared in the manifest.yml, which means I can only declare one resource.
Currently, my manifest.yml has the structure:

modules:
  jira:globalPage:
      - key: functionality-1-global-page
        resource: functionality-1
        resolver:
          function: resolver
        title: Functionalities
        layout: blank
        icon: https://developer.atlassian.com/platform/forge/images/issue-panel-icon.svg
        pages:
          - title: Functionality-1
            route: functionality-1
          - title: Functionality-2
            route: functionality-2
resources:
  - key: functionality-1
    path: static/functionality-1/build
  - key: functionality-2
    path: static/functionality-2/build

.....

I can see both global pages, but:

  1. ‘Functionality-1’ always loads when navigating to either of them from another location, for example, from IssueNavigator.
  2. Once on a ‘Functionality-X’ page, for example, ‘Functionality-2’, if I click on ‘Functionality-1’, it does nothing; it’s as if it doesn’t detect the URL change and doesn’t change the page.

How should this be specified in the manifest.yml to support loading different resources? Can you provide some guidelines on how this could be done?

Thank you very much.

That’s not supported, unfortunately - you’ll need one root page that can interpret the url and show the appropriate UI - as https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-global-page/#subpages says

The sidebar will only change the global page URL, you will need to handle routes inside your app using view.createHistory()

1 Like

Thank you very much for your reply. I’ll try it as you suggested.

Hi @jhazelwood,

I’ve been looking into what you were telling me. That solves the navigation problem. That’s fine when the functionality are related and share resources (CSS, JS, etc.), but in my case, each of my pages has a different feature and requires different resources.

With routing, I would be forced to load the resources for both functionalities on the “root” page, since the resource is unique to the “root” page, which would make loading very slow.

I’ve looked at different modules, and I don’t see the option to load resources for each page.

With routing, I would be forced to load the resources for both functionalities on the “root” page, since the resource is unique to the “root” page, which would make loading very slow.

I’m afraid so.