Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added more panel/modal samples to boards, backlogs, sprints, queries
  • Loading branch information
mattiasen1 committed Apr 1, 2025
commit ba4cba33ddf1a60abedcb9bf6a8e9637946c70a3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<script type="text/javascript" src="backlog-board-card-item-menu-panel.js" charset="utf-8"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"contributions": [
{
"id": "backlog-board-card-item-menu-panel",
"type": "ms.vss-web.action",
"targets": [
"ms.vss-work-web.backlog-board-card-item-menu"
],
"properties": {
"text": "Custom card menu item panel",
"uri": "dist/backlog-board-card-item-menu-panel/backlog-board-card-item-menu-panel.html",
"icon": {
"light": "static/asterisk.png",
"dark": "static/asterisk.png"
},
"registeredObjectId": "backlog-board-card-item-menu-panel"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "es6-promise/auto";
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IHostPageLayoutService } from "azure-devops-extension-api";

SDK.register("backlog-board-card-item-menu-panel", () => {
return {
execute: async (context: any) => {
const dialogService = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
dialogService.openPanel(SDK.getExtensionContext().id + ".panel-content", {
title: "Backlog Board Card Item Menu Panel",
description: "Project- and board context",
configuration: {
context: context,
}
})
console.log(context);
}
}
});

SDK.init();
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"properties": {
"text": "Custom card menu item",
"uri": "dist/backlog-board-card-item-menu/backlog-board-card-item-menu",
"uri": "dist/backlog-board-card-item-menu/backlog-board-card-item-menu.html",
"icon": {
"light": "static/asterisk.png",
"dark": "static/asterisk.png"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<script type="text/javascript" src="backlog-item-menu-panel.js" charset="utf-8"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions src/Samples/backlog-item-menu-panel/backlog-item-menu-panel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"contributions": [
{
"id": "backlog-item-menu-panel",
"type": "ms.vss-web.action",
"targets": [
"ms.vss-work-web.backlog-item-menu"
],
"properties": {
"text": "Custom backlog item action panel",
"uri": "dist/backlog-item-menu-panel/backlog-item-menu-panel.html",
"icon": {
"light": "static/asterisk.png",
"dark": "static/asterisk.png"
},
"registeredObjectId": "sample-backlog-item-menu-panel"
}
}
]
}
21 changes: 21 additions & 0 deletions src/Samples/backlog-item-menu-panel/backlog-item-menu-panel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "es6-promise/auto";
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IHostPageLayoutService } from "azure-devops-extension-api";

SDK.register("sample-backlog-item-menu-panel", () => {
return {
execute: async (context: any) => {
const dialogService = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
dialogService.openPanel(SDK.getExtensionContext().id + ".panel-content", {
title: "Backlog Item Menu Panel",
description: "Project-and Backlogs context",
configuration: {
context: context,
}
})
console.log(context);
}
}
});

SDK.init();
1 change: 1 addition & 0 deletions src/Samples/panel-content/panel-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class PanelContent extends React.Component<{}, IPanelContent> {
console.log("SDK is ready, loading project config...");
this.setState({ configuration: SDK.getConfiguration() });
this.loadProjectContext();
SDK.resize(400, 600);
}).catch((error) => {
console.error("SDK ready failed: ", error);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<script type="text/javascript" src="query-result-work-item-menu-panel.js" charset="utf-8"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"contributions": [
{
"id": "query-result-work-item-menu-panel",
"type": "ms.vss-web.action",
"targets": [
"ms.vss-work-web.query-result-work-item-menu"
],
"properties": {
"text": "Custom query result menu item panel",
"uri": "dist/query-result-work-item-menu-panel/query-result-work-item-menu-panel.html",
"icon": {
"light": "static/asterisk.png",
"dark": "static/asterisk.png"
},
"registeredObjectId": "query-result-work-item-menu-panel"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "es6-promise/auto";
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IHostPageLayoutService } from "azure-devops-extension-api";

SDK.register("query-result-work-item-menu-panel", () => {
return {
execute: async (context: any) => {
const dialogService = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
dialogService.openPanel(SDK.getExtensionContext().id + ".panel-content", {
title: "Query result work item menu panel",
description: "Project-and Queries context",
configuration: {
context: context,
}
})
console.log(context);
}
}
});

SDK.init();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<script type="text/javascript" src="work-item-toolbar-menu-modal.js" charset="utf-8"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"contributions": [
{
"id": "work-item-toolbar-menu-modal",
"type": "ms.vss-web.action",
"targets": [
"ms.vss-work-web.work-item-toolbar-menu"
],
"properties": {
"text": "Custom work item toolbar action modal",
"uri": "dist/work-item-toolbar-menu-modal/work-item-toolbar-menu-modal.html",
"icon": {
"light": "static/asterisk.png",
"dark": "static/asterisk.png"
},
"registeredObjectId": "work-item-toolbar-menu-modal"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import "es6-promise/auto";
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IHostPageLayoutService } from "azure-devops-extension-api";

SDK.register("work-item-toolbar-menu-modal", () => {
return {
execute: async (context: any) => {
const dialogService = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
dialogService.openCustomDialog(SDK.getExtensionContext().id + ".panel-content", {
title: "Work item toolbar menu modal",
configuration: {
context: context,
}
})
console.log(context);
}
}
});

SDK.init();