diff options
Diffstat (limited to 'app/views/admin/application_settings/_slack.html.haml')
-rw-r--r-- | app/views/admin/application_settings/_slack.html.haml | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/app/views/admin/application_settings/_slack.html.haml b/app/views/admin/application_settings/_slack.html.haml index 69a5e284b4c..e4f46fdf7f2 100644 --- a/app/views/admin/application_settings/_slack.html.haml +++ b/app/views/admin/application_settings/_slack.html.haml @@ -1,33 +1,66 @@ -- return unless Gitlab.dev_or_test_env? || Gitlab.com? - +- gitlab_com = Gitlab.com? - expanded = integration_expanded?('slack_app_') + %section.settings.as-slack.no-animate#js-slack-settings{ class: ('expanded' if expanded) } .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only - = _('Slack application') + = s_('Integrations|GitLab for Slack app') = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') %p - = _('Slack integration allows you to interact with GitLab via slash commands in a chat window.') + = s_('SlackIntegration|Configure your GitLab for Slack app.') + = link_to(_('Learn more.'), help_page_path('user/admin_area/settings/slack_app'), target: '_blank', rel: 'noopener noreferrer') + .settings-content + - unless gitlab_com + %h5 + = s_('SlackIntegration|Step 1: Create your GitLab for Slack app') + %p + = s_('SlackIntegration|You must do this step only once.') + %p + = render Pajamas::ButtonComponent.new(href: slack_app_manifest_share_admin_application_settings_path) do + = s_("SlackIntegration|Create Slack app") + %hr + %h5 + = s_('SlackIntegration|Step 2: Configure the app settings') + %p + - tag_pair_slack_apps = tag_pair(link_to('', 'https://api.slack.com/apps', target: '_blank', rel: 'noopener noreferrer'), :link_start, :link_end) + - tag_pair_strong = tag_pair(tag.strong, :strong_open, :strong_close) + = safe_format(s_('SlackIntegration|Copy the %{link_start}settings%{link_end} from %{strong_open}%{settings_heading}%{strong_close} in your GitLab for Slack app.'), tag_pair_slack_apps, tag_pair_strong, settings_heading: 'App Credentials') + = link_to(_('Learn more.'), help_page_path('user/admin_area/settings/slack_app', anchor: 'configure-the-settings'), target: '_blank', rel: 'noopener noreferrer') = gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) if expanded - %fieldset .form-group - = f.gitlab_ui_checkbox_component :slack_app_enabled, s_('ApplicationSettings|Enable Slack application'), - help_text: s_('ApplicationSettings|This option is only available on GitLab.com') + = f.gitlab_ui_checkbox_component :slack_app_enabled, s_('ApplicationSettings|Enable GitLab for Slack app') .form-group = f.label :slack_app_id, s_('SlackIntegration|Client ID'), class: 'label-bold' = f.text_field :slack_app_id, class: 'form-control gl-form-input' .form-group = f.label :slack_app_secret, s_('SlackIntegration|Client secret'), class: 'label-bold' = f.text_field :slack_app_secret, class: 'form-control gl-form-input' + .form-text.text-muted + = s_('SlackIntegration|Used for authenticating OAuth requests from the GitLab for Slack app.') .form-group = f.label :slack_app_signing_secret, s_('SlackIntegration|Signing secret'), class: 'label-bold' = f.text_field :slack_app_signing_secret, class: 'form-control gl-form-input' + .form-text.text-muted + = s_('SlackIntegration|Used for authenticating API requests from the GitLab for Slack app.') .form-group = f.label :slack_app_verification_token, s_('SlackIntegration|Verification token'), class: 'label-bold' = f.text_field :slack_app_verification_token, class: 'form-control gl-form-input' - + .form-text.text-muted + = s_('SlackIntegration|Used only for authenticating slash commands from the GitLab for Slack app. This method of authentication is deprecated by Slack.') = f.submit _('Save changes'), pajamas_button: true + + - unless gitlab_com + %hr + %h5 + = s_('SlackIntegration|Update your Slack app') + %p + = s_('SlackIntegration|When GitLab releases new features for the GitLab for Slack app, you might have to manually update your copy to use the new features.') + = link_to(_('Learn more.'), help_page_path('user/admin_area/settings/slack_app', anchor: 'update-the-gitlab-for-slack-app'), target: '_blank', rel: 'noopener noreferrer') + %p + = render Pajamas::ButtonComponent.new(href: slack_app_manifest_download_admin_application_settings_path, icon: 'download') do + = s_("SlackIntegration|Download latest manifest file") + |