实际上,我试图根据Release和Iteration过滤器计算每个项目的用户故事数及其相关的QA任务(TaskType)。我能够使用SDK 1.32实现它,但是在IE浏览器中,Release和Iteration下拉列表无法正常工作。
另请告诉我是否建议将当前的SDK版本升级到2.0,或者是否有任何解决方法可以解决此问题。
提前致谢
脚本:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta name="Name" content="Project Board" />
<script type="text/javascript" src="/apps/1.32/sdk.js">
</script>
<script type="text/javascript">
function ReleaseDependencies() {
var rallyDataSource;
var cardBoard;
var releaseDropdown;
var table;
var header;
var task_count = 0;
var data = new Array();
var taskData = new Array();
var iterDropdown;
function buildHeaders() {
var tableConfig = {
sortingEnabled: false,
columnKeys: [
'module', 'totstories', 'totcompleted', 'totinprogress',
'totqa', 'totblocked'
],
columnHeaders: [
'MODULE', 'STORIES', 'COMPLETED', 'IN-PROGRESS', 'QA TASKS', 'BLOCKED'
],
columnWidths: ['16%', '16%', '16%', '16%', '16%', '16%']
};
table = new rally.sdk.ui.Table(tableConfig);
}
function destroyTables() {
if (table) {
table.destroy();
}
}
function onReleaseSelected(releases, eventArgs) {
if (iterDropdown) {
iterDropdown.destroy();
destroyTables();
}
var queryConfig = {
label: "Select Iteration "
};
iterDropdown = new rally.sdk.ui.IterationDropdown(queryConfig, rallyDataSource);
iterDropdown.display(document.getElementById("releaseDiv2"), onIterationSelected);
releaseDropdown.addEventListener("onChange", display);
}
function onIterationSelected(releases, eventArgs) {
if (table) {
table.destroy();
}
var queryConfig = {};
findProjects();
iterDropdown.addEventListener("onLoad", findProjects);
iterDropdown.addEventListener("onChange", findProjects);
}
this.display = function() {
destroyTables();
rallyDataSource = new rally.sdk.data.RallyDataSource('1283334',
'2013244650',
'false',
'true');
rally.sdk.ui.AppHeader.showPageTools(true);
releaseDropdown = new rally.sdk.ui.ReleaseDropdown({}, rallyDataSource);
releaseDropdown.display(document.getElementById("releaseDiv"), onReleaseSelected);
};
function findProjects() {
buildHeaders();
var targetReleaseName = releaseDropdown.getSelectedName();
var relCond = '(Release.Name = "_REL_TARGET_")'.replace('_REL_TARGET_', targetReleaseName);
var targetIterationName = iterDropdown.getSelectedName();
var iterCond = '(Iteration.Name = "_ITER_TARGET_")'.replace('_ITER_TARGET_', targetIterationName);
var storyCriteria = '(' + relCond + ' AND ' + iterCond + ')';
rallyDataSource.find({
key: "stories",
type: "hierarchicalrequirement",
query: storyCriteria,
fetch: 'FormattedID,Name,Project,Parent,ScheduleState,Tasks,TaskType'
}, onProjectsRetrieved);
}
function onProjectsRetrieved(results) {
var rowCount = 0;
var proCount = 0;
var proName;
var stateCount = 0;
var progCount = 0;
var n;
var fields;
var fieldLength = 0;
var queryConfigs;
var task_count = 0;
var blocked = 0;
for (var j = 0; j < results.stories.length; j++) {
var abc = results.stories[j].Project.Name;
data.push(abc);
data.sort();
}
data = unique(data);
for (var i = 0; i < data.length; i++) {
table.setCell(rowCount, 'module', data[i]);
var pr = data[i];
rally.forEach(results.stories, function(proj) {
story = proj;
if (proj.Project.Name == pr) {
proCount++;
n = n + proj.Name + "~";
fields = n.split('~');
fieldLength = fields.length - 1;
proName = proj.Project.Name
if (proj.ScheduleState == "Completed") {
stateCount++;
} else if (proj.ScheduleState == "In-Progress") {
progCount++;
}
if (proj.blocked == true) {
blocked++;
}
for (var q = 0; q < story.Tasks.length; q++) {
if (story.Tasks.length > 0) { //if(pr == story.Tasks[q].Project.Name)
if (story.Tasks[q].TaskType == "QA") {
task_count++;
break;
}
}
}
}
});
table.setCell(rowCount, 'totstories', fieldLength);
table.setCell(rowCount, 'totcompleted', stateCount);
table.setCell(rowCount, 'totinprogress', progCount);
table.setCell(rowCount, 'totqa', task_count);
table.setCell(rowCount, 'totblocked', blocked);
rowCount++;
proCount = 0;
stateCount = 0;
progCount = 0;
fieldLength = 0;
task_count = 0;
n = null;
if (blocked > 0) {
blocked = 0;
}
}
table.display(document.getElementById('projects'));
}
var unique = function(origArr) {
var newArr = [],
origLen = origArr.length,
found,
x, y;
for (x = 0; x < origLen; x++) {
found = undefined;
for (y = 0; y < newArr.length; y++) {
if (origArr[x] === newArr[y]) {
found = true;
break;
}
}
if (!found) newArr.push(origArr[x]);
}
return newArr;
}
} //rally.addOnLoad(onLoad);
</script>
<style type="text/css">
#header {
margin-bottom: -22px;
}
</style>
<script type="text/javascript">
function onLoad() {
var releaseDependencies = new ReleaseDependencies();
releaseDependencies.display();
}
rally.addOnLoad(onLoad);
</script>
</head>
<body>
<div id="releaseDiv">
</div>
<div id="releaseDiv2">
</div>
<br/>
<br/>
<div id="projects">
</div>
</body>
</html>
答案 0 :(得分:0)
App SDK 1基于dojo 1.6,正式支持IE 6,7和8. App SDK 1已被弃用一段时间,转而支持App SDK 2.0。如果你能升级那将是理想的解决方案。否则,如果您可以更深入地了解哪些内容无法正常工作以及您遇到问题的具体IE版本可能会找到解决方法。