Permalink
Browse files

Add code to inject override for epic auto completion.

This change makes it so epics are not auto marked and sorted
based upon completion of stories.  This helps to make it easier
to use epics to manage groups of stories.
  • Loading branch information...
1 parent 1d711c8 commit 1d505f600f6b153a9c77bc758bc1b07d42fa74d7 @abierbaum abierbaum committed Mar 9, 2013
Showing with 52 additions and 4 deletions.
  1. +4 −2 Gruntfile.js
  2. +26 −0 extension/epic_overrides.js
  3. +3 −1 extension/manifest.json
  4. +16 −0 extension/src/pt_tweak_main.js
  5. +3 −1 jshintrc
View
@@ -39,14 +39,16 @@ module.exports = function(grunt) {
jshintrc: 'jshintrc'
},
build : ['Gruntfile.js'],
- app : ['extension/src/*.js', '!**/rearrange_panels.js']
+ app : ['extension/src/*.js', 'extension/*.js', '!**/rearrange_panels.js']
};
/** WATCH:
* provide a fast development watch and a slower full everything watch.
*/
config.watch = {
full : {
- files : ['Gruntfile.js', 'extension/*.json', 'extension/src/*.js'],
+ files : ['Gruntfile.js', 'extension/*.json',
+ 'extension/src/*.js',
+ 'extension/*.js'],
tasks : ['build']
}
};
@@ -0,0 +1,26 @@
+/*
+* Overrides for epics.
+*
+* This file has to be injected into the page context.
+*
+* Notes:
+* - EpicsWidgetSource: Seems to be the place epics are partitioned to display
+* - Epic: Main class for epics and holds the content.
+*/
+if(window.app) {
+ console.log('Loading Epic Overrides');
+ var project = window.app.project;
+
+ console.log('Project', project);
+ console.log('Epic', Epic);
+
+ // Override the isDone and isAccepted to make PT
+ // treat all Epics the same with no auto completion
+ Epic.prototype.isDone = function() {
+ return false;
+ };
+ Epic.prototype.isAccepted = function() {
+ return false;
+ };
+
+}
@@ -23,7 +23,9 @@
}
],
- "web_accessible_resources": [],
+ "web_accessible_resources": [
+ "epic_overrides.js"
+ ],
"permissions": [
"tabs"
@@ -1 +1,17 @@
console.log('PT Tweaks Loading');
+
+/**
+* Helper method to inject scripts into a page.
+*/
+function inject_script(scriptFile) {
+ var s = document.createElement('script');
+ s.src = chrome.extension.getURL(scriptFile);
+ s.onload = function() {
+ this.parentNode.removeChild(this);
+ };
+ (document.head||document.documentElement).appendChild(s);
+}
+
+
+// --- INJECT SCRIPTS --- //
+inject_script('epic_overrides.js');
View
@@ -24,6 +24,8 @@
"devel": true,
"globals": {
- "_": false
+ "_": false,
+ "chrome": false,
+ "Epic": false
}
}

0 comments on commit 1d505f6

Please sign in to comment.