diff --git a/AGENTS.md b/AGENTS.md index 3b1bcb024..301633d7f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,6 +4,11 @@ - **Setup**: `bundle install && pnpm install` - **Run Dev**: `pnpm dev` or `overmind start -f ./Procfile.dev` +- **Seed Local Test Data**: `bundle exec rails db:seed` (quickly populates minimal data for standard feature verification) +- **Seed Search Test Data**: `bundle exec rails search:setup_test_data` (bulk fixture generation for search/performance/manual load scenarios) +- **Seed Account Sample Data (richer test data)**: `Seeders::AccountSeeder` is available as an internal utility and is exposed through Super Admin `Accounts#seed`, but can be used directly in dev workflows too: + - UI path: Super Admin → Accounts → Seed (enqueues `Internal::SeedAccountJob`). + - CLI path: `bundle exec rails runner "Internal::SeedAccountJob.perform_now(Account.find())"` (or call `Seeders::AccountSeeder.new(account: Account.find()).perform!` directly). - **Lint JS/Vue**: `pnpm eslint` / `pnpm eslint:fix` - **Lint Ruby**: `bundle exec rubocop -a` - **Test JS**: `pnpm test` or `pnpm test:watch` @@ -93,3 +98,7 @@ Practical checklist for any change impacting core logic or public APIs - When renaming/moving shared code, mirror the change in `enterprise/` to prevent drift. - Tests: Add Enterprise-specific specs under `spec/enterprise`, mirroring OSS spec layout where applicable. - When modifying existing OSS features for Enterprise-only behavior, add an Enterprise module (via `prepend_mod_with`/`include_mod_with`) instead of editing OSS files directly—especially for policies, controllers, and services. For Enterprise-exclusive features, place code directly under `enterprise/`. + +## Branding / White-labeling note + +- For user-facing strings that currently contain "Chatwoot" but should adapt to branded/self-hosted installs, prefer applying `replaceInstallationName` from `shared/composables/useBranding` in the UI layer (for example tooltip and suggestion labels) instead of adding hardcoded brand-specific copy. diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 0f6ab85a8..78888d1e0 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -43,6 +43,7 @@ import VoiceCallBubble from './bubbles/VoiceCall.vue'; import MessageError from './MessageError.vue'; import ContextMenu from 'dashboard/modules/conversations/components/MessageContextMenu.vue'; +import { useBranding } from 'shared/composables/useBranding'; /** * @typedef {Object} Attachment @@ -143,6 +144,7 @@ const { t } = useI18n(); const route = useRoute(); const inboxGetter = useMapGetter('inboxes/getInbox'); const inbox = computed(() => inboxGetter.value(props.inboxId) || {}); +const { replaceInstallationName } = useBranding(); /** * Computes the message variant based on props @@ -472,7 +474,7 @@ const avatarInfo = computed(() => { const avatarTooltip = computed(() => { if (props.contentAttributes?.externalEcho) { - return t('CONVERSATION.NATIVE_APP_ADVISORY'); + return replaceInstallationName(t('CONVERSATION.NATIVE_APP_ADVISORY')); } if (avatarInfo.value.name === '') return ''; return `${t('CONVERSATION.SENT_BY')} ${avatarInfo.value.name}`; diff --git a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue index 9075eb4ed..0c8a4fb57 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue @@ -2,6 +2,7 @@ // components import NextButton from 'dashboard/components-next/button/Button.vue'; import Avatar from 'dashboard/components-next/avatar/Avatar.vue'; +import { useBranding } from 'shared/composables/useBranding'; // composables import { useCaptain } from 'dashboard/composables/useCaptain'; @@ -34,8 +35,9 @@ export default { }, setup() { const { captainTasksEnabled } = useCaptain(); + const { replaceInstallationName } = useBranding(); - return { captainTasksEnabled }; + return { captainTasksEnabled, replaceInstallationName }; }, data() { return { @@ -228,7 +230,9 @@ export default {