diff --git a/app/controllers/super_admin/app_configs_controller.rb b/app/controllers/super_admin/app_configs_controller.rb
index 3972d5a28..5cf158b98 100644
--- a/app/controllers/super_admin/app_configs_controller.rb
+++ b/app/controllers/super_admin/app_configs_controller.rb
@@ -41,7 +41,8 @@ class SuperAdmin::AppConfigsController < SuperAdmin::ApplicationController
'slack' => %w[SLACK_CLIENT_ID SLACK_CLIENT_SECRET],
'instagram' => %w[INSTAGRAM_APP_ID INSTAGRAM_APP_SECRET INSTAGRAM_VERIFY_TOKEN INSTAGRAM_API_VERSION ENABLE_INSTAGRAM_CHANNEL_HUMAN_AGENT],
'whatsapp_embedded' => %w[WHATSAPP_APP_ID WHATSAPP_APP_SECRET WHATSAPP_CONFIGURATION_ID WHATSAPP_API_VERSION],
- 'notion' => %w[NOTION_CLIENT_ID NOTION_CLIENT_SECRET]
+ 'notion' => %w[NOTION_CLIENT_ID NOTION_CLIENT_SECRET],
+ 'google' => %w[GOOGLE_OAUTH_CLIENT_ID GOOGLE_OAUTH_CLIENT_SECRET GOOGLE_OAUTH_REDIRECT_URI]
}
@allowed_configs = mapping.fetch(@config, %w[ENABLE_ACCOUNT_SIGNUP FIREBASE_PROJECT_ID FIREBASE_CREDENTIALS])
diff --git a/app/controllers/super_admin/application_controller.rb b/app/controllers/super_admin/application_controller.rb
index 775fb34fc..5b04fbb44 100644
--- a/app/controllers/super_admin/application_controller.rb
+++ b/app/controllers/super_admin/application_controller.rb
@@ -7,8 +7,9 @@
class SuperAdmin::ApplicationController < Administrate::ApplicationController
include ActionView::Helpers::TagHelper
include ActionView::Context
+ include SuperAdmin::NavigationHelper
- helper_method :render_vue_component
+ helper_method :render_vue_component, :settings_open?, :settings_pages
# authenticiation done via devise : SuperAdmin Model
before_action :authenticate_super_admin!
diff --git a/enterprise/app/helpers/super_admin/features.yml b/app/helpers/super_admin/features.yml
similarity index 90%
rename from enterprise/app/helpers/super_admin/features.yml
rename to app/helpers/super_admin/features.yml
index f2b2b263c..f49004e79 100644
--- a/enterprise/app/helpers/super_admin/features.yml
+++ b/app/helpers/super_admin/features.yml
@@ -1,5 +1,7 @@
# TODO: Move this values to features.yml itself
# No need to replicate the same values in two places
+
+# ------- Premium Features ------- #
captain:
name: 'Captain'
description: 'Enable AI-powered conversations with your customers.'
@@ -32,6 +34,15 @@ disable_branding:
enabled: <%= (ChatwootHub.pricing_plan != 'community') %>
icon: 'icon-sailbot-fill'
enterprise: true
+
+# ------- Product Features ------- #
+help_center:
+ name: 'Help Center'
+ description: 'Allow agents to create help center articles and publish them in a portal.'
+ enabled: true
+ icon: 'icon-book-2-line'
+
+# ------- Communication Channels ------- #
live_chat:
name: 'Live Chat'
description: 'Improve your customer experience using a live chat on your website.'
@@ -42,6 +53,12 @@ email:
description: 'Manage your email customer interactions from Chatwoot.'
enabled: true
icon: 'icon-mail-send-fill'
+ config_key: 'email'
+sms:
+ name: 'SMS'
+ description: 'Manage your SMS customer interactions from Chatwoot.'
+ enabled: true
+ icon: 'icon-message-line'
messenger:
name: 'Messenger'
description: 'Stay connected with your customers on Facebook & Instagram.'
@@ -69,22 +86,22 @@ line:
description: 'Manage your Line customer interactions from Chatwoot.'
enabled: true
icon: 'icon-line-line'
-sms:
- name: 'SMS'
- description: 'Manage your SMS customer interactions from Chatwoot.'
+
+# ------- OAuth & Authentication ------- #
+google:
+ name: 'Google'
+ description: 'Configuration for setting up Google OAuth Integration'
enabled: true
- icon: 'icon-message-line'
-help_center:
- name: 'Help Center'
- description: 'Allow agents to create help center articles and publish them in a portal.'
- enabled: true
- icon: 'icon-book-2-line'
+ icon: 'icon-google'
+ config_key: 'google'
microsoft:
name: 'Microsoft'
description: 'Configuration for setting up Microsoft Email'
enabled: true
icon: 'icon-microsoft'
config_key: 'microsoft'
+
+# ------- Third-party Integrations ------- #
linear:
name: 'Linear'
description: 'Configuration for setting up Linear Integration'
diff --git a/enterprise/app/helpers/super_admin/features_helper.rb b/app/helpers/super_admin/features_helper.rb
similarity index 78%
rename from enterprise/app/helpers/super_admin/features_helper.rb
rename to app/helpers/super_admin/features_helper.rb
index 2fbcd1715..475ad6d25 100644
--- a/enterprise/app/helpers/super_admin/features_helper.rb
+++ b/app/helpers/super_admin/features_helper.rb
@@ -1,6 +1,6 @@
module SuperAdmin::FeaturesHelper
def self.available_features
- YAML.load(ERB.new(Rails.root.join('enterprise/app/helpers/super_admin/features.yml').read).result).with_indifferent_access
+ YAML.load(ERB.new(Rails.root.join('app/helpers/super_admin/features.yml').read).result).with_indifferent_access
end
def self.plan_details
diff --git a/app/helpers/super_admin/navigation_helper.rb b/app/helpers/super_admin/navigation_helper.rb
new file mode 100644
index 000000000..5fca3fa76
--- /dev/null
+++ b/app/helpers/super_admin/navigation_helper.rb
@@ -0,0 +1,16 @@
+module SuperAdmin::NavigationHelper
+ def settings_open?
+ params[:controller].in? %w[super_admin/settings super_admin/app_configs]
+ end
+
+ def settings_pages
+ features = SuperAdmin::FeaturesHelper.available_features.select do |_feature, attrs|
+ attrs['config_key'].present? && attrs['enabled']
+ end
+
+ # Add general at the beginning
+ general_feature = [['general', { 'config_key' => 'general', 'name' => 'General' }]]
+
+ general_feature + features.to_a
+ end
+end
diff --git a/app/views/super_admin/application/_icons.html.erb b/app/views/super_admin/application/_icons.html.erb
index 6669fe87d..a45c4c1b3 100644
--- a/app/views/super_admin/application/_icons.html.erb
+++ b/app/views/super_admin/application/_icons.html.erb
@@ -2,6 +2,12 @@
<%= SuperAdmin::FeaturesHelper.plan_details.html_safe %>
<%= SuperAdmin::FeaturesHelper.plan_details.html_safe %>
+ + +