forked from tomkamphuis/VSODashboardRealBurndown
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.html
128 lines (121 loc) · 4.61 KB
/
configuration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
label {
font-weight: bold;
}
input {
margin-bottom: 10px;
}
input[type="text"] {
width: 100%;
}
select {
width: 100%;
}
</style>
<script src="sdk/scripts/VSS.SDK.min.js"></script>
<script type="text/javascript">
VSS.init({
explicitNotifyLoaded: true,
usePlatformStyles: true
});
VSS.require("TFS/Dashboards/WidgetHelpers", function (WidgetHelpers) {
VSS.register("RealSprintBurndown.Configuration", function () {
var $areaPathInput = $("#area-path");
var $includedFieldsInput = $("#included-fields");
var $projectionLineTypeInput = $("#projection-line-type");
return {
load: function (widgetSettings, widgetConfigurationContext) {
var settings = JSON.parse(widgetSettings.customSettings.data);
if (settings && settings.areaPath) {
$areaPathInput.val(settings.areaPath);
}
if (settings && settings.includedFields) {
$includedFieldsInput.val(settings.includedFields);
}
if (settings && settings.projectionLineType) {
$projectionLineTypeInput.val(settings.projectionLineType);
}
$areaPathInput.on("change", function () {
var customSettings = {
data: JSON.stringify({
areaPath: $areaPathInput.val(),
includedFields: $includedFieldsInput.val(),
projectionLineType: $projectionLineTypeInput.val()
})
};
var eventName = WidgetHelpers.WidgetEvent.ConfigurationChange;
var eventArgs = WidgetHelpers.WidgetEvent.Args(customSettings);
widgetConfigurationContext.notify(eventName, eventArgs);
});
$includedFieldsInput.on("change", function () {
var customSettings = {
data: JSON.stringify({
areaPath: $areaPathInput.val(),
includedFields: $includedFieldsInput.val(),
projectionLineType: $projectionLineTypeInput.val()
})
};
var eventName = WidgetHelpers.WidgetEvent.ConfigurationChange;
var eventArgs = WidgetHelpers.WidgetEvent.Args(customSettings);
widgetConfigurationContext.notify(eventName, eventArgs);
});
$projectionLineTypeInput.on("change", function () {
var customSettings = {
data: JSON.stringify({
areaPath: $areaPathInput.val(),
includedFields: $includedFieldsInput.val(),
projectionLineType: $projectionLineTypeInput.val()
})
};
var eventName = WidgetHelpers.WidgetEvent.ConfigurationChange;
var eventArgs = WidgetHelpers.WidgetEvent.Args(customSettings);
widgetConfigurationContext.notify(eventName, eventArgs);
});
return WidgetHelpers.WidgetStatusHelper.Success();
},
onSave: function() {
var customSettings = {
data: JSON.stringify({
areaPath: $areaPathInput.val(),
includedFields: $includedFieldsInput.val(),
projectionLineType: $projectionLineTypeInput.val()
})
};
return WidgetHelpers.WidgetConfigurationSave.Valid(customSettings);
}
}
});
VSS.notifyLoadSucceeded();
});
</script>
</head>
<body>
<div class="container">
<fieldset>
<label>Area path to sprint items (when empty Project Name]\[Team Name] is used) : </label><br />
<input type="text" value="" id="area-path" />
</fieldset>
<fieldset>
<label>Item states to include in burndown: </label><br />
<input type="text" value="'Committed','In Progress','Ready for Code Review','Ready for test','PO check'" id="included-fields" />
</fieldset>
<fieldset>
<label>Projection line: </label><br />
<select value="none" id="projection-line-type">
<option value="none">No Projection Line</option>
<option value="linear">Linear (based on burn rate to date)</option>
<option value="last3days">Last 3 Days (based on burn rate over last three days)</option>
<option value="ideal">Ideal (based on original ideal burn)</option>
<option value="zero">Zero (full burn to zero points)</option>
<!-- TEST OPTIONS (COMMENT OUT BEFORE PACKAGING)-->
<!-- option value="plus8points">+8 Points (test case: projected points left over)</option -->
<!-- option value="minus8points">-8 Points (test case: projected early finish)</option -->
<!-- END TEST OPTIONS -->
</select>
</fieldset>
</div>
</body>
</html>