Skip to content

Promote Chats to top-level Configuration menu entry (after Users) #1273

Description

@GonzoSpire

Context

Today the Chats page is buried as the 5th tab inside Configuration/Settings (Views/Configuration/Index.cshtml:30-32, 65-67), reachable only via the Settings cog. Users and Access keys already have their own top-level entries in the Configuration dropdown, and Chats is the same kind of CRUD page — it belongs next to them, above the divider. Settings (server config) and API (docs) stay below the divider.

After PR #1272 (EditChat tabs refactor) shipped, this is the next UX cleanup of the unified-Chat surface that came out of epic #1259.

Goals / Proposed scope

  • Add a new top-level Chats entry in the Configuration dropdown (Views/Shared/_Layout.cshtml), placed immediately after Users.
  • Host the page at NotificationsController.Index — controller already has ChatsManager wired (Controllers/NotificationsController.cs:28-38).
  • Remove the Chats tab from Configuration/Settings; keep _Chats.cshtml in place (still used by Folders/EditFolder.cshtml:59).

Tasks

  • Add NotificationsController.Index ([HttpGet], [AuthorizeIsAdmin]) returning View(new ChatsSettingsViewModel(ChatsManager)).
  • Create Views/Notifications/Index.cshtml — minimal wrapper that renders @await Html.PartialAsync("~/Views/Configuration/_Chats.cshtml", Model).
  • Add UserRoleHelper.IsChatsPageAllowed (Helpers/UserRoleHelper.cs) returning user.IsAdmin, mirroring IsUsersPageAllowed:13-16 / IsConfigurationPageAllowed:33-36.
  • Insert Chats <li> in _Layout.cshtml after the Users block (:107-114), gated by IsChatsPageAllowed, linking to Url.Action(ViewConstants.IndexAction, ViewConstants.NotificationsController).
  • Remove chats-tab button + pane from Views/Configuration/Index.cshtml:30-32, 65-67.
  • Drop Chats property from ConfigurationViewModel (Model/Configuration/ConfigurationViewModel.cs:18) and the IChatsManager chats primary-constructor param + ConfigurationController.Index call site (:30).
  • Update NotificationsController.AddChat POST redirect (:81) from ConfigurationController.Indexnameof(Index) so the user lands back on the new Chats page.
  • Update Playwright tests in src/tests/Autotests/products/modify_folder_chat.spec.ts — all three tests navigate via Configuration → tab Chats; switch to Configuration dropdown → Chats.

Acceptance criteria

  • Configuration dropdown order: Access keys, Users, Chats, divider, Settings, API.
  • Clicking Chats opens /Notifications and renders the existing chats table (same columns, same row action dropdown, same Add-new-chat link).
  • Settings page (/Configuration) no longer has a Chats tab.
  • AddChat POST redirects to /Notifications, not /Configuration.
  • Folder edit page's Chats tab still renders the same list (unchanged _Chats.cshtml).
  • Chats menu entry is visible to admins only (matches current admin-only access via ConfigurationController).
  • dotnet build src/server/HSMServer/HSMServer.csproj — 0 errors.
  • npx playwright test modify_folder_chat.spec.ts — green after selector updates.

Out of scope

  • Renaming or moving _Chats.cshtml — leave under Views/Configuration/ to avoid churning Folders/EditFolder.cshtml.
  • Permission model change — IsChatsPageAllowed mirrors the existing admin-only pattern; no new roles.
  • Mattermost delivery implementation — still deferred (epic Epic: Unified Chat entity (Telegram + Slack + Mattermost) #1259 follow-up).

References

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestrefactoringCode refactoring without behavior change

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions