From c2a7cf2312920c4f9f6f413f7ae49dcdd3f55e5b Mon Sep 17 00:00:00 2001 From: Alisson Oliveira Souza Date: Mon, 26 Jun 2023 16:55:37 -0300 Subject: [PATCH] fix(azure): Fix button now showing up in the new UI --- src/content/visualstudio.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/content/visualstudio.js b/src/content/visualstudio.js index 4c231c23c..9eabecdc4 100644 --- a/src/content/visualstudio.js +++ b/src/content/visualstudio.js @@ -65,3 +65,24 @@ togglbutton.render( } } ); + +togglbutton.render( + '.work-item-form-header:not(.toggl)', + { observe: true }, + function () { + const activeButtonContainer = $('.work-item-header-command-bar')?.firstChild; + const description = $('.work-item-title-textfield input')?.value + const itemId = $('.work-item-form-header')?.children[1]?.textContent + + const link = togglbutton.createTimerLink({ + className: 'visual-studio-online', + description: `${itemId ? itemId + ' ' : ''}${description}`, + projectName: projectSelector, + container: '.work-item-header-command-bar' + }); + + const wrapper = createTag('menu-item'); + wrapper.appendChild(link); + activeButtonContainer.prepend(wrapper); + } +);