From 198b51b613fefca6a0801c8801c0bc57bcc08e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:34:07 -0700 Subject: [PATCH 01/11] Changed to red, blue, and gray, removed overdue label --- css/content.css | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/css/content.css b/css/content.css index 14005b5..e31267e 100644 --- a/css/content.css +++ b/css/content.css @@ -6,31 +6,19 @@ white-space: nowrap; } -.preview a.label.ss.workflow-state { +.preview a.label.ss.blue { background: #203e64; } -.preview a.label.ss.workflow-state:hover { +.preview a.label.ss.blue:hover { background: #11213e; } -.preview a.label.ss.important { +.preview a.label.ss.red { background-color: hsl(349, 69%, 46%); } -.preview a.label.ss.missing-tags { - background-color: #f39300; +.preview a.label.ss.goals { + background-color: #b7b7b7; } -.preview .time-overrun { - background: #a71f39; - color: white; - font-size: 8px; - padding: 0 5px; - border-radius: 20px; - position: absolute; - top: 25px; - line-height: 11px; - left: 22px; - font-weight: bold; -} From 258a8948556522b58529797f7015aa595b96ee14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:44:05 -0700 Subject: [PATCH 02/11] Update content.js --- src/content.js | 132 ++++++++----------------------------------------- 1 file changed, 21 insertions(+), 111 deletions(-) diff --git a/src/content.js b/src/content.js index cd536ab..f2ae106 100644 --- a/src/content.js +++ b/src/content.js @@ -38,10 +38,9 @@ chrome.extension.sendMessage({}, function(response) { if (collapsedStories.length) { Array.prototype.forEach.call(collapsedStories, function (story) { var storySelector = story.parentNode; - highlightWorkflowStates(storySelector); - highlightImportantTags(storySelector); + highlightBlueStates(storySelector); + highlightRedTags(storySelector); detectMergeDeployTags(storySelector); - detectTimeIssues(storySelector); }); } @@ -53,11 +52,11 @@ chrome.extension.sendMessage({}, function(response) { /** * Highlights tags which contain workflow states. */ - function highlightWorkflowStates(story) { + function highlightPlannerStates(story) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(?:on hold|questions|awaiting|^to)\b/)) { - label.classList.add('ss', 'workflow-state'); + if (label.textContent.match(/\b(?:planner|needs-estimate)\b/)) { + label.classList.add('ss', 'blue'); } }); } @@ -74,125 +73,36 @@ chrome.extension.sendMessage({}, function(response) { if (!storyAccepted) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(?:blocked|hot lead|blocker|high priority|urgent priority)\b/)) { - label.classList.add('ss', 'important'); + if (label.textContent.match(/\b(?:blocked|needs|needs-|urgent\b/)) { + label.classList.add('ss', 'red'); } }); } } - - - /** - * Finds stories where logged time higher than estimate. + + /** + * Highlights tags which contain goal-based labels. + * productivity, analytics, etc. */ - function detectTimeIssues(story) { - var estimation = story.querySelector('.meta'); - var spentTime = story.querySelector('.everhour-stat'); - if (estimation !== null && spentTime !== null) { - var pts = estimation.textContent; - if (pts >= 0) { - var time = spentTime.textContent.split(' '); - var minutes = 0; - var hours = 0; - - // If time has only 1 param, means that it has only minutes. - // Otherwise - hours and minutes. - if (time.length == 1) { - minutes = parseInt(time[0]); - } - else { - hours = parseInt(time[0]); - minutes = parseInt(time[1]); - } + function highlightGoalTags(story) { - // Care only about huge overruns. - var estimated = pts * 6 * 60 + 60; - var current = hours * 60 + minutes; - if (estimated < current) { - if (story.querySelector('.time-overrun') === null) { - story.insertAdjacentHTML('beforeend', 'overrun'); - } + // We care about important tags as long as it is not accepted. + var storyAccepted = story.classList.contains('accepted'); + if (!storyAccepted) { + var labels = story.querySelectorAll('a.label'); + Array.prototype.forEach.call(labels, function(label) { + if (label.textContent.match(/\b(goal-b/)) { + label.classList.add('ss', 'gray'); } - } + }); } } - - /** - * Checks for merging / deployment workflow. - */ - function detectMergeDeployTags(story) { - // We care about merging only when story is accepted. - var storyAccepted = story.classList.contains('accepted'); - var storyHasBody = story.querySelector('.name') !== null; - if (!storyAccepted || !storyHasBody) { - return; } + var live = false; - // Make sure that the story has the right section and we haven't - // already processed it. - var bodySection = story.querySelector('.name'); - var hasMissingTags = bodySection.querySelector('.missing-tags') !== null; - if (hasMissingTags) { - return; - } - var hasBranch = false; - var hasToMergeTag = false; - var hasMergedTag = false; - var hasToDeployTag = false; - var hasDeployedTag = false; - // Loop through all labels of this story. - var labels = story.querySelectorAll('a.label'); - Array.prototype.forEach.call(labels, function (label) { - - // Check if the label is in format "b:branchname". - var regexp = new RegExp('^b:', 'i'); - if (label.textContent.match(regexp)) { - hasBranch = true; - } - - // Check if the label is "to merge". - regexp = new RegExp('^(to merge)', 'i'); - if (label.textContent.match(regexp)) { - hasToMergeTag = true; - } - - // Check if the label is "merged". - regexp = new RegExp('^(merged)', 'i'); - if (label.textContent.match(regexp)) { - hasMergedTag = true; - } - - // Check if the label is "to deploy". - regexp = new RegExp('^(to deploy)', 'i'); - if (label.textContent.match(regexp)) { - hasToDeployTag = true; - } - - // Check if the label is "deployed". - regexp = new RegExp('^(deployed)', 'i'); - if (label.textContent.match(regexp)) { - hasDeployedTag = true; - } - }); - - var warnings = []; - - if (hasBranch) { - if (!hasToMergeTag && !hasMergedTag) { - warnings.push('merge'); - } - - if (!hasToDeployTag && !hasDeployedTag) { - warnings.push('deploy'); - } - } - - if (warnings.length) { - bodySection.insertAdjacentHTML('beforeend', 'notice: missing ' + warnings.join(', ') + ' tags'); - } } } }, 10); From ae99f64d3959c0f1e734af7325a287b291986dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:48:06 -0700 Subject: [PATCH 03/11] Update content.js --- src/content.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/content.js b/src/content.js index f2ae106..1111b89 100644 --- a/src/content.js +++ b/src/content.js @@ -38,9 +38,9 @@ chrome.extension.sendMessage({}, function(response) { if (collapsedStories.length) { Array.prototype.forEach.call(collapsedStories, function (story) { var storySelector = story.parentNode; - highlightBlueStates(storySelector); - highlightRedTags(storySelector); - detectMergeDeployTags(storySelector); + highlightPlannerTags(storySelector); + highlightImportantTags(storySelector); + highlightGoalsTags(storySelector); }); } @@ -52,7 +52,7 @@ chrome.extension.sendMessage({}, function(response) { /** * Highlights tags which contain workflow states. */ - function highlightPlannerStates(story) { + function highlightPlannerTags(story) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { if (label.textContent.match(/\b(?:planner|needs-estimate)\b/)) { @@ -94,13 +94,6 @@ chrome.extension.sendMessage({}, function(response) { if (label.textContent.match(/\b(goal-b/)) { label.classList.add('ss', 'gray'); } - }); - } - } - - } - var live = false; - } From 17da6fe8ef2aec1202217e55fdaf6b8ab3ebc33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:48:31 -0700 Subject: [PATCH 04/11] Update content.css --- css/content.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/content.css b/css/content.css index e31267e..8d27278 100644 --- a/css/content.css +++ b/css/content.css @@ -18,7 +18,7 @@ background-color: hsl(349, 69%, 46%); } -.preview a.label.ss.goals { +.preview a.label.ss.gray { background-color: #b7b7b7; } From 64a1f5d1ac4251d9bb4660f94354929486df1bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:50:33 -0700 Subject: [PATCH 05/11] Update content.js --- src/content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content.js b/src/content.js index 1111b89..1177b1d 100644 --- a/src/content.js +++ b/src/content.js @@ -50,12 +50,12 @@ chrome.extension.sendMessage({}, function(response) { /** - * Highlights tags which contain workflow states. + * Highlights planner stories that need estimate. */ function highlightPlannerTags(story) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(?:planner|needs-estimate)\b/)) { + if (label.textContent.match(/\b(?:planner|estimate)\b/)) { label.classList.add('ss', 'blue'); } }); From 276a439661fd4f0025551aa9a72f1c4c13697dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:52:39 -0700 Subject: [PATCH 06/11] Update README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d8d4616..c7ab390 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ -# Red Labels for Pivotal Tracker +# Simbi Labels for Pivotal Tracker -This Chrome extension for SystemSeed workflow tweaks in Pivotal Tracker. +This Chrome extension for Simbi workflow tweaks in Pivotal Tracker. ## Taxonomy Any of these labels on stories will turn blue: -- paused -- on hold -- blocked -- to +- planner +- estimate Any of these labels on stories will turn red: -- urgent priority -- high priority +- blocked +- needs- +- urgent + +Any of these labels on stories will turn gay: +- goal- From fbf9bb7af18f1ba88f4eee7f9cb0319f8524a188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:53:21 -0700 Subject: [PATCH 07/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7ab390..1bf1b87 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,5 @@ Any of these labels on stories will turn red: - needs- - urgent -Any of these labels on stories will turn gay: +Any of these labels on stories will turn gray: - goal- From 43108e527b4df73a62586ff42194050a0ff56a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:54:42 -0700 Subject: [PATCH 08/11] Update manifest.json --- manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 0b87ade..00e5c85 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { - "name": "SystemSeed PT", - "version": "1.7", + "name": "Simbi PT", + "version": "1.0", "manifest_version": 2, - "author": "Ev Maslovskiy", - "description": "Provides integration between SystemSeed workflow and Pivotal Tracker.", - "homepage_url": "https://github.com/spleshka/SystemSeed-PT", + "author": "Carlos Arguello", + "description": "Provides integration between Simbi's workflow and Pivotal Tracker.", + "homepage_url": "https://github.com/cjarguello/simbi-labels-pt", "icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", @@ -15,7 +15,7 @@ "*://www.pivotaltracker.com/*" ], "browser_action": { - "default_title": "SystemSeed PT", + "default_title": "Simbi PT", "default_icon": "icons/icon16.png" }, "content_scripts": [ From fe35ee613b7addb3268cda26a8d9aaad37f9fa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 17:55:34 -0700 Subject: [PATCH 09/11] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 00e5c85..134c2e4 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "manifest_version": 2, "author": "Carlos Arguello", "description": "Provides integration between Simbi's workflow and Pivotal Tracker.", - "homepage_url": "https://github.com/cjarguello/simbi-labels-pt", + "homepage_url": "https://github.com/cjarguello/simbi-labels-for-pivotal-tracker", "icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", From 35b689921b3805c8511c1b20ca79c0a72915d4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=2E=20Arg=C3=BCello?= Date: Sun, 30 Apr 2017 18:01:13 -0700 Subject: [PATCH 10/11] Update inject.js --- src/inject.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/inject.js b/src/inject.js index d64deee..dfd02be 100644 --- a/src/inject.js +++ b/src/inject.js @@ -30,18 +30,8 @@ function injectTemplateButton(node) { function generateTasks(e) { var tasks = [ - '**===== TECHNICAL CONCEPT =====**', + '**===== CHECKLIST FOR ACCEPTANCE =====**', '- TDB', - '**===== DEFINITION OF DONE =====**', - '- Acceptance criteria is confirmed by the client', - '- Story meets acceptance criteria', - '- Story includes post deploy steps (where applicable)', - '- Story includes testing steps', - '- Code passes automated tests / code checks (where applicable)', - '- Story is tested and peer reviewed (where applicable)', - '- Story has test coverage (where applicable)', - '- Story is documented', - '- Story is accepted by the client', '**===== TESTING STEPS =====**', '- **Test 1:** TBD' ]; From 00dbb5c6d761f0a00f8b9ac1f878417c70cd9828 Mon Sep 17 00:00:00 2001 From: Artem Kozaev Date: Mon, 1 May 2017 22:43:01 +0300 Subject: [PATCH 11/11] Fixes missing brackets in regexp --- css/content.css | 1 - src/content.js | 27 ++++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/css/content.css b/css/content.css index 8d27278..163dde8 100644 --- a/css/content.css +++ b/css/content.css @@ -21,4 +21,3 @@ .preview a.label.ss.gray { background-color: #b7b7b7; } - diff --git a/src/content.js b/src/content.js index 1177b1d..3779d84 100644 --- a/src/content.js +++ b/src/content.js @@ -19,28 +19,28 @@ chrome.extension.sendMessage({}, function(response) { * Add observer handler. */ observer.observe(document, config); + var handleMutationEvents = function handleMutationEvents(mutation) { Array.prototype.forEach.call(mutation.addedNodes, processStories); processStories(mutation.target); }; - /** * Main entry point to loop through all stories and to process them. */ var processStories = function processStories(node) { - if (typeof node.querySelectorAll == 'undefined') { + if (typeof node.querySelectorAll == 'undefined') return; - } // Loop through every collapsed story. var collapsedStories = node.querySelectorAll('header.preview'); + if (collapsedStories.length) { Array.prototype.forEach.call(collapsedStories, function (story) { var storySelector = story.parentNode; highlightPlannerTags(storySelector); highlightImportantTags(storySelector); - highlightGoalsTags(storySelector); + highlightGoalTags(storySelector); }); } @@ -55,9 +55,8 @@ chrome.extension.sendMessage({}, function(response) { function highlightPlannerTags(story) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(?:planner|estimate)\b/)) { + if (label.textContent.match(/\b(?:planner|estimate)\b/)) label.classList.add('ss', 'blue'); - } }); } @@ -73,14 +72,13 @@ chrome.extension.sendMessage({}, function(response) { if (!storyAccepted) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(?:blocked|needs|needs-|urgent\b/)) { + if (label.textContent.match(/\b(?:blocked|needs|needs-|urgent)\b/)) label.classList.add('ss', 'red'); - } }); } } - - /** + + /** * Highlights tags which contain goal-based labels. * productivity, analytics, etc. */ @@ -91,12 +89,11 @@ chrome.extension.sendMessage({}, function(response) { if (!storyAccepted) { var labels = story.querySelectorAll('a.label'); Array.prototype.forEach.call(labels, function(label) { - if (label.textContent.match(/\b(goal-b/)) { + if (label.textContent.match(/goal-b/)) label.classList.add('ss', 'gray'); - } - - + }) + } } } - }, 10); + }, 100); });