Skip to content

added Standard closed label for issues #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,23 @@ <h3 id="scrumHelperHeading" class="text-3xl font-semibold cursor-pointer">Scrum
<br />
<input type="checkbox" id="showOpenLabel" class="form-checkbox text-blue-600">


<label id="checkboxLabel" for="showOpenLabel" class=" font-medium text-sm">Show
Open/Merged/Closed Labels</label>


</div>

<div class="col s12 my-4">
<div class="flex items-center">
<input type="checkbox" id="showCommits" checked class="form-checkbox text-blue-600 ">


<label id="showCommitsLabel" for="showCommits"
class="font-medium text-sm flex items-center pl-5 ml-4" style="margin-left: 4px;">Show commits on open PRs<span
class="tooltip-container">


<i class="fa fa-question-circle question-icon"></i>
<span class="tooltip-bubble">
Github Token required, add it in the settings.
Expand Down
7 changes: 4 additions & 3 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ let yesterdayContributionElement = document.getElementById('yesterdayContributio
let startingDateElement = document.getElementById('startingDate');
let endingDateElement = document.getElementById('endingDate');
let showOpenLabelElement = document.getElementById('showOpenLabel');
let userReasonElement = null; // userReason element removed from UI

let userReasonElement = null;

let showCommitsElement = document.getElementById('showCommits');

function handleBodyOnLoad() {
Expand All @@ -20,7 +22,6 @@ function handleBodyOnLoad() {
'startingDate',
'endingDate',
'showOpenLabel',
'userReason',
'lastWeekContribution',
'yesterdayContribution',
'cacheInput',
Expand Down Expand Up @@ -261,5 +262,5 @@ endingDateElement.addEventListener('change', handleEndingDateChange);
lastWeekContributionElement.addEventListener('change', handleLastWeekContributionChange);
yesterdayContributionElement.addEventListener('change', handleYesterdayContributionChange);
showOpenLabelElement.addEventListener('change', handleOpenLabelChange);
// userReasonElement event listener removed - element no longer exists in UI

document.addEventListener('DOMContentLoaded', handleBodyOnLoad);
18 changes: 16 additions & 2 deletions src/scripts/scrumHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function allIncluded(outputTarget = 'email') {
'<div style="vertical-align:middle;display: inline-block;padding: 0px 4px;font-size:9px;font-weight: 600;color: #fff;text-align: center;background-color: #d73a49;border-radius: 3px;line-height: 12px;margin-bottom: 2px;" class="State State--red">closed</div>';
let issue_opened_button =
'<div style="vertical-align:middle;display: inline-block;padding: 0px 4px;font-size:9px;font-weight: 600;color: #fff;text-align: center;background-color: #2cbe4e;border-radius: 3px;line-height: 12px;margin-bottom: 2px;" class="State State--green">open</div>';
let issue_closed_completed_button =
'<div style="vertical-align:middle;display: inline-block;padding: 0px 4px;font-size:9px;font-weight: 600;color: #fff;text-align: center;background-color: #6f42c1;border-radius: 3px;line-height: 12px;margin-bottom: 2px;" class="State State--purple">closed</div>';
let issue_closed_notplanned_button =
'<div style="vertical-align:middle;display: inline-block;padding: 0px 4px;font-size:9px;font-weight: 600;color: #fff;text-align: center;background-color: #808080;border-radius: 3px;line-height: 12px;margin-bottom: 2px;" class="State State--gray">closed</div>';

function getChromeData() {
console.log("Getting Chrome data for context:", outputTarget);
Expand Down Expand Up @@ -1128,8 +1132,18 @@ ${userReason}`;
if (item.state === 'open') {
li = `<li><i>(${project})</i> - Opened Issue(#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + issue_opened_button : ''}</li>`;
} else if (item.state === 'closed') {
// Always show closed label for closed issues
li = `<li><i>(${project})</i> - Opened Issue(#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + issue_closed_button : ''}</li>`;


// Use state_reason to distinguish closure reason
if (item.state_reason === 'completed') {
li = `<li><i>(${project})</i> - Opened Issue(#${number}) - <a href='${html_url}'>${title}</a> ${issue_closed_completed_button}</li>`;
} else if (item.state_reason === 'not_planned') {
li = `<li><i>(${project})</i> - Opened Issue(#${number}) - <a href='${html_url}'>${title}</a> ${issue_closed_notplanned_button}</li>`;
} else {
li = `<li><i>(${project})</i> - Opened Issue(#${number}) - <a href='${html_url}'>${title}</a> ${issue_closed_button}</li>`;
}


} else {
li =
'<li><i>(' +
Expand Down