Skip to content

Commit 31e3f3d

Browse files
authored
ARC 2044 - Create page modules to show in the connect sidebar at all times (#27)
1 parent b037d81 commit 31e3f3d

16 files changed

+194
-35
lines changed

src/routes/atlassian-connect.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ export const connectAppDescriptor = {
111111
}
112112
],
113113

114+
/**
115+
* Defines the new sections in the application menus.
116+
*
117+
* https://developer.atlassian.com/cloud/jira/platform/modules/web-section/
118+
*/
119+
webSections: [
120+
{
121+
key: "addon-web-section",
122+
location: "admin_plugins_menu",
123+
name: {
124+
value: "Connect Sample Node App"
125+
}
126+
}
127+
],
128+
114129
/**
115130
* The list of pages/views within the app.
116131
* https://developer.atlassian.com/cloud/jira/software/modules/page/
@@ -202,6 +217,22 @@ export const connectAppDescriptor = {
202217
name: {
203218
"value": "Atlassian Marketplace"
204219
}
220+
},
221+
/**
222+
* The postInstall page is defined here again with a different key and a different location
223+
*
224+
* Key has to be unique, so used a different one for this
225+
* Location is pointing to the key defined in the webSection module
226+
*
227+
* This ensures that this page will always have Jira's left sidebar opened for this page
228+
*/
229+
{
230+
url: "/",
231+
key: "acn-home",
232+
name: {
233+
value: "Introduction"
234+
},
235+
location: "admin_plugins_menu/addon-web-section"
205236
}
206237
]
207238
}

src/views/api-requests.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
API Requests
44
{{#content}}
5-
<div id="makingApiRequests" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="makingApiRequests" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/authentication.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
Authentication with JWT and Storage
44
{{#content}}
5-
<div id="authWithJwtAndStorage" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="authWithJwtAndStorage" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/config.squirrelly

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
{{#title}}
33
Connect JSON
44
{{#content}}
5-
<br/>
6-
<br/>
7-
<button class="aui-button" data-connect-module-key="acn-introduction">Home</button>
8-
<br/>
9-
<br/>
10-
<div id="atlassianConnectJson" data-page-content="{{ it.pageContent.toString() }}""></div>
11-
<br/>
12-
<pre class="config-container">{{ it.config }}</pre>
13-
<br/>
14-
<br/>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="atlassianConnectJson" data-page-content="{{ it.pageContent.toString() }}"></div>
9+
<br/>
10+
<pre class="config-container">{{ it.config }}</pre>
11+
</div>
1512
{{/extendsFile}}

src/views/connect-js.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
Connect Library
44
{{#content}}
5-
<div id="connectLibrary" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="connectLibrary" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/layout.squirrelly

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
<head>
44
<title>{{ it.title }}</title>
55
<meta charset="UTF-8">
6-
<link rel="stylesheet" href="https://unpkg.com/@atlaskit/css-reset/dist/bundle.css" media="all">
6+
<!-- AUI is being used for styling here [https://aui.atlassian.com/aui/latest/docs/getting-started.html]
7+
Please replace this if you want to add your own css frameworks -->
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aui/9.5.1/aui/aui-prototyping.min.css" />
79
<link rel="stylesheet" href="/public/css/main.css" media="all">
8-
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aui/9.5.1/aui/aui-prototyping.min.css" />-->
10+
<link rel="stylesheet" href="/public/css/sidebar.css" media="all">
11+
<link rel="stylesheet" href="/public/css/back-nav.css" media="all">
12+
913
<!-- This script is needed for all the views in the connect app -->
1014
<script src="https://connect-cdn.atl-paas.net/all.js" data-options="sizeToParent:true" async></script>
1115
</head>

src/views/lifecycle-events.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
Lifecycle Events
44
{{#content}}
5-
<div id="lifecycleEvents" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="lifecycleEvents" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/marketplace.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
API Requests
44
{{#content}}
5-
<div id="marketplace" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="marketplace" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/modules.squirrelly

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{{#title}}
33
Connect modules
44
{{#content}}
5-
<div id="connectModulesForJira" data-page-content="{{ it.pageContent }}"></div>
5+
{{@includeFile('./partial/sidebar.squirrelly') /}}
6+
<div>
7+
{{@includeFile('./partial/back-nav.squirrelly') /}}
8+
<div id="connectModulesForJira" data-page-content="{{ it.pageContent }}"></div>
9+
</div>
610
{{/extendsFile}}

src/views/partial/back-nav.squirrelly

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="acn-header" data-connect-module-key="acn-introduction">
2+
<span class="aui-icon aui-icon-small aui-iconfont-arrow-left">back</span>
3+
<span class="acn-header-text">Back to Introduction</span>
4+
</div>

0 commit comments

Comments
 (0)