iachat/app/models
Pranav d79d9e8b46
fix: Include uncategorized articles in the all article section to allow edit/delete (#10153)
Fixes https://github.com/chatwoot/chatwoot/issues/9935
Fixes https://github.com/chatwoot/chatwoot/issues/8213

The articles were grouped by category, with locale being a derived
attribute from the category. If a category was deleted, the article
wouldn't appear on the dashboard. However, due to a bug, it would show
up in the uncategorized section on the public portal, leaving agents
unable to edit or update the article.

To address this issue, I've added a locale attribute directly to the
article. This attribute is automatically set from the category or the
portal's default locale if not supplied. The API parameters now use this
attribute to filter articles. As a result, the dashboard will display
articles even if they're not associated with a category, improving the
overall workflow.

**Main updates:** 
- Add locale attribute to the Article model. Add db migration to back
fill the data based on the above logic.
- Add a new scope search_by_locale and use it instead of
search_by_category_locale.
- Update the ERB template to include the locale filter.
- Move from `joins` to `left_outer_joins` to include the articles with
no categories.

---------

Co-authored-by: Sojan <sojan@pepalo.com>
2024-09-23 23:39:03 -07:00
..
channel feat: add Google login flow and inbox creation (#9580) 2024-06-07 16:37:46 +05:30
concerns feat: Add the ability to un-assign teams using automation (#9668) 2024-06-26 12:40:36 -07:00
integrations fix: Handle OpenAI API errors (#9560) 2024-08-22 10:24:13 +05:30
access_token.rb Feature: Access tokens for API access (#604) 2020-03-11 00:02:15 +05:30
account_user.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
account.rb fix: support_email and inbound_email_domain returning empty string (#8963) 2024-02-19 15:43:35 +05:30
agent_bot_inbox.rb Feature: Access tokens for API access (#604) 2020-03-11 00:02:15 +05:30
agent_bot.rb fix: Delete agent bots without deleting the messages (#7754) 2023-08-17 13:48:49 -07:00
application_record.rb chore: fix sla email notifications (#9192) 2024-04-04 21:16:49 +05:30
article.rb fix: Include uncategorized articles in the all article section to allow edit/delete (#10153) 2024-09-23 23:39:03 -07:00
attachment.rb fix: Instagram outgoing attachments (#9863) 2024-07-31 23:00:01 -07:00
automation_rule.rb feat: disable automation rules if condition fails multiple times (#9017) 2024-03-28 13:14:16 +05:30
campaign.rb feat: Allow wildcard URL in the campaigns (#6056) 2022-12-09 16:43:09 -08:00
canned_response.rb chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864) 2024-02-07 13:36:04 +04:00
category.rb feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
contact_inbox.rb feat: Add job to remove stale contact inboxes (#8096) 2023-11-06 20:24:30 -08:00
contact.rb chore: Improved indexes for Conversations & Contacts [CW-3300] (#9475) 2024-05-15 16:10:39 -07:00
conversation_participant.rb chore: Add controllers for conversation participants (#6462) 2023-02-15 16:33:31 -08:00
conversation.rb fix: last_activity_at is nil when conv is created (#9934) 2024-08-12 15:15:49 +05:30
csat_survey_response.rb chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864) 2024-02-07 13:36:04 +04:00
custom_attribute_definition.rb feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
custom_filter.rb fix: Revert the changes for SyncCustomFilterCountJob (#8238) 2023-10-27 10:45:48 -07:00
dashboard_app.rb fix: validate url for Dashboard Apps [CW-2979] (#8736) 2024-01-18 17:48:30 +05:30
data_import.rb chore: Add delay before running dataimport job (#8039) 2023-10-03 22:18:57 -07:00
email_template.rb feat: Customisable Email Templates (#1095) 2020-08-06 15:21:06 +05:30
folder.rb feat: Portal endpoint (#4633) 2022-05-16 13:59:59 +05:30
inbox_member.rb feat: auditlog for team and inbox member updates (#7516) 2023-08-15 19:55:19 -07:00
inbox.rb feat: Integration with Captain (alpha) (#9834) 2024-07-25 14:24:04 -07:00
installation_config.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
integrations.rb Feature: Slack integration (#783) 2020-06-12 23:12:47 +05:30
jsonb_attributes_length_validator.rb Fix: added validation for custom and additional attribute (#4260) 2022-03-24 15:38:28 +05:30
kbase.rb Feature: Knowledge Base APIs (#1002) 2020-09-26 02:32:34 +05:30
label.rb feat: multiple UX improvements to labels (#7358) 2023-06-25 18:49:49 +05:30
macro.rb chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864) 2024-02-07 13:36:04 +04:00
mention.rb fix: Notification page breakages (#5236) 2022-08-10 13:46:46 +02:00
message.rb revert: "fix: message_type inconsistency across message end points" (#10119) 2024-09-16 20:00:11 +05:30
note.rb fix: Notification page breakages (#5236) 2022-08-10 13:46:46 +02:00
notification_setting.rb fix: Specify external db with non-standard port (#2711) 2021-07-28 19:36:51 +05:30
notification_subscription.rb fix: Change the column identifier from string to text to avoid overflow (#9073) 2024-03-07 11:13:01 +05:30
notification.rb feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
platform_app_permissible.rb fix: SuperAdmin Improvements (#3733) 2022-01-11 19:00:00 -08:00
platform_app.rb Chore: Replaced dependent destroy with dependent destroy_async in all models (#3249) 2021-11-18 10:32:29 +05:30
portal_member.rb feat: CRUD operation for associated articles to current article (#4912) 2022-07-04 20:29:44 +05:30
portal.rb feat: Add widget to help center config (#9235) 2024-04-15 16:46:48 -07:00
related_category.rb feat: CRUD operation for associated articles to current article (#4912) 2022-07-04 20:29:44 +05:30
reporting_event.rb feat: add index to reporting events [CW-1960] (#7294) 2023-06-12 18:23:42 +05:30
super_admin.rb chore: Remove message_signature_enabled from users (#3982) 2022-02-15 12:10:53 +05:30
team_member.rb feat: auditlog for team and inbox member updates (#7516) 2023-08-15 19:55:19 -07:00
team.rb feat: Add audit trail events for team (#7285) 2023-06-09 17:30:36 -07:00
telegram_bot.rb chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864) 2024-02-07 13:36:04 +04:00
user.rb fix: use safe nav when downcasing email in from_email (#9139) 2024-03-21 18:44:04 +05:30
webhook.rb feat: Add inbox webhook events (#8006) 2023-09-28 15:28:10 -07:00
working_hour.rb chore: Replace deprecated functions (#5611) 2022-10-12 14:55:59 -07:00