diff options
Diffstat (limited to 'app/views/shared/integrations')
7 files changed, 59 insertions, 8 deletions
diff --git a/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml index de4439a8fde..c77cc687e4f 100644 --- a/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml +++ b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml @@ -3,7 +3,7 @@ variant: :warning, dismissible: false, alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| - = c.body do + - c.with_body do - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') - learn_more_link = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_link } @@ -13,7 +13,7 @@ variant: :warning, dismissible: false, alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| - = c.body do + - c.with_body do - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') - learn_more_link = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_link } diff --git a/app/views/shared/integrations/gitlab_slack_application/_help.html.haml b/app/views/shared/integrations/gitlab_slack_application/_help.html.haml new file mode 100644 index 00000000000..0956f1183cb --- /dev/null +++ b/app/views/shared/integrations/gitlab_slack_application/_help.html.haml @@ -0,0 +1,10 @@ +.info-well + .well-segment + %p + = s_("SlackIntegration|This integration allows users to perform common operations on this project by entering slash commands in Slack.") + = link_to _('Learn more'), help_page_path('user/project/integrations/gitlab_slack_application.md') + %p + = s_("SlackIntegration|See the list of available commands in Slack after setting up this integration by entering") + %kbd.inline /gitlab help +- if integration.project_level? + = render "shared/integrations/#{integration.to_param}/slack_integration_form", integration: integration diff --git a/app/views/shared/integrations/gitlab_slack_application/_slack_button.html.haml b/app/views/shared/integrations/gitlab_slack_application/_slack_button.html.haml new file mode 100644 index 00000000000..b22a6eeca90 --- /dev/null +++ b/app/views/shared/integrations/gitlab_slack_application/_slack_button.html.haml @@ -0,0 +1,4 @@ += link_to add_to_slack_link(project, slack_app_id), class: 'btn btn-default gl-button gl-pr-6!' do + = image_tag 'illustrations/slack_logo.svg', class: 'gl-icon gl-button-icon gl-w-9! gl-h-9! gl-my-n3! gl-mr-0!' + %strong.gl-button-text + = label diff --git a/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml b/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml new file mode 100644 index 00000000000..5c9f77f8c12 --- /dev/null +++ b/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml @@ -0,0 +1,32 @@ +- slack_integration = integration.slack_integration +- if slack_integration + %table.gl-table.gl-w-full + %colgroup + %col{ width: "25%" } + %col{ width: "35%" } + %col{ width: "20%" } + %col + %thead + %tr + %th= s_('SlackIntegration|Team name') + %th= s_('SlackIntegration|Project alias') + %th= _('Created') + %th + %tr + %td{ class: 'gl-py-3!' } + = slack_integration.team_name + %td{ class: 'gl-py-3!' } + = slack_integration.alias + %td{ class: 'gl-py-3!' } + = time_ago_with_tooltip(slack_integration.created_at) + %td{ class: 'gl-py-3!' } + .controls + - project = integration.project + = link_to _('Edit'), edit_project_settings_slack_path(project), class: 'btn gl-button btn-default' + = link_to sprite_icon('remove', css_class: 'gl-icon'), project_settings_slack_path(project), method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary', aria: { label: s_('SlackIntegration|Remove project') }, data: { confirm_btn_variant: "danger", confirm: s_('SlackIntegration|Are you sure you want to remove this project from the GitLab for Slack app?') } + .gl-my-5 + = render 'shared/integrations/gitlab_slack_application/slack_button', project: @project, label: s_('SlackIntegration|Reinstall GitLab for Slack app') + %p + = html_escape(s_('SlackIntegration|You may need to reinstall the GitLab for Slack app when we %{linkStart}make updates or change permissions%{linkEnd}.')) % { linkStart: %(<a href="#{help_page_path('user/project/integrations/gitlab_slack_application.md', anchor: 'update-the-gitlab-for-slack-app')}">).html_safe, linkEnd: '</a>'.html_safe} +- else + = render 'shared/integrations/gitlab_slack_application/slack_button', project: @project, label: s_('SlackIntegration|Install GitLab for Slack app') diff --git a/app/views/shared/integrations/gitlab_slack_application/_top.html.haml b/app/views/shared/integrations/gitlab_slack_application/_top.html.haml new file mode 100644 index 00000000000..56200deac6d --- /dev/null +++ b/app/views/shared/integrations/gitlab_slack_application/_top.html.haml @@ -0,0 +1,5 @@ +- if session.delete(:slack_install_success) + = render Pajamas::AlertComponent.new(title: s_('SlackIntegration|GitLab for Slack was successfully installed.'), + variant: :success) do |c| + - c.with_body do + = s_('SlackIntegration|You can now close this window and go to your Slack workspace.') diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index beeb328aedf..0264196f60c 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -7,12 +7,12 @@ .col-lg-9 = render Pajamas::CardComponent.new(header_options: { class: 'gl-display-flex gl-align-items-center' }, body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 custom-monitored-metrics js-panel-custom-monitored-metrics', data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } }) do |c| - - c.header do + - c.with_header do %strong = s_('PrometheusService|Custom metrics') = gl_badge_tag 0, nil, class: 'gl-ml-2 js-custom-monitored-count' = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden' - - c.body do + - c.with_body do .flash-container.hidden .flash-warning .flash-text diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml index 7cd4eeee5f8..cb78faa383a 100644 --- a/app/views/shared/integrations/prometheus/_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -9,11 +9,11 @@ .col-lg-9 = render Pajamas::CardComponent.new(body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 js-panel-monitored-metrics', data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') }}) do |c| - - c.header do + - c.with_header do %strong = s_('PrometheusService|Common metrics') = gl_badge_tag 0, nil, class: 'js-monitored-count' - - c.body do + - c.with_body do .loading-metrics.js-loading-metrics %p.m-3 = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner') @@ -24,12 +24,12 @@ %ul.list-unstyled.metrics-list.hidden.js-metrics-list = render Pajamas::CardComponent.new(body_options: { class: 'hidden gl-p-0' }, card_options: { class: 'hidden js-panel-missing-env-vars' }) do |c| - - c.header do + - c.with_header do = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right') = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden') = s_('PrometheusService|Missing environment variable') = gl_badge_tag 0, nil, class: 'js-env-var-count' - - c.body do + - c.with_body do .flash-container .flash-notice .flash-text |