diff --git a/src/popup.html b/src/popup.html index 71d83d2..cb74988 100644 --- a/src/popup.html +++ b/src/popup.html @@ -169,13 +169,16 @@

Scrum

+ +
+ Scrum Github Token required, add it in the settings. +
diff --git a/src/scripts/main.js b/src/scripts/main.js index 9dd690d..9a8597a 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -7,7 +7,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() { @@ -33,7 +35,9 @@ function handleBodyOnLoad() { 'startingDate', 'endingDate', 'showOpenLabel', + 'userReason', + 'yesterdayContribution', 'cacheInput', 'githubToken', @@ -229,4 +233,5 @@ showCommitsElement.addEventListener('change', handleShowCommitsChange); endingDateElement.addEventListener('change', handleEndingDateChange); yesterdayContributionElement.addEventListener('change', handleYesterdayContributionChange); showOpenLabelElement.addEventListener('change', handleOpenLabelChange); + document.addEventListener('DOMContentLoaded', handleBodyOnLoad); \ No newline at end of file diff --git a/src/scripts/scrumHelper.js b/src/scripts/scrumHelper.js index 1020555..78bac78 100644 --- a/src/scripts/scrumHelper.js +++ b/src/scripts/scrumHelper.js @@ -70,6 +70,10 @@ function allIncluded(outputTarget = 'email') { '
closed
'; let issue_opened_button = '
open
'; + let issue_closed_completed_button = + '
closed
'; + let issue_closed_notplanned_button = + '
closed
'; function getChromeData() { console.log("[DEBUG] getChromeData called for outputTarget:", outputTarget); @@ -1334,8 +1338,18 @@ ${userReason}`; li = `
  • (${project}) - Opened Issue(#${number}) - ${title}${showOpenLabel ? ' ' + issue_opened_button : ''}
  • `; } else if (item.state === 'closed') { - // Always show closed label for closed issues - li = `
  • (${project}) - Opened Issue(#${number}) - ${title}${showOpenLabel ? ' ' + issue_closed_button : ''}
  • `; + + + // Use state_reason to distinguish closure reason + if (item.state_reason === 'completed') { + li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_completed_button}
  • `; + } else if (item.state_reason === 'not_planned') { + li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_notplanned_button}
  • `; + } else { + li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_button}
  • `; + } + + } else { // Fallback for unexpected state li = `
  • (${project}) - Opened Issue(#${number}) - ${title}
  • `;