[PR #6742] [MERGED] [management] Add dashboard_features account setting #28869

Closed
opened 2026-08-05 08:07:05 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6742
Author: @mlsmaycon
Created: 7/12/2026
Status: Merged
Merged: 7/12/2026
Merged by: @mlsmaycon

Base: mainHead: feature/dashboard-features-setting


📝 Commits (2)

  • 8639e99 [management] Add dashboard_features account setting for per-section visibility
  • 1e1d20b [management] Document false and omitted behavior for dashboard_features.agent_network

📊 Changes

7 files changed (+126 additions, -0 deletions)

View changed files

📝 management/server/http/handlers/accounts/accounts_handler.go (+10 -0)
📝 management/server/http/handlers/accounts/accounts_handler_test.go (+32 -0)
📝 management/server/store/sql_store.go (+8 -0)
📝 management/server/store/sql_store_test.go (+30 -0)
📝 management/server/types/settings.go (+27 -0)
📝 shared/management/http/api/openapi.yml (+10 -0)
📝 shared/management/http/api/types.gen.go (+9 -0)

📄 Description

Describe your changes

Adds a per-account dashboard_features setting: a nullable object that overrides
which dashboard sections are shown for an account. It serializes to a single
JSON column so new sections can be added later as struct fields with no schema
change and no new pgx loader plumbing.

This is the backend for making the Agent Network menu available to existing
accounts (reusing the netbird.ai signup flow), and the general mechanism the
dashboard will use to control other sections (DNS, Reverse Proxy, Networks)
per account later. It starts with a single key, agent_network — when true the
Agent Network menu is shown for the account even without the deployment feature
flag. agent_network_only (the focused-view mode) stays a separate flag.

  • types.Settings.DashboardFeatures *DashboardFeatures (+ Copy)
  • dashboard_features / AccountDashboardFeatures in the OpenAPI spec,
    types.gen.go regenerated
  • request/response mapping in the accounts handler (PUT/GET /accounts)
  • pgx GetAccount loader updated to select, scan, and unmarshal the JSON
    column — without it the field silently reads empty in production
  • store round-trip test (set → persist → explicit false → persist) and a
    handler case setting dashboard_features.agent_network

Absent keys follow the default dashboard behavior, so the change is additive and
backward-compatible.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Additive account-setting plumbing surfaced only through the dashboard; the raw
API field is generated into the API reference automatically.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features
    • Added per-account dashboard feature overrides.
    • Introduced an agent_network toggle to control Agent Network menu visibility per account.
    • Updated account settings APIs (and schema) to accept and return dashboard_features.
  • Bug Fixes
    • Ensured dashboard_features are correctly loaded from and saved to persistence.
    • Account settings responses now include the dashboard feature override values.
  • Tests
    • Added coverage for updating and persisting dashboard feature overrides.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6742 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/12/2026 **Status:** ✅ Merged **Merged:** 7/12/2026 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `feature/dashboard-features-setting` --- ### 📝 Commits (2) - [`8639e99`](https://github.com/netbirdio/netbird/commit/8639e9963f4ceb68e30c64a8b3241b898062e6b1) [management] Add dashboard_features account setting for per-section visibility - [`1e1d20b`](https://github.com/netbirdio/netbird/commit/1e1d20bbe8e7d01eb156d723a3db7c45baeaae05) [management] Document false and omitted behavior for dashboard_features.agent_network ### 📊 Changes **7 files changed** (+126 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `management/server/http/handlers/accounts/accounts_handler.go` (+10 -0) 📝 `management/server/http/handlers/accounts/accounts_handler_test.go` (+32 -0) 📝 `management/server/store/sql_store.go` (+8 -0) 📝 `management/server/store/sql_store_test.go` (+30 -0) 📝 `management/server/types/settings.go` (+27 -0) 📝 `shared/management/http/api/openapi.yml` (+10 -0) 📝 `shared/management/http/api/types.gen.go` (+9 -0) </details> ### 📄 Description ## Describe your changes Adds a per-account `dashboard_features` setting: a nullable object that overrides which dashboard sections are shown for an account. It serializes to a single JSON column so new sections can be added later as struct fields with no schema change and no new pgx loader plumbing. This is the backend for making the Agent Network menu available to existing accounts (reusing the netbird.ai signup flow), and the general mechanism the dashboard will use to control other sections (DNS, Reverse Proxy, Networks) per account later. It starts with a single key, `agent_network` — when true the Agent Network menu is shown for the account even without the deployment feature flag. `agent_network_only` (the focused-view mode) stays a separate flag. - `types.Settings.DashboardFeatures *DashboardFeatures` (+ `Copy`) - `dashboard_features` / `AccountDashboardFeatures` in the OpenAPI spec, `types.gen.go` regenerated - request/response mapping in the accounts handler (`PUT`/`GET /accounts`) - pgx `GetAccount` loader updated to select, scan, and unmarshal the JSON column — without it the field silently reads empty in production - store round-trip test (set → persist → explicit false → persist) and a handler case setting `dashboard_features.agent_network` Absent keys follow the default dashboard behavior, so the change is additive and backward-compatible. ## Issue ticket number and link <!-- internal: agent-network menu availability for existing accounts --> ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) - [ ] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) Additive account-setting plumbing surfaced only through the dashboard; the raw API field is generated into the API reference automatically. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added per-account dashboard feature overrides. * Introduced an `agent_network` toggle to control Agent Network menu visibility per account. * Updated account settings APIs (and schema) to accept and return `dashboard_features`. * **Bug Fixes** * Ensured `dashboard_features` are correctly loaded from and saved to persistence. * Account settings responses now include the dashboard feature override values. * **Tests** * Added coverage for updating and persisting dashboard feature overrides. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:07:05 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28869