iachat/spec/models
Gabriel Jablonski 5cc78c7b33
feat(super-admin): hide assignee tabs for basic agents (#279)
* fix(featurable): backport feature_flag_value helper from chatwoot-pro-main

Adds the two's-complement-aware helper that returns a signed bigint-safe
value for SQL queries against the feature_flags column. Mirrors the
existing helper in chatwoot-pro-main so future backports of pro features
that reference it (e.g. kanban filters) compile cleanly on main.

Note: the helper does NOT fix FlagShihTzu's write path; new account-level
toggles should use account.settings jsonb instead of feature_flags
(see AGENTS.md).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(super-admin): toggle to hide assignee tabs for basic agents

Adds two account-level settings, configurable from the super admin
dashboard, that hide the "Unassigned" and "All" tabs of the conversation
list for users with the basic agent role (admins and custom roles are
unaffected). Hiding "Unassigned" implicitly hides "All", since seeing
the full queue without the unassigned subset is incoherent. The
constraint is enforced both in the backend (before_validation forces
hide_agent_all_tab=true when hide_agent_unassigned_tab is on) and in
the super admin form (the "All" checkbox is disabled and auto-checked
when "Unassigned" is checked).

Storage uses account.settings (jsonb) instead of feature_flags to
sidestep the bigint bit-position overflow that happens once features.yml
crosses 64 entries, and to keep keys stable across the main and
chatwoot-pro-main forks where feature bit positions diverge. AGENTS.md
documents the rationale and the recipe to add future toggles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(chat-list): guard activeAssigneeTabCount against missing tab

When the visibility settings hide the currently selected tab, the
fallback watch resets activeAssigneeTab to ME, but activeAssigneeTabCount
re-evaluates in the same reactive cycle and can read .count on undefined
before the watch flushes. Use optional chaining + nullish fallback so
the count safely returns 0 during the brief inconsistency.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 16:25:45 -03:00
..
channel feat(whatsapp): convert inbox between WhatsApp providers (#268) 2026-04-18 20:57:27 -03:00
concerns feat(super-admin): hide assignee tabs for basic agents (#279) 2026-04-30 16:25:45 -03:00
enterprise/audit feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
integrations feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
internal_chat feat(internal-chat): implement internal chat system for agents (#247) 2026-04-11 13:50:15 -03:00
.keep Fix url in emails, add frontendURL helper (#19) 2019-08-25 19:59:28 +05:30
account_spec.rb feat(super-admin): hide assignee tabs for basic agents (#279) 2026-04-30 16:25:45 -03:00
account_user_spec.rb fix: update notification setting to clear selected email flags (#100) 2025-08-25 18:11:29 -03:00
agent_bot_inbox_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
agent_bot_spec.rb feat: Implement UI for Agent Bots in settings and remove CSML support (#11276) 2025-04-16 18:02:49 +05:30
application_record_external_credentials_encryption_spec.rb feat: Secure external credentials with database encryption (#12648) 2025-10-13 18:05:12 +05:30
article_spec.rb Merge branch 'main' into chore/merge-4.13.0 2026-04-17 16:23:47 -03:00
assignment_policy_spec.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
attachment_spec.rb Merge branch 'main' into chore/merge-4.13.0 2026-04-17 16:23:47 -03:00
automation_rule_spec.rb Merge branch 'main' into chore/merge-4.13.0 2026-04-17 16:23:47 -03:00
campaign_spec.rb chore: Add validations to campaign model 2025-03-19 17:29:08 -07:00
category_spec.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
contact_inbox_spec.rb feat: group conversations (#228) 2026-03-19 21:56:58 -03:00
contact_spec.rb feat: group conversations (#228) 2026-03-19 21:56:58 -03:00
conversation_participants_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
conversation_spec.rb fix(conversations): enforce NOT NULL on contact_id + cleanup orphans (#273) 2026-04-22 13:57:40 -03:00
csat_survey_response_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
custom_attribute_definition_spec.rb feat: harden filter service 2026-03-09 21:19:20 +05:30
data_import_spec.rb chore: Add delay before running dataimport job (#8039) 2023-10-03 22:18:57 -07:00
folder_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
inbox_member_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
inbox_signature_spec.rb feat: add per-inbox signature management (#226) 2026-02-26 19:53:03 -03:00
inbox_spec.rb Merge branch 'main' into chatwoot/develop 2025-07-16 09:37:08 -03:00
installation_config_spec.rb fix: Annotaterb model annotation incomplete migration (#13132) 2026-03-25 17:51:06 -07:00
label_spec.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
macro_spec.rb test: reset Current.user after spec (#8123) 2023-10-17 18:06:54 +05:30
mention_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
message_spec.rb Merge branch 'main' into chore/merge-4.13.0 2026-04-17 16:23:47 -03:00
note_spec.rb feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
notification_setting_spec.rb Feature: Add new notification settings for user (#569) 2020-02-29 20:41:09 +05:30
notification_spec.rb feat: speed up circleci and github actions (#12849) 2025-11-19 15:32:48 +05:30
platform_app_permissible_spec.rb feat: Add Platform APIs (#1456) 2021-01-14 20:35:22 +05:30
platform_app_spec.rb chore: Limit objects returned by conversation API (#2721) 2021-07-31 21:19:42 +05:30
portal_spec.rb refactor: update webhook job parameters to include account webhook and delivery ID 2026-03-20 00:48:50 -03:00
related_category_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
reporting_event_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
reporting_events_rollup_spec.rb feat(rollup): add models and write path [1/3] (#13796) 2026-03-19 13:12:36 +05:30
scheduled_message_spec.rb fix: prevent deletion of scheduled messages that have been sent or failed (#212) 2026-02-05 18:42:46 -03:00
team_member_spec.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
team_spec.rb feat: invalidate cache after inbox members or team members update (#10869) 2025-02-20 21:28:38 -08:00
user_spec.rb fix(mailer): fall back to user account for devise email locale (#267) 2026-04-17 21:58:08 -03:00
webhook_spec.rb feat: add per-webhook secret with backfill migration (#13573) 2026-02-26 17:26:12 +05:30
working_hour_spec.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00