Skip to content

Commit 91b9bf3

Browse files
Merge remote-tracking branch 'remotes/from/ce/main'
2 parents 93d0f8b + 591e963 commit 91b9bf3

File tree

6 files changed

+765
-2
lines changed

6 files changed

+765
-2
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
/vault/plugin_catalog.go @hashicorp/vault-ecosystem
3232

3333
# Content on developer.hashicorp.com
34-
3534
# Web presence gets notified of, and can approve changes to web tooling, but not content.
3635

3736
/website/ @hashicorp/web-presence
@@ -40,7 +39,6 @@
4039
/website/content/
4140

4241
# Education gets notified of, and can approve changes to web content.
43-
4442
/website/data/ @hashicorp/vault-education-approvers
4543
/website/public/ @hashicorp/vault-education-approvers
4644
/website/content/ @hashicorp/vault-education-approvers
@@ -67,6 +65,10 @@
6765
/.github/ @hashicorp/team-vault-quality
6866
/enos/ @hashicorp/team-vault-quality
6967

68+
# Copilot instructions - exceptions to the general .github/ rule
69+
/.github/instructions/ @hashicorp/vault
70+
/.github/copilot-instructions.md @hashicorp/vault
71+
7072
# Cryptosec
7173
/api/auth/cert/ @hashicorp/vault-crypto
7274
/builtin/logical/pki/ @hashicorp/vault-crypto

ui/app/components/tree-chart.hbs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{!
2+
Copyright IBM Corp. 2016, 2025
3+
SPDX-License-Identifier: BUSL-1.1
4+
}}
5+
6+
<div
7+
{{did-insert this.setupChart}}
8+
{{did-update this.updateChart @data}}
9+
{{will-destroy this.destroyChart}}
10+
role="img"
11+
aria-label={{@title}}
12+
data-test-tree-chart={{@title}}
13+
...attributes
14+
/>

ui/app/components/tree-chart.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2025
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import Component from '@glimmer/component';
7+
import { action } from '@ember/object';
8+
import { tracked } from '@glimmer/tracking';
9+
import { TreeChart, TreeChartOptions } from '@carbon/charts';
10+
import '@carbon/charts/styles.css';
11+
12+
// Carbon itself does not define the shape of this data anywhere beyond providing a few dataset examples
13+
interface TreeChartData {
14+
name: string; // Node name
15+
value?: number; // Leaf node value
16+
children?: TreeChartData[];
17+
}
18+
19+
interface Args {
20+
data: TreeChartData[];
21+
options: TreeChartOptions;
22+
title: string;
23+
}
24+
25+
interface CarbonTreeChartSignature {
26+
Element: HTMLElement;
27+
Args: Args;
28+
}
29+
30+
// Partial docs are available here
31+
// https://charts.carbondesignsystem.com/api/classes/treechart
32+
export default class CarbonTreeChart extends Component<CarbonTreeChartSignature> {
33+
@tracked chart: TreeChart | null = null;
34+
35+
@action
36+
setupChart(element: HTMLDivElement): void {
37+
// Create the TreeChart instance
38+
this.chart = new TreeChart(element, {
39+
data: this.args.data,
40+
options: this.args.options,
41+
});
42+
}
43+
44+
@action
45+
updateChart(): void {
46+
if (this.chart) {
47+
// Update the chart with new data
48+
this.chart.model.setData(this.args.data);
49+
}
50+
}
51+
52+
@action
53+
destroyChart(): void {
54+
if (this.chart) {
55+
this.chart.destroy();
56+
this.chart = null;
57+
}
58+
}
59+
}

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
"dependencies": {
219219
"@babel/core": "7.26.10",
220220
"@babel/eslint-parser": "^7.28.5",
221+
"@carbon/charts": "^1.27.2",
221222
"@hashicorp-internal/vault-reporting": "file:vault-reporting/0.8.0.tgz",
222223
"@hashicorp/design-system-components": "4.24.1",
223224
"@hashicorp/design-system-tokens": "3.0.0",

0 commit comments

Comments
 (0)