Skip to content

Commit a141dc7

Browse files
committed
fixed standalone report bug
Signed-off-by: Vedansh Saini <[email protected]>
1 parent 1ab259b commit a141dc7

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

src/popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</head>
2121
<body>
2222
<div class="pl-1 py-4 rounded-2xl">
23-
<div class="bg-white px-4 py-4 mx-4 mb-2 rounded-3xl">
23+
<div class="bg-white px-4 py-4 mx-2 mb-2 rounded-3xl">
2424
<div class="flex justify-between py-2">
2525
<h3 class="text-3xl font-semibold ">Scrum Helper</h3>
2626
<img src="icons/night-mode.png" alt="Night Mode" class="w-7 h-7 mx-3 cursor-pointer">
@@ -41,7 +41,7 @@ <h3 class="text-3xl font-semibold ">Scrum Helper</h3>
4141
</div>
4242

4343
<div class="rounded-2xl">
44-
<div class=" border-gray-100 border-2 bg-white rounded-3xl px-4 py-4 mx-4 my-2">
44+
<div class=" border-gray-100 border-2 bg-white rounded-3xl px-4 py-4 mx-2 my-2">
4545
<div>
4646
<h4>Your Project Name</h4>
4747
<input id="projectName" type="text" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2" placeholder="Enter your project name">

src/scripts/main.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ function handleBodyOnLoad() {
6060
lastWeekContributionElement.checked = true;
6161
handleLastWeekContributionChange();
6262
}
63-
if (items.gsoc == 1) {
64-
handleGsocClick();
65-
} else {
66-
handleCodeheatClick();
67-
}
6863
},
6964
);
7065
}

src/scripts/popup.js

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,32 +56,64 @@ function toggleRadio(radio){
5656
const startDateInput = document.getElementById('startingDate');
5757
const endDateInput = document.getElementById('endingDate');
5858

59-
6059
if(radio.id === 'lastWeekContribution'){
6160
startDateInput.value = getLastWeek();
6261
endDateInput.value = getToday();
62+
chrome.storage.local.set({
63+
startingDate: startDateInput.value,
64+
endingDate: endDateInput.value,
65+
lastWeekContribution: true,
66+
yesterday: false
67+
}, () => {
68+
window.generateScrumReport();
69+
});
6370
} else {
6471
startDateInput.value = getYesterday();
6572
endDateInput.value = getToday();
73+
chrome.storage.local.set({
74+
startingDate: startDateInput.value,
75+
endingDate: endDateInput.value,
76+
lastWeekContribution: false,
77+
yesterday: true
78+
}, () => {
79+
window.generateScrumReport();
80+
});
6681
}
6782
startDateInput.disabled = endDateInput.disabled = true;
6883
}
6984
document.getElementById('customDateContainer').addEventListener('click', () => {
7085
document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
7186
document.getElementById('startingDate').disabled = false;
7287
document.getElementById('endingDate').disabled = false;
88+
chrome.storage.local.set({
89+
lastWeekContribution: false,
90+
yesterday: false
91+
});
92+
});
93+
94+
document.getElementById('startingDate').addEventListener('change', function() {
95+
chrome.storage.local.set({
96+
startingDate: this.value,
97+
lastWeekContribution: false,
98+
yesterday: false
99+
}, () => {
100+
if (document.getElementById('endingDate').value) {
101+
window.generateScrumReport();
102+
}
103+
});
104+
});
105+
106+
document.getElementById('endingDate').addEventListener('change', function() {
107+
chrome.storage.local.set({
108+
endingDate: this.value,
109+
lastWeekContribution: false,
110+
yesterday: false
111+
}, () => {
112+
if (document.getElementById('startingDate').value) {
113+
window.generateScrumReport();
114+
}
115+
});
73116
});
74-
// Not working properly
75-
// document.getElementById('startingDate').addEventListener('focus', () => {
76-
// document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
77-
// document.getElementById('startingDate').disabled = false;
78-
// document.getElementById('endingDate').disabled = false;
79-
// });
80-
// document.getElementById('endingDate').addEventListener('focus', () => {
81-
// document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
82-
// document.getElementById('startingDate').disabled = false;
83-
// document.getElementById('endingDate').disabled = false;
84-
// });
85117

86118
document.addEventListener('DOMContentLoaded', function() {
87119
const darkModeToggle = document.querySelector('img[alt="Night Mode"]');

0 commit comments

Comments
 (0)