Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrjo committed Dec 31, 2018
1 parent f9aab10 commit e406131
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 92 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

A version the built-in Release Tracking board with additional filters.

## Test Plan
### List of Features
* PASS - Shows all features in current project
* PASS - Show all features in all projects
* PASS - Milestone filter shows all features in current project
* PASS - Milestone filter shows all features in all projects
* PASS - Ancestor filters shows all features in current project
* PASS - Ancestor filters shows all features in any project
* PASS - Saved view

### Board of features


## Development Notes

### First Load
Expand Down
12 changes: 6 additions & 6 deletions deploy/Ugly.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "release-tracking-with-filters",
"version": "0.0.5",
"version": "1.0.0",
"scripts": {
"debug": "grunt debug",
"debug:watch": "nodemon --exec grunt debug",
Expand All @@ -9,7 +9,7 @@
"deploy-debugsdk:watch": "nodemon --exec grunt deploy-debugsdk"
},
"dependencies": {
"@agile-central-technical-services/utils-ancestor-pi-inline-filter": "^1.0.13",
"@agile-central-technical-services/utils-ancestor-pi-inline-filter": "^1.0.15",
"@agile-central-technical-services/utils-shared-views": "^1.0.2"
},
"devDependencies": {
Expand Down
50 changes: 24 additions & 26 deletions src/javascript/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Ext.define("release-tracking-with-filters", {
var gridArea = this.down('#grid-area');
var grid = this.down('rallygridboard');
if (gridArea && grid) {
grid.setHeight(gridArea.getHeight() - 30)
grid.setHeight(gridArea.getHeight())
}
return;
var boardArea = this.down('#board-area');
Expand Down Expand Up @@ -325,7 +325,7 @@ Ext.define("release-tracking-with-filters", {
context: this.getContext(),
modelNames: this.modelNames,
toggleState: 'grid',
height: gridArea.getHeight() - 30,
height: gridArea.getHeight(),
listeners: {
scope: this,
viewchange: this._update,
Expand All @@ -341,7 +341,7 @@ Ext.define("release-tracking-with-filters", {
modelNames: this.modelNames,
inlineFilterPanelConfig: {
quickFilterPanelConfig: {
context: allProjectsContext,
dataContext: allProjectsContext,
portfolioItemTypes: this.portfolioItemTypes,
modelName: this.lowestPiTypePath,
whiteListFields: [
Expand Down Expand Up @@ -390,12 +390,15 @@ Ext.define("release-tracking-with-filters", {
},
listeners: {
scope: this,
// TODO (tj) support multi item selection
/*
itemclick: function(grid, record, item, index) {
// Ignore clicks on non root items
if (record.get('_type') == this.lowestPiTypePath.toLowerCase()) {
this._onPiSelected(record);
}
}
*/
}
}
});
Expand All @@ -412,10 +415,16 @@ Ext.define("release-tracking-with-filters", {
}
}, this);
// If there are no PIs, then explicitly filter out all stories
this.storiesFilter = Rally.data.wsapi.Filter.or(queries) || [{
this.storiesFilter = Rally.data.wsapi.Filter.or(queries) || Rally.data.wsapi.Filter.and({
property: 'ObjectID',
value: 0
}];
});

// Only consider direct Feature children (not nested stories)
this.storiesFilter = this.storiesFilter.and({
property: 'Parent',
value: null
});

var boardPromise = this._addPisBoard(this.storiesFilter, this.currentIterations).then({
scope: this,
Expand Down Expand Up @@ -553,6 +562,10 @@ Ext.define("release-tracking-with-filters", {
return card.getRecord();
});
}.bind(this),
getVisibleCard: function(card) {
var cards = this._getCardsForCard(card);
return cards[0];
}.bind(this),
listeners: {
scope: this,
fieldclick: function(fieldName, card) {
Expand Down Expand Up @@ -587,6 +600,10 @@ Ext.define("release-tracking-with-filters", {
value: null
}];
}
filters.push({
property: 'Project',
value: context.project
})
Rally.ui.popover.PopoverFactory.bake({
field: 'UserStory',
record: feature,
Expand All @@ -595,7 +612,8 @@ Ext.define("release-tracking-with-filters", {
listViewConfig: {
gridConfig: {
storeConfig: {
filters: filters
filters: filters,
context: context,
},
columnCfgs: Constants.STORY_COLUMNS,
}
Expand Down Expand Up @@ -825,26 +843,6 @@ Ext.define("release-tracking-with-filters", {
return this.getContext().getScopedStateId(modelName + '-' + id);
},

getHeight: function() {
var el = this.getEl();
if (el) {
var height = this.callParent(arguments);
return Ext.isIE8 ? Math.max(height, 600) : height;
}

return 0;
},

setHeight: function(height) {
this.callParent(arguments);
if (this.grid) {
this.grid.setHeight(height);
}
if (this.board) {
this.board.setHeight(height);
}
},

getSettingsFields: function() {
return [{
xtype: 'rallycheckboxfield',
Expand Down
60 changes: 14 additions & 46 deletions src/javascript/utils/FeatureStoriesDependenciesPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ Ext.define('FeatureStoriesDependenciesPopover', {
extend: Rally.ui.popover.DependenciesPopover,

titleIconCls: null,
title: 'Stories and their Dependencies',

constructor: function() {
this.callParent(arguments);
},
title: 'Stories With Dependencies',

constructor: function(config) {
var numPredecessors = 0,
Expand Down Expand Up @@ -49,7 +45,9 @@ Ext.define('FeatureStoriesDependenciesPopover', {
}];

this.loaded = {};
this.callParent(arguments);
//this.callSuper(arguments);
// Get super super method (skip the extended DependenciesPopover.constructor()
return this.superclass.superclass['constructor'].apply(this, arguments);
},

_loadData: function(tabTitle) {
Expand Down Expand Up @@ -79,17 +77,23 @@ Ext.define('FeatureStoriesDependenciesPopover', {
_.each(stories, function(story) {
story.tplType = this._getType(story);
var dependencies = story.get(fieldName).Stories;
html.push(this.rowTpl.apply(story));
if (dependencies && dependencies.length) {
// Add a row for each dependency
// Add a row for the story
html.push(this.rowTpl.apply(story));
// Add a row for each story dependency
_.each(dependencies, function(dependentStory) {
dependentStory.set('_dependencyType', fieldName);
html.push(this.depRowTpl.apply(dependentStory))
}, this);
}
else {
// Don't show stories with no dependencies
/*
// Add a "None" row
html.push(this.noneRowTpl.apply(story))
html.push(this.noneRowTpl.apply({
_dependencyType: fieldName
}));
*/
}
}, this);

Expand Down Expand Up @@ -201,49 +205,13 @@ Ext.define('FeatureStoriesDependenciesPopover', {
noneRowTpl: Ext.create('Ext.XTemplate',
'<div class="dependency-row ts-dependent-story">',
'<div class="identifier">',
'<span class="{[this.getDependencyIconClass(values.data)]}"></span>',
'<span class="{[this.getDependencyIconClass(values)]}"></span>',
'None',
'</div>',
'<div class="status">',
'<tpl if="this.isUserStory(values)">',
'</div>',
'<tpl else>',
'</div>',
'<tpl if="this.hasReleaseAttr(values.data)">',
'<tpl else>',
'<span>&nbsp;</span>',
'</tpl>',
'</tpl>',
'</div>', {
getDependencyIconClass: function(record) {
return record._dependencyType == 'Predecessors' ? 'icon-predecessor' : 'icon-successor'
},
isUserStory: function(record) {
return true;
},
getFormattedIdTemplate: function(data) {
return Ext.create('Rally.ui.renderer.template.FormattedIDTemplate', {
showIcon: true,
showHover: false
}).apply(data);
},
getScheduleState: function(record) {
return Ext.create('Rally.ui.renderer.template.ScheduleStateTemplate', {
field: record.getField('ScheduleState')
}).apply(record.data);
},
getPercentDoneByStoryCount: function(record) {
return Ext.create('Rally.ui.renderer.template.progressbar.PercentDoneByStoryCountTemplate', {
field: record.getField('PercentDoneByStoryCount'),
record: record
}).apply(record.data);
},
trimText: function(data, max, defaultValue) {
return data && data.Name ? Ext.String.ellipsis(data.Name, max) : defaultValue;
},
hasReleaseAttr: function(data) {
return data.hasOwnProperty('Release');
}
}
),
});
40 changes: 32 additions & 8 deletions src/javascript/utils/StoryFeatureCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,33 @@ Ext.define('StoryFeatureCard', {
];
},

reRender: function(highlight) {
// Convert reRender calls into a re-render of the primary feature card
if (this.hidden) {
var primaryCard = this.getVisibleCard(this);
primaryCard.reRender(highlight);
primaryCard._onReady(primaryCard);
}
else {
this.callParent(arguments)
this._onReady(this);
}
},

_onReady: function(card) {
var stories = this.getAllFeatureStories(this);
this.storyCount = stories.length;
this.acceptedStoryCount = 0;
this.storiesHaveDependencies = false;
_.each(stories, function(story) {
if (story.get('AcceptedDate')) {
this.acceptedStoryCount = this.acceptedStoryCount + 1
}

var predSuc = story.get('PredecessorsAndSuccessors')
if (predSuc && predSuc.Count) {
this.storiesHaveDependencies = true
}
}, this);
this.update(this._buildFinalHtml());
this._addFinalListeners();
Expand Down Expand Up @@ -60,7 +79,7 @@ Ext.define('StoryFeatureCard', {
return html.join('\n');
},

_buildFinalHtml: function() {
_buildFinalHtml: function(stories) {
var record = this.getRecord();
var feature = record.get(this.lowestPiTypeName);
var html = [];
Expand All @@ -69,8 +88,7 @@ Ext.define('StoryFeatureCard', {
html.push('<td class="ts-card-content">' + this._getFeatureColor() + '</td>');
html.push('<td class="ts-card-content ts-formatted-id"><div class="field-content">' + this.feature.FormattedID + '</div></td>');
html.push('<td class="ts-card-content ts-card-icons">');
var predSuc = record.get('PredecessorsAndSuccessors')
if (predSuc && predSuc.Count) {
if (this.storiesHaveDependencies) {
html.push('<span class="field-content FeatureStoriesPredecessorsAndSuccessors icon-children"></span>');
}
var featurePred = feature.Predecessors;
Expand All @@ -86,25 +104,31 @@ Ext.define('StoryFeatureCard', {

_addFinalListeners: function() {
var el = this.getEl();
var storyIcon = el.down('.ts-accepted-count')
if (storyIcon) {
storyIcon.on('click', function() {
var table = el.down('.ts-card-table')
if (table) {
table.on('click', function(event, target, options) {
this.fireEvent('story', this);
}, this);
}
var predSucIcon = el.down('.FeatureStoriesPredecessorsAndSuccessors');
if (predSucIcon) {
predSucIcon.on('click', function(event, target, options) {
this.fireEvent('fieldclick', 'FeatureStoriesPredecessorsAndSuccessors', this);
return false;
}, this, {
card: this
card: this,
stopPropagation: true // Prevent stories popup from also showing
});
}
var featurePredSucIcon = el.down('.FeaturePredecessorsAndSuccessors');
if (featurePredSucIcon) {
featurePredSucIcon.on('click', function() {
this.fireEvent('fieldclick', 'FeaturePredecessorsAndSuccessors', this);
}, this);
return false;
}, this, {
card: this,
stopPropagation: true // Prevent stories popup from also showing
});
}
}
});
15 changes: 14 additions & 1 deletion src/javascript/utils/TsGridboardProjectScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,22 @@ Ext.define('TsGridboardProjectScope', {
this.value = newValue
this.saveState(); // Force a state save before callers notified
this.cmp.fireEvent('viewstatesave', this); // This gets buffered
this.fireEvent('select', newValue);
var me = this;
// Work around an issue where this component doesn't reliably reset saved view
setTimeout(function() {
me.fireEvent('select', newValue);
}, 100)
},
},
removeCls: function(cls) {
var me = this,
el = me.rendered ? me.el : me.protoEl;
// Workaround bug where there is no el or protoEl for this control cmp
if (el) {
el.removeCls.apply(el, arguments);
}
return me;
},
}, this.controlConfig)
},

Expand Down
1 change: 1 addition & 0 deletions src/javascript/utils/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ext.override(Rally.ui.cardboard.plugin.CardPopover, {
showFeaturePredecessorsAndSuccessors: function() {
return this._createPopover({
field: 'PredecessorsAndSuccessors',
title: 'Portfolio Item Dependencies',
//width: 750,
record: this.card.getFeature(this.card),
offsetFromTarget: [{ x: 0, y: -8 }, { x: 15, y: 0 }, { x: 5, y: 15 }, { x: -15, y: 0 }],
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# yarn lockfile v1


"@agile-central-technical-services/utils-ancestor-pi-inline-filter@^1.0.13":
version "1.0.13"
resolved "https://registry.yarnpkg.com/@agile-central-technical-services/utils-ancestor-pi-inline-filter/-/utils-ancestor-pi-inline-filter-1.0.13.tgz#6ffdeea1ec43e9b64353d73766f39c2a7c4e5afb"
"@agile-central-technical-services/utils-ancestor-pi-inline-filter@^1.0.15":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@agile-central-technical-services/utils-ancestor-pi-inline-filter/-/utils-ancestor-pi-inline-filter-1.0.15.tgz#8754fb90af50d59229fd161487c8a8b8c905f2f3"

"@agile-central-technical-services/utils-shared-views@^1.0.2":
version "1.0.2"
Expand Down

0 comments on commit e406131

Please sign in to comment.