Skip to content

Commit 8418184

Browse files
committed
First draft version
1 parent 35dfe38 commit 8418184

File tree

9 files changed

+266
-63
lines changed

9 files changed

+266
-63
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
*.zip

base.css

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ body {
1313
text-decoration-skip-ink: auto;
1414
}
1515

16+
a {
17+
text-decoration: none;
18+
color: inherit;
19+
}
20+
1621
.wrapper {
1722
display: flex;
1823
position: relative;
1924
overflow: hidden;
25+
flex-direction: column;
26+
}
27+
28+
.wrapper--form {
29+
max-width: 600px;
30+
margin: 40px auto;
2031
}
2132

2233
.tabs {
@@ -53,7 +64,7 @@ body {
5364
}
5465

5566
.container {
56-
width: 200px;
67+
width: 240px;
5768
padding: 16px;
5869
}
5970
.container div {
@@ -90,6 +101,17 @@ button {
90101
justify-content: center;
91102
}
92103

104+
.button-group {
105+
display: flex;
106+
}
107+
108+
.button-group button:first-child {
109+
margin-right: 4px;
110+
}
111+
112+
.button-group button:last-child {
113+
margin-left: 4px;
114+
}
93115
button svg {
94116
margin-right: 8px;
95117
}
@@ -179,6 +201,7 @@ form button svg {
179201
margin-right: 0;
180202
}
181203
hr {
204+
width: 100%;
182205
border: 0;
183206
height: 1px;
184207
border-top: 1px solid #f4f5f7;
@@ -187,3 +210,29 @@ hr {
187210
#config {
188211
cursor: pointer;
189212
}
213+
214+
.wrapper--form h1 {
215+
font-size: 26px;
216+
font-weight: 700;
217+
}
218+
219+
.form {
220+
width: 100%;
221+
padding: 20px 0 20px;
222+
margin: 0 auto;
223+
display: flex;
224+
flex-direction: column;
225+
}
226+
227+
.form button[type="submit"] {
228+
margin: 20px 0 0;
229+
}
230+
231+
.form-control {
232+
padding-bottom: 8px;
233+
}
234+
235+
#messages {
236+
color: green;
237+
font-weight: 700;
238+
}

images/get_started128.png

16.4 KB
Loading

manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "GoJIRA",
3-
"version": "1.0-alpha",
4-
"description": "JIRA browser extension to provides useful tools to manage your dashboards and direct links to your most used JIRA dashboards, such as your current sprint, backlog and quickly access any ticket using its id.",
5-
"permissions": ["activeTab", "tabs", "declarativeContent", "storage"],
3+
"version": "0.0.1",
4+
"description": "JIRA browser extension to provides useful tools to manage your dashboards and direct links to your most used JIRA dashboards.",
5+
"permissions": ["activeTab", "declarativeContent", "storage"],
66
"options_page": "options.html",
77
"background": {
88
"scripts": ["background.js"],
9-
"persistent": false
9+
"persistent": true
1010
},
1111
"page_action": {
1212
"default_popup": "popup.html",

options.html

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,13 @@
44
<link rel="stylesheet" type="text/css" href="base.css" />
55
</head>
66
<body>
7-
<div class="wrapper">
8-
<form id="configForm">
9-
<div>
10-
<label for="jiraBasePath">Your Jira domain</label>
11-
<input
12-
name="jiraBasePath"
13-
id="jiraBasePath"
14-
placeholder="https://your-jira.atlassian.net/"
15-
/>
16-
</div>
17-
<div>
18-
<label for="jiraCompanyName">Company name</label>
19-
<input name="jiraCompanyName" id="jiraCompanyName" />
20-
</div>
21-
<div>
22-
<label for="jiraCompanyLogo">Your company logo url</label>
23-
<input name="jiraCompanyLogo" id="jiraCompanyLogo" />
24-
</div>
7+
<div class="wrapper wrapper--form">
8+
<h1>&#x1f996; GoJIRA</h1>
9+
<p>Configure the extension to be a productivity raptor!</p>
10+
<hr />
11+
<form id="configForm" class="form">
12+
<div id="form"></div>
13+
<div id="messages"></div>
2514
<button type="submit">Save</button>
2615
</form>
2716
</div>

options.js

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,63 @@
1-
"use strict";
1+
const INPUT_FORM = [
2+
{
3+
label: "Your JIRA domain",
4+
name: "basePath",
5+
placeholder: "https://your-jira.atlassian.net/",
6+
type: "url",
7+
},
8+
{
9+
label: "Your company name",
10+
name: "companyName",
11+
},
12+
{
13+
label: "Company logo URL",
14+
name: "companyLogo",
15+
placeholder: "https://...../logo.png",
16+
type: "url",
17+
},
18+
{
19+
label: "Board ID",
20+
name: "boardId",
21+
placeholder: "Number in url ...RapidBoard.jspa?rapidView=4471",
22+
type: "number",
23+
},
24+
];
25+
26+
const INPUT_KEYS = INPUT_FORM.map(({ name }) => name);
227

328
const configForm = document.getElementById("configForm");
4-
const jiraBasePath = document.getElementById("jiraBasePath");
5-
const jiraCompanyName = document.getElementById("jiraCompanyName");
6-
const jiraCompanyLogo = document.getElementById("jiraCompanyLogo");
29+
const messages = document.getElementById("messages");
30+
const form = document.getElementById("form");
31+
32+
const genForm = (values) =>
33+
(form.innerHTML = INPUT_FORM.map(
34+
({ name, label, type, placeholder }) => `
35+
<div class="form-control">
36+
<label for="${name}">${label}</label>
37+
<input
38+
value="${values?.[name] || ""}"
39+
type="${type || "text"}"
40+
name="${name}"
41+
id="${name}"
42+
placeholder="${placeholder || ""}"
43+
/>
44+
</div>
45+
`
46+
));
747

8-
chrome.storage.sync.get(
9-
["basePath", "companyName", "companyLogo"],
10-
({ basePath, companyName, companyLogo }) => {
11-
jiraBasePath.setAttribute("value", basePath || "");
12-
jiraCompanyName.setAttribute("value", companyName || "");
13-
jiraCompanyLogo.setAttribute("value", companyLogo || "");
14-
}
15-
);
48+
chrome.storage.sync.get(INPUT_KEYS, (values) => genForm(values));
1649

1750
configForm.onsubmit = (event) => {
1851
event.preventDefault();
19-
const jiraBasePathValue = jiraBasePath?.value;
20-
const jiraCompanyNameValue = jiraCompanyName?.value;
21-
const jiraCompanyLogoValue = jiraCompanyLogo?.value;
52+
messages.innerHTML = "";
2253

23-
chrome.storage.sync.set({
24-
basePath: jiraBasePathValue,
25-
companyName: jiraCompanyNameValue,
26-
companyLogo: jiraCompanyLogoValue,
27-
});
54+
chrome.storage.sync.set(
55+
{
56+
basePath: document.getElementById("basePath")?.value,
57+
companyName: document.getElementById("companyName")?.value,
58+
companyLogo: document.getElementById("companyLogo")?.value,
59+
boardId: document.getElementById("boardId")?.value,
60+
},
61+
() => (messages.innerHTML = "<span>Config updated!</span>")
62+
);
2863
};

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "gojira",
3+
"version": "0.0.1",
4+
"description": "JIRA browser extension to provides useful tools to manage your dashboards and direct links to your most used JIRA dashboards.",
5+
"main": "background.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"zip": "zip -r gojira.zip ."
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/klaufel/gojira.git"
13+
},
14+
"keywords": [],
15+
"author": "",
16+
"license": "ISC",
17+
"bugs": {
18+
"url": "https://github.com/klaufel/gojira/issues"
19+
},
20+
"homepage": "https://github.com/klaufel/gojira#readme"
21+
}

popup.html

Lines changed: 78 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
<div class="wrapper">
88
<div class="overlay" id="overlay"></div>
99
<div class="tabs" id="tabs">
10-
<a
11-
target="_blank"
12-
href="chrome-extension://idjehedljgdkpmkkohomccmgkmnoakdj/options.html"
13-
>Configure extension</a
14-
>
10+
<a target="_blank" href="options.html">Configure extension</a>
1511
</div>
1612
<div class="container">
1713
<div id="companyInfo"></div>
@@ -23,6 +19,7 @@
2319
name="viewTaskId"
2420
id="viewTaskId"
2521
placeholder="Ticket ID..."
22+
required
2623
/>
2724
<button type="submit">
2825
<svg
@@ -129,9 +126,78 @@
129126
View backlog
130127
</button>
131128
</div>
132-
133-
<div>
134-
<button id="expandOpenTasks">Expand 'OPEN' tickets</button>
129+
<hr />
130+
<div class="button-group">
131+
<button id="expandOpenTasks">
132+
<svg
133+
width="24"
134+
height="24"
135+
viewBox="0 0 24 24"
136+
focusable="false"
137+
role="presentation"
138+
style="transform: rotate(90deg)"
139+
>
140+
<path
141+
fill="currentColor"
142+
fill-rule="evenodd"
143+
d="M14.995 10.995a1 1 0 0 1 0 1.414l-4.593 4.593a.99.99 0 0 1-1.4-1.4l3.9-3.9-3.9-3.9a.99.99 0 0 1 1.4-1.4l4.593 4.593z"
144+
></path>
145+
</svg>
146+
Open
147+
</button>
148+
<button id="expandClosedTickets">
149+
<svg
150+
width="24"
151+
height="24"
152+
viewBox="0 0 24 24"
153+
focusable="false"
154+
role="presentation"
155+
style="transform: rotate(90deg)"
156+
>
157+
<path
158+
fill="currentColor"
159+
fill-rule="evenodd"
160+
d="M14.995 10.995a1 1 0 0 1 0 1.414l-4.593 4.593a.99.99 0 0 1-1.4-1.4l3.9-3.9-3.9-3.9a.99.99 0 0 1 1.4-1.4l4.593 4.593z"
161+
></path>
162+
</svg>
163+
Closed
164+
</button>
165+
</div>
166+
<div class="button-group">
167+
<button id="expandAllTickets">
168+
<svg
169+
width="24"
170+
height="24"
171+
viewBox="0 0 24 24"
172+
focusable="false"
173+
role="presentation"
174+
style="transform: rotate(90deg)"
175+
>
176+
<path
177+
fill="currentColor"
178+
fill-rule="evenodd"
179+
d="M14.995 10.995a1 1 0 0 1 0 1.414l-4.593 4.593a.99.99 0 0 1-1.4-1.4l3.9-3.9-3.9-3.9a.99.99 0 0 1 1.4-1.4l4.593 4.593z"
180+
></path>
181+
</svg>
182+
All
183+
</button>
184+
<button id="collapseAllTickets">
185+
<svg
186+
width="24"
187+
height="24"
188+
viewBox="0 0 24 24"
189+
focusable="false"
190+
role="presentation"
191+
style="transform: rotate(-90deg)"
192+
>
193+
<path
194+
fill="currentColor"
195+
fill-rule="evenodd"
196+
d="M14.995 10.995a1 1 0 0 1 0 1.414l-4.593 4.593a.99.99 0 0 1-1.4-1.4l3.9-3.9-3.9-3.9a.99.99 0 0 1 1.4-1.4l4.593 4.593z"
197+
></path>
198+
</svg>
199+
All
200+
</button>
135201
</div>
136202
<hr />
137203
<div
@@ -142,12 +208,11 @@
142208
align-items: center;
143209
"
144210
>
145-
<small id="config">Change the workspace</small>
146-
<a
147-
href="chrome-extension://idjehedljgdkpmkkohomccmgkmnoakdj/options.html"
148-
target="_blank"
149-
style="line-height: 0"
211+
<!--<small id="config">Change the workspace</small>-->
212+
<a href="https://github.com/klaufel/gojira" target="_blank"
213+
><small>Be a productivity raptor!</small></a
150214
>
215+
<a href="options.html" target="_blank" style="line-height: 0">
151216
<svg
152217
width="24"
153218
height="24"

0 commit comments

Comments
 (0)