Skip to content

Commit 6699cae

Browse files
Merge pull request #233 from alejandro5042/UpdateParticipateInReleaseCapability
Update participate in release capability
2 parents a2c6d2a + 2d62b64 commit 6699cae

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/azdo-pr-dashboard.user.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22

33
// @name More Awesome Azure DevOps (userscript)
4-
// @version 3.7.1
4+
// @version 3.7.2
55
// @author Alejandro Barreto (NI)
66
// @description Makes general improvements to the Azure DevOps experience, particularly around pull requests. Also contains workflow improvements for NI engineers.
77
// @license MIT
@@ -474,8 +474,7 @@
474474
poolAgentsInfoWithCapabilities.value.forEach(agentInfo => {
475475
filteredAgentInfo[agentInfo.name] = {
476476
id: agentInfo.id,
477-
userCapabilities: agentInfo.userCapabilities,
478-
participatesInRelease: agentInfo.systemCapabilities.PARTICIPATES_IN_RELEASE,
477+
userCapabilities: agentInfo.userCapabilities || {},
479478
properties: agentInfo.properties,
480479
};
481480
});
@@ -492,7 +491,7 @@
492491
agentRows.forEach(agentRow => {
493492
const agentCells = agentRow.querySelectorAll('div');
494493
const agentName = agentCells[1].innerText;
495-
const disableReason = (poolAgentsInfo[agentName].userCapabilities || {}).DISABLE_REASON || null;
494+
const disableReason = poolAgentsInfo[agentName].userCapabilities.DISABLE_REASON || null;
496495

497496
const rowValue = agentRow.textContent.replace(/[\r\n]/g, '').trim() + disableReason;
498497
if (!regexFilter.test(rowValue)) {
@@ -558,12 +557,12 @@
558557
const capabilitiesHolder = document.createElement('div');
559558
capabilitiesHolder.className = 'capabilities-holder';
560559

561-
const participatesInRelease = agentInfo.participatesInRelease || null;
562-
if (participatesInRelease === '1') {
563-
const participatesInReleaseElement = document.createElement('span');
564-
participatesInReleaseElement.className = 'capability-icon release-machine fabric-icon ms-Icon--Rocket';
565-
participatesInReleaseElement.title = 'PARTICIPATES_IN_RELEASE';
566-
capabilitiesHolder.append(participatesInReleaseElement);
560+
const participateInRelease = agentInfo.userCapabilities.PARTICIPATE_IN_RELEASE || null;
561+
if (participateInRelease === '1') {
562+
const participateInReleaseElement = document.createElement('span');
563+
participateInReleaseElement.className = 'capability-icon release-machine fabric-icon ms-Icon--Rocket';
564+
participateInReleaseElement.title = 'PARTICIPATE_IN_RELEASE=1';
565+
capabilitiesHolder.append(participateInReleaseElement);
567566
}
568567

569568
if (!document.body.classList.contains('agent-arbitration-status-off')) {

0 commit comments

Comments
 (0)