Skip to content

Commit 9bb4d2b

Browse files
authored
Merge branch 'master' into all-git
2 parents d25b91f + 378540a commit 9bb4d2b

File tree

5 files changed

+1351
-1185
lines changed

5 files changed

+1351
-1185
lines changed

src/index.css

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,5 +416,28 @@ hr,
416416
}
417417

418418
.dark-mode .token-preview-char {
419-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
419+
box-shadow: 0 1px 4px rgba(0,0,0,0.18);
420+
}
421+
422+
.popup-commit-list {
423+
margin: 8px 0 8px 18px;
424+
padding-left: 0;
425+
border-left: 2px solid #e0e7ff;
426+
background: #f8fafc;
427+
border-radius: 6px;
428+
}
429+
.popup-commit-list li {
430+
list-style: none;
431+
margin: 8px 0 8px 0;
432+
padding-left: 0;
433+
}
434+
.popup-commit-list .commit-meta {
435+
color: #64748b;
436+
font-size: 11px;
437+
margin-left: 8px;
438+
}
439+
.popup-commit-list a {
440+
color: #2563eb;
441+
font-weight: 500;
442+
text-decoration: underline;
420443
}

src/popup.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,14 @@ <h4>Organization Name</h4>
140140
</span>
141141
</span>
142142
</div>
143-
<input id="orgInput" type="text"
144-
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2"
145-
placeholder="Enter organization name (default: fossasia)">
143+
<div class="flex items-center mt-4 gap-2">
144+
<input id="orgInput" type="text"
145+
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2"
146+
placeholder="Enter organization name(Default: fossasia)">
147+
<button id="setOrgBtn" type="button"
148+
class="px-5 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-xl text-base my-2 h-[44px] flex-shrink-0"
149+
style="min-width:60px;">Set</button>
150+
</div>
146151
</div>
147152
<div class="">
148153
<div class="flex items-center justify-between">
@@ -169,9 +174,22 @@ <h4>Your Github Token</h4>
169174
<i id="tokenEyeIcon" class="fa fa-eye text-gray-600"></i>
170175
</button>
171176
</div>
172-
<input id="githubToken" type="password"
173-
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2 pr-10"
174-
placeholder="Required for making authenticated requests">
177+
<input id="githubToken" type="password" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2 pr-10" placeholder="Required for making authenticated requests">
178+
179+
180+
181+
<div class="col s12 my-4 ">
182+
<div class="flex items-center gap-2">
183+
<input type="checkbox" id="showCommits" checked class="form-checkbox h-4 w-4 text-blue-600 ">
184+
<label id="showCommitsLabel" for="showCommits" class="text-gray-700 font-medium text-sm flex items-center gap-1 ">Show commits made within date range in Open PRs</label> <span class="tooltip-container">
185+
<i class="fa fa-question-circle question-icon"></i>
186+
<span class="tooltip-bubble">
187+
Github Token required.
188+
</span>
189+
</span>
190+
</div>
191+
</div>
192+
175193
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm font-normal">(in minutes)</span>
176194
<span class="tooltip-container">
177195
<i class="fa fa-question-circle question-icon"></i>
@@ -186,6 +204,7 @@ <h4>Your Github Token</h4>
186204
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2"
187205
placeholder="Write Cache TTL in minutes (Default 10 minutes)">
188206
</div>
207+
189208
<div class="">
190209
<button id="refreshCache"
191210
class="w-full mt-3 bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded flex items-center justify-center gap-2 transition-colors duration-200">

src/scripts/main.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let startingDateElement = document.getElementById('startingDate');
99
let endingDateElement = document.getElementById('endingDate');
1010
let showOpenLabelElement = document.getElementById('showOpenLabel');
1111
let userReasonElement = document.getElementById('userReason');
12+
let showCommitsElement = document.getElementById('showCommits');
1213

1314
function handleBodyOnLoad() {
1415
chrome.storage.local.get(
@@ -24,6 +25,7 @@ function handleBodyOnLoad() {
2425
'yesterdayContribution',
2526
'cacheInput',
2627
'githubToken',
28+
'showCommits',
2729
],
2830
(items) => {
2931
if (items.githubUsername) {
@@ -77,6 +79,12 @@ function handleBodyOnLoad() {
7779
yesterdayContributionElement.checked = true;
7880
handleYesterdayContributionChange();
7981
}
82+
if (items.showCommits){
83+
showCommitsElement.checked = items.showCommits;
84+
} else {
85+
showCommitsElement.checked = false;
86+
handleShowCommitsChange();
87+
}
8088
},
8189
);
8290
}
@@ -123,19 +131,19 @@ function handleLastWeekContributionChange() {
123131
let value = lastWeekContributionElement.checked;
124132
let labelElement = document.querySelector("label[for='lastWeekContribution']");
125133
if (value) {
126-
startingDateElement.readOnly = true;
127-
endingDateElement.readOnly = true;
128-
endingDateElement.value = getToday();
129-
startingDateElement.value = getLastWeek();
130-
handleEndingDateChange();
131-
handleStartingDateChange();
132-
labelElement.classList.add("selectedLabel");
133-
labelElement.classList.remove("unselectedLabel");
134+
startingDateElement.readOnly = true;
135+
endingDateElement.readOnly = true;
136+
endingDateElement.value = getToday();
137+
startingDateElement.value = getLastWeek();
138+
handleEndingDateChange();
139+
handleStartingDateChange();
140+
labelElement.classList.add("selectedLabel");
141+
labelElement.classList.remove("unselectedLabel");
134142
} else {
135-
startingDateElement.readOnly = false;
136-
endingDateElement.readOnly = false;
137-
labelElement.classList.add("unselectedLabel");
138-
labelElement.classList.remove("selectedLabel");
143+
startingDateElement.readOnly = false;
144+
endingDateElement.readOnly = false;
145+
labelElement.classList.add("unselectedLabel");
146+
labelElement.classList.remove("selectedLabel");
139147
}
140148

141149
chrome.storage.local.set({ lastWeekContribution: value });
@@ -241,12 +249,19 @@ function handleUserReasonChange() {
241249
let value = userReasonElement.value;
242250
chrome.storage.local.set({ userReason: value });
243251
}
252+
253+
function handleShowCommitsChange() {
254+
let value = showCommitsElement.checked;
255+
chrome.storage.local.set({ showCommits: value });
256+
}
257+
244258
enableToggleElement.addEventListener('change', handleEnableChange);
245259
githubUsernameElement.addEventListener('keyup', handleGithubUsernameChange);
246260
githubTokenElement.addEventListener('keyup', handleGithubTokenChange);
247261
cacheInputElement.addEventListener('keyup', handleCacheInputChange);
248262
projectNameElement.addEventListener('keyup', handleProjectNameChange);
249263
startingDateElement.addEventListener('change', handleStartingDateChange);
264+
showCommitsElement.addEventListener('change', handleShowCommitsChange);
250265
endingDateElement.addEventListener('change', handleEndingDateChange);
251266
lastWeekContributionElement.addEventListener('change', handleLastWeekContributionChange);
252267
yesterdayContributionElement.addEventListener('change', handleYesterdayContributionChange);

0 commit comments

Comments
 (0)