Refactor and clean up file handling and processing logic

- Removed the FileRead class from Adaptation.FileHandlers.SPaCe as it was no longer needed.
- Updated TypeScript and JavaScript files to improve the handling of work item updates, including new checks for WeightedShortestJobFirstFibonacci.
- Modified the MESAFIBACKLOG.yml to remove unnecessary file copy tasks.
- Enhanced the FileRead class in Adaptation.Shared to improve directory searching logic.
- Added XML generation functionality to ProcessDataStandardFormat, allowing for better data representation.
- Updated ProcessDataStandardFormatMapping to streamline the creation of mapping instances.
- Cleaned up the project file by removing references to obsolete file handlers.
This commit is contained in:
2025-08-29 15:45:23 -07:00
parent 3c072d177a
commit 68c3a8b5f3
20 changed files with 302 additions and 2070 deletions

View File

@ -144,6 +144,12 @@ function updateRecordCoD(b: any, r: any, t: any, c: any, e: any, w: any, workIte
let timeCriticality = workItem.TimeCriticality;
let riskReductionMinusOpportunityEnablement = workItem.RiskReductionMinusOpportunityEnablement;
let weightedShortestJobFirst = workItem.WeightedShortestJobFirst == undefined ? null : workItem.WeightedShortestJobFirst.toFixed(2);
let weightedShortestJobFirstFibonacci = workItem.WeightedShortestJobFirstFibonacci == undefined ? null : workItem.WeightedShortestJobFirstFibonacci.toFixed(2);
if (weightedShortestJobFirst == null || weightedShortestJobFirstFibonacci == null || weightedShortestJobFirst != weightedShortestJobFirstFibonacci) {
if (weightedShortestJobFirst != weightedShortestJobFirstFibonacci) {
}
}
workItem.CumulativeStoryPoints = ' ';
workItem.TotalStoryPoints = totalStoryPoints + ' User Story Point(s)';
workItem.AbsoluteDelta = data.Effort == undefined || data.Effort.FibonacciAverage == undefined || totalStoryPoints == undefined || totalStoryPoints === 0 ? ' ' : round(Math.abs(data.Effort.FibonacciAverage - ((totalStoryPoints / highestTotalStoryPoints) * 5)), 1);
@ -167,44 +173,55 @@ function updateRecordCoD(b: any, r: any, t: any, c: any, e: any, w: any, workIte
workItem.api = '';
} else {
workItem.api = `
### Work Item Patch ${check} WSJF ${workItem.Id} ${weightedShortestJobFirst} != ${workItem.WeightedShortestJobFirst}
### Work Item Patch ${check} WSJF ${workItem.Id} ${weightedShortestJobFirst} != ${workItem.WeightedShortestJobFirst}
patch {{Factory-Integration}}/_apis/wit/workitems/${workItem.Id}?api-version=7.0
Authorization: Basic {{PAT}}
Content-Type: application/json-patch+json
patch {{Factory-Integration}}/_apis/wit/workitems/${workItem.Id}?api-version=7.0
Authorization: Basic {{PAT}}
Content-Type: application/json-patch+json
[
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.BusinessValue",
"value": "${workItem.BusinessValue}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Scheduling.Effort",
"value": "${workItem.Effort}"
},
{
"op": "replace",
"path": "/fields/Custom.RRminusOE",
"value": "${workItem.RiskReductionMinusOpportunityEnablement}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.TimeCriticality",
"value": "${workItem.TimeCriticality}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJF",
"value": "${workItem.WeightedShortestJobFirst}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJFFib",
"value": "${workItem.WeightedShortestJobFirst}"
}
]`;
[
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.BusinessValue",
"value": "${workItem.BusinessValue}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Scheduling.Effort",
"value": "${workItem.Effort}"
},
{
"op": "replace",
"path": "/fields/Custom.RRminusOE",
"value": "${workItem.RiskReductionMinusOpportunityEnablement}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.TimeCriticality",
"value": "${workItem.TimeCriticality}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJF",
"value": "${workItem.WeightedShortestJobFirst}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJFFib",
"value": "${workItem.WeightedShortestJobFirst}"
}
]
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8; api-version=7.0"
jsonpath "$.id" == ${workItem.Id}
jsonpath "$.fields['Microsoft.VSTS.Common.BusinessValue']" == ${workItem.BusinessValue}
jsonpath "$.fields['Microsoft.VSTS.Scheduling.Effort']" == ${workItem.Effort}
jsonpath "$.fields['Custom.RRminusOE']" == ${workItem.RiskReductionMinusOpportunityEnablement}
jsonpath "$.fields['Microsoft.VSTS.Common.TimeCriticality']" == ${workItem.TimeCriticality}
jsonpath "$.fields['Custom.WSJF']" == ${workItem.WeightedShortestJobFirst}
jsonpath "$.fields['Custom.WSJFFib']" == ${workItem.WeightedShortestJobFirst}`;
}
}
}
@ -276,9 +293,9 @@ function getRecords(b: any, r: any, t: any, c: any, e: any, w: any, data: any, d
return records;
}
function getHtmlTextAndHttp(fromHtml: any, b: any, r: any, t: any, c: any, e: any, w: any, records: any) {
function getHtmlTextAndApi(fromHtml: any, b: any, r: any, t: any, c: any, e: any, w: any, records: any) {
let record;
let http = '';
let api = '';
let lineA = '';
let lineB = '';
let lineC = '';
@ -287,7 +304,7 @@ function getHtmlTextAndHttp(fromHtml: any, b: any, r: any, t: any, c: any, e: an
for (let i = 0; i < records.length; i++) {
record = records[i];
if (record.api !== '') {
http += record.api + '\r\n';
api += record.api + '\r\n';
}
text += record.Id + '\t' +
record.RiskReductionMinusOpportunityEnablement + '\t' +
@ -362,7 +379,7 @@ function getHtmlTextAndHttp(fromHtml: any, b: any, r: any, t: any, c: any, e: an
console.log(text);
html += lineA + lineB + lineC;
}
return { html, text, http };
return { html, text, http: api };
}
const username = '';
@ -425,7 +442,7 @@ fetch(workItems.b)
if (dataA.length > 0)
console.log(dataA[0]);
const records = getRecords(b, r, t, c, e, w, dataA, dataB, workItems);
let result = getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records);
let result = getHtmlTextAndApi(fromHtml, b, r, t, c, e, w, records);
if (result == undefined) { }
})
.catch((e) => console.error(e));

View File

@ -167,44 +167,55 @@ function updateRecordCoD(b, r, t, c, e, w, workItem, highestTotalStoryPoints, da
workItem.api = '';
} else {
workItem.api = `
### Work Item Patch ${check} WSJF ${workItem.Id} ${weightedShortestJobFirst} != ${workItem.WeightedShortestJobFirst}
### Work Item Patch ${check} WSJF ${workItem.Id} ${weightedShortestJobFirst} != ${workItem.WeightedShortestJobFirst}
patch {{Factory-Integration}}/_apis/wit/workitems/${workItem.Id}?api-version=7.0
Authorization: Basic {{PAT}}
Content-Type: application/json-patch+json
patch {{Factory-Integration}}/_apis/wit/workitems/${workItem.Id}?api-version=7.0
Authorization: Basic {{PAT}}
Content-Type: application/json-patch+json
[
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.BusinessValue",
"value": "${workItem.BusinessValue}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Scheduling.Effort",
"value": "${workItem.Effort}"
},
{
"op": "replace",
"path": "/fields/Custom.RRminusOE",
"value": "${workItem.RiskReductionMinusOpportunityEnablement}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.TimeCriticality",
"value": "${workItem.TimeCriticality}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJF",
"value": "${workItem.WeightedShortestJobFirst}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJFFib",
"value": "${workItem.WeightedShortestJobFirst}"
}
]`;
[
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.BusinessValue",
"value": "${workItem.BusinessValue}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Scheduling.Effort",
"value": "${workItem.Effort}"
},
{
"op": "replace",
"path": "/fields/Custom.RRminusOE",
"value": "${workItem.RiskReductionMinusOpportunityEnablement}"
},
{
"op": "replace",
"path": "/fields/Microsoft.VSTS.Common.TimeCriticality",
"value": "${workItem.TimeCriticality}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJF",
"value": "${workItem.WeightedShortestJobFirst}"
},
{
"op": "replace",
"path": "/fields/Custom.WSJFFib",
"value": "${workItem.WeightedShortestJobFirst}"
}
]
HTTP 200
[Asserts]
header "Content-Type" == "application/json; charset=utf-8; api-version=7.0"
jsonpath "$.id" == ${workItem.Id}
jsonpath "$.fields['Microsoft.VSTS.Common.BusinessValue']" == ${workItem.BusinessValue}
jsonpath "$.fields['Microsoft.VSTS.Scheduling.Effort']" == ${workItem.Effort}
jsonpath "$.fields['Custom.RRminusOE']" == ${workItem.RiskReductionMinusOpportunityEnablement}
jsonpath "$.fields['Microsoft.VSTS.Common.TimeCriticality']" == ${workItem.TimeCriticality}
jsonpath "$.fields['Custom.WSJF']" == ${workItem.WeightedShortestJobFirst}
jsonpath "$.fields['Custom.WSJFFib']" == ${workItem.WeightedShortestJobFirst}`;
}
}
}
@ -306,9 +317,9 @@ function sendValue(fromHtml, element, page, id) {
}
}
function getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records) {
function getHtmlTextAndApi(fromHtml, b, r, t, c, e, w, records) {
let record;
let http = '';
let api = '';
let lineA = '';
let lineB = '';
let lineC = '';
@ -317,7 +328,7 @@ function getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records) {
for (let i = 0; i < records.length; i++) {
record = records[i];
if (record.api !== '') {
http += record.api + '\r\n';
api += record.api + '\r\n';
}
text += record.Id + '\t' +
record.RiskReductionMinusOpportunityEnablement + '\t' +
@ -392,7 +403,7 @@ function getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records) {
console.log(text);
html += lineA + lineB + lineC;
}
return { html, text, http };
return { html, text, http: api };
}
function updateSite(c, w) {
@ -430,7 +441,7 @@ function setDocument(fromHtml, b, r, t, c, e, w, dataA, dataB, workItems) {
console.log(dataA.length);
if (dataA.length > 0)
console.log(dataA[0]);
let result = getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records);
let result = getHtmlTextAndApi(fromHtml, b, r, t, c, e, w, records);
if (fromHtml) {
document.getElementById('HeaderGrid').innerHTML = result.html.replaceAll('>null<', '>&nbsp;<');
if (_windowLocationHRef.indexOf('=WSJF') === -1) {
@ -659,7 +670,7 @@ if (typeof document == 'undefined') {
if (dataA.length > 0)
console.log(dataA[0]);
const records = getRecords(b, r, t, c, e, w, dataA, dataB, workItems);
let result = getHtmlTextAndHttp(fromHtml, b, r, t, c, e, w, records);
let result = getHtmlTextAndApi(fromHtml, b, r, t, c, e, w, records);
if (result == undefined) { }
initIndex(fromHtml, username, machineId, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
})