Skip to content

Commit

Permalink
Merge pull request #233 from alejandro5042/UpdateParticipateInRelease…
Browse files Browse the repository at this point in the history
…Capability

Update participate in release capability
  • Loading branch information
humberto-garza authored Mar 12, 2024
2 parents a2c6d2a + 2d62b64 commit 6699cae
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/azdo-pr-dashboard.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==

// @name More Awesome Azure DevOps (userscript)
// @version 3.7.1
// @version 3.7.2
// @author Alejandro Barreto (NI)
// @description Makes general improvements to the Azure DevOps experience, particularly around pull requests. Also contains workflow improvements for NI engineers.
// @license MIT
Expand Down Expand Up @@ -474,8 +474,7 @@
poolAgentsInfoWithCapabilities.value.forEach(agentInfo => {
filteredAgentInfo[agentInfo.name] = {
id: agentInfo.id,
userCapabilities: agentInfo.userCapabilities,
participatesInRelease: agentInfo.systemCapabilities.PARTICIPATES_IN_RELEASE,
userCapabilities: agentInfo.userCapabilities || {},
properties: agentInfo.properties,
};
});
Expand All @@ -492,7 +491,7 @@
agentRows.forEach(agentRow => {
const agentCells = agentRow.querySelectorAll('div');
const agentName = agentCells[1].innerText;
const disableReason = (poolAgentsInfo[agentName].userCapabilities || {}).DISABLE_REASON || null;
const disableReason = poolAgentsInfo[agentName].userCapabilities.DISABLE_REASON || null;

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

const participatesInRelease = agentInfo.participatesInRelease || null;
if (participatesInRelease === '1') {
const participatesInReleaseElement = document.createElement('span');
participatesInReleaseElement.className = 'capability-icon release-machine fabric-icon ms-Icon--Rocket';
participatesInReleaseElement.title = 'PARTICIPATES_IN_RELEASE';
capabilitiesHolder.append(participatesInReleaseElement);
const participateInRelease = agentInfo.userCapabilities.PARTICIPATE_IN_RELEASE || null;
if (participateInRelease === '1') {
const participateInReleaseElement = document.createElement('span');
participateInReleaseElement.className = 'capability-icon release-machine fabric-icon ms-Icon--Rocket';
participateInReleaseElement.title = 'PARTICIPATE_IN_RELEASE=1';
capabilitiesHolder.append(participateInReleaseElement);
}

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

0 comments on commit 6699cae

Please sign in to comment.