feat: Add help URLs for features in features.yml (#9134)
Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
@@ -2,4 +2,11 @@ module ApplicationHelper
|
||||
def available_locales_with_name
|
||||
LANGUAGES_CONFIG.map { |_key, val| val.slice(:name, :iso_639_1_code) }
|
||||
end
|
||||
|
||||
def feature_help_urls
|
||||
features = YAML.safe_load(Rails.root.join('config/features.yml').read).freeze
|
||||
features.each_with_object({}) do |feature, hash|
|
||||
hash[feature['name']] = feature['help_url'] if feature['help_url']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,4 +20,14 @@ export const FEATURE_FLAGS = {
|
||||
INBOX_VIEW: 'inbox_view',
|
||||
SLA: 'sla',
|
||||
RESPONSE_BOT: 'response_bot',
|
||||
CHANNEL_EMAIL: 'channel_email',
|
||||
CHANNEL_FACEBOOK: 'channel_facebook',
|
||||
CHANNEL_TWITTER: 'channel_twitter',
|
||||
CHANNEL_WEBSITE: 'channel_website',
|
||||
CUSTOM_REPLY_DOMAIN: 'custom_reply_domain',
|
||||
CUSTOM_REPLY_EMAIL: 'custom_reply_email',
|
||||
DISABLE_BRANDING: 'disable_branding',
|
||||
EMAIL_CONTINUITY_ON_API_CHANNEL: 'email_continuity_on_api_channel',
|
||||
INBOUND_EMAILS: 'inbound_emails',
|
||||
IP_LOOKUP: 'ip_lookup',
|
||||
};
|
||||
|
||||
4
app/javascript/dashboard/helper/featureHelper.js
Normal file
4
app/javascript/dashboard/helper/featureHelper.js
Normal file
@@ -0,0 +1,4 @@
|
||||
export function getHelpUrlForFeature(featureName) {
|
||||
const { helpUrls } = window.chatwootConfig;
|
||||
return helpUrls[featureName];
|
||||
}
|
||||
@@ -44,6 +44,7 @@
|
||||
vapidPublicKey: new Uint8Array(<%= Base64.urlsafe_decode64(@global_config['VAPID_PUBLIC_KEY']).bytes %>),
|
||||
<% end %>
|
||||
enabledLanguages: <%= available_locales_with_name.to_json.html_safe %>,
|
||||
helpUrls: <%= feature_help_urls.to_json.html_safe %>,
|
||||
selectedLocale: '<%= I18n.locale %>'
|
||||
}
|
||||
window.globalConfig = <%= raw @global_config.to_json %>
|
||||
|
||||
@@ -3,37 +3,45 @@
|
||||
enabled: true
|
||||
- name: channel_email
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/email
|
||||
- name: channel_facebook
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/fb
|
||||
- name: channel_twitter
|
||||
enabled: true
|
||||
- name: ip_lookup
|
||||
enabled: false
|
||||
- name: disable_branding
|
||||
enabled: false
|
||||
premium: true
|
||||
premium: true
|
||||
- name: email_continuity_on_api_channel
|
||||
enabled: false
|
||||
- name: help_center
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/help-center
|
||||
- name: agent_bots
|
||||
enabled: false
|
||||
help_url: https://chwt.app/hc/agent-bots
|
||||
- name: macros
|
||||
enabled: true
|
||||
- name: agent_management
|
||||
enabled: true
|
||||
- name: team_management
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/teams
|
||||
- name: inbox_management
|
||||
enabled: true
|
||||
- name: labels
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/labels
|
||||
- name: custom_attributes
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/custom-attributes
|
||||
- name: automations
|
||||
enabled: true
|
||||
- name: canned_responses
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/canned
|
||||
- name: integrations
|
||||
enabled: true
|
||||
- name: voice_recorder
|
||||
@@ -44,8 +52,10 @@
|
||||
enabled: true
|
||||
- name: campaigns
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/campaigns
|
||||
- name: reports
|
||||
enabled: true
|
||||
help_url: https://chwt.app/hc/reports
|
||||
- name: crm
|
||||
enabled: true
|
||||
- name: auto_resolve_conversations
|
||||
@@ -62,6 +72,7 @@
|
||||
premium: true
|
||||
- name: message_reply_to
|
||||
enabled: false
|
||||
help_url: https://chwt.app/hc/reply-to
|
||||
- name: insert_article_in_reply
|
||||
enabled: false
|
||||
- name: inbox_view
|
||||
|
||||
Reference in New Issue
Block a user