Commit ab28f598 authored by Robert Speicher's avatar Robert Speicher

Merge branch...

Merge branch '6104-extract-ee-specific-files-lines-for-some-platform-related-project-views' into 'master'

[EE] Resolve "Extract EE specific files/lines for some platform related project views"

See merge request gitlab-org/gitlab-ee!6133
parents 631b3ee8 d840c8db
...@@ -18,6 +18,11 @@ module ProtectedRefAccess ...@@ -18,6 +18,11 @@ module ProtectedRefAccess
scope :master, -> { maintainer } # @deprecated scope :master, -> { maintainer } # @deprecated
scope :maintainer, -> { where(access_level: Gitlab::Access::MAINTAINER) } scope :maintainer, -> { where(access_level: Gitlab::Access::MAINTAINER) }
scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) } scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) }
scope :by_user, -> (user) { where(user_id: user ) }
scope :by_group, -> (group) { where(group_id: group ) }
scope :for_role, -> { where(user_id: nil, group_id: nil) }
scope :for_user, -> { where.not(user_id: nil) }
scope :for_group, -> { where.not(group_id: nil) }
validates :access_level, presence: true, if: :role?, inclusion: { validates :access_level, presence: true, if: :role?, inclusion: {
in: ALLOWED_ACCESS_LEVELS in: ALLOWED_ACCESS_LEVELS
......
= render layout: 'projects/protected_tags/shared/protected_tag', locals: { protected_tag: protected_tag } do = render layout: 'projects/protected_tags/shared/protected_tag', locals: { protected_tag: protected_tag } do
= render partial: 'projects/protected_tags/ee/fallback_update_protected_tag', locals: { protected_tag: protected_tag } %td
= render 'projects/protected_tags/protected_tag_create_access_levels', protected_tag: protected_tag, create_access_level: protected_tag.create_access_levels.for_role.first
= render_if_exists 'projects/protected_tags/protected_tag_extra_create_access_levels', protected_tag: protected_tag
- protected_tag = local_assigns.fetch(:protected_tag)
- create_access_level = local_assigns.fetch(:create_access_level)
- dropdown_label = create_access_level&.humanize || 'Select'
= hidden_field_tag "allowed_to_create_#{protected_tag.id}", create_access_level&.access_level
= dropdown_tag(dropdown_label,
options: { toggle_class: 'js-allowed-to-create', dropdown_class: 'dropdown-menu-selectable capitalize-header js-allowed-to-create-container',
data: { field_name: "allowed_to_create_#{protected_tag.id}", access_level_id: create_access_level&.id }})
%td
= hidden_field_tag "allowed_to_create_#{protected_tag.id}", protected_tag.create_access_levels.first.access_level
= dropdown_tag( (protected_tag.create_access_levels.first.humanize || 'Select') ,
options: { toggle_class: 'js-allowed-to-create', dropdown_class: 'dropdown-menu-selectable capitalize-header js-allowed-to-create-container',
data: { field_name: "allowed_to_create_#{protected_tag.id}", access_level_id: protected_tag.create_access_levels.first.id }})
- project = local_assigns.fetch(:project)
.card.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/metrics') } }
.card-header
%h3.card-title
= s_('PrometheusService|Common metrics')
%span.badge.badge-pill.js-monitored-count 0
.card-body
.loading-metrics.js-loading-metrics
%p.prepend-top-10.prepend-left-10
= icon('spinner spin', class: 'metrics-load-spinner')
= s_('PrometheusService|Finding and configuring metrics...')
.empty-metrics.hidden.js-empty-metrics
%p.text-tertiary.prepend-top-10.prepend-left-10
= s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics')
%ul.list-unstyled.metrics-list.hidden.js-metrics-list
.card.hidden.js-panel-missing-env-vars
.card-header
%h3.card-title
= icon('caret-right lg fw', class: 'panel-toggle js-panel-toggle', 'aria-label' => 'Toggle panel')
= s_('PrometheusService|Missing environment variable')
%span.badge.badge-pill.js-env-var-count 0
.card-body.hidden
.flash-container
.flash-notice
.flash-text
= s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "<code>$CI_ENVIRONMENT_SLUG</code>" }).html_safe
= link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels')
%ul.list-unstyled.metrics-list.js-missing-var-metrics-list
...@@ -7,49 +7,4 @@ ...@@ -7,49 +7,4 @@
= link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus_library/metrics'), target: '_blank', rel: "noopener noreferrer" = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus_library/metrics'), target: '_blank', rel: "noopener noreferrer"
.col-lg-9 .col-lg-9
.card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { active_custom_metrics: project_prometheus_metrics_path(@project), environments_data: environments_list_data } } = render_if_exists 'projects/services/prometheus/metrics', project: @project
.card-header
%h3.card-title
= s_('PrometheusService|Custom metrics')
%span.badge.badge-pill.js-custom-monitored-count 0
= link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(@project), class: 'btn btn-success js-new-metric-button hidden'
.card-body
.flash-container.hidden
.flash-warning
.flash-text
.loading-metrics.js-loading-custom-metrics
%p.prepend-top-10.prepend-left-10
= icon('spinner spin', class: 'metrics-load-spinner')
= s_('PrometheusService|Finding custom metrics...')
.empty-metrics.hidden.js-empty-custom-metrics
= link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(@project), class: 'btn btn-success prepend-top-10 prepend-left-10 append-bottom-10'
%ul.list-unstyled.metrics-list.hidden.js-custom-metrics-list
.card.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/metrics') } }
.card-header
%h3.card-title
= s_('PrometheusService|Common metrics')
%span.badge.badge-pill.js-monitored-count 0
.card-body
.loading-metrics.js-loading-metrics
%p.prepend-top-10.prepend-left-10
= icon('spinner spin', class: 'metrics-load-spinner')
= s_('PrometheusService|Finding and configuring metrics...')
.empty-metrics.hidden.js-empty-metrics
%p.text-tertiary.prepend-top-10.prepend-left-10
= s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics')
%ul.list-unstyled.metrics-list.hidden.js-metrics-list
.card.hidden.js-panel-missing-env-vars
.card-header
%h3.card-title
= icon('caret-right lg fw', class: 'panel-toggle js-panel-toggle', 'aria-label' => 'Toggle panel')
= s_('PrometheusService|Missing environment variable')
%span.badge.badge-pill.js-env-var-count 0
.card-body.hidden
.flash-container
.flash-notice
.flash-text
= s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "<code>$CI_ENVIRONMENT_SLUG</code>" }).html_safe
= link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels')
%ul.list-unstyled.metrics-list.js-missing-var-metrics-list
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
= link_to new_project_tag_path(@project), class: 'btn btn-create new-tag-btn' do = link_to new_project_tag_path(@project), class: 'btn btn-create new-tag-btn' do
= s_('TagsPage|New tag') = s_('TagsPage|New tag')
= render 'projects/commits/mirror_status' = render_if_exists 'projects/commits/mirror_status'
.tags .tags
- if @tags.any? - if @tags.any?
......
...@@ -22,12 +22,6 @@ module EE ...@@ -22,12 +22,6 @@ module EE
validates :group, :user, validates :group, :user,
absence: true, absence: true,
unless: :protected_refs_for_users_required_and_available unless: :protected_refs_for_users_required_and_available
scope :by_user, -> (user) { where(user: user ) }
scope :by_group, -> (group) { where(group: group ) }
scope :for_role, -> { where(user: nil, group: nil) }
scope :for_user, -> { where.not(user: nil) }
scope :for_group, -> { where.not(group: nil) }
end end
def type def type
......
- protected_tag = local_assigns.fetch(:protected_tag)
- user_create_access_levels = protected_tag.create_access_levels.for_user
- group_create_access_levels = protected_tag.create_access_levels.for_group
- if user_create_access_levels.any?
%p.small
The following
= 'user'.pluralize(user_create_access_levels.size)
can also create tags:
= user_create_access_levels.map(&:humanize).to_sentence
- if group_create_access_levels.any?
%p.small
Members of
= group_create_access_levels.size > 1 ? 'these groups' : 'this group'
can also create tags:
= group_create_access_levels.map(&:humanize).to_sentence
- create_access_level = protected_tag.create_access_levels.for_role.first
- user_create_access_levels = protected_tag.create_access_levels.for_user
- group_create_access_levels =protected_tag.create_access_levels.for_group
%td
= hidden_field_tag "allowed_to_create_#{protected_tag.id}", create_access_level&.access_level
= dropdown_tag( (create_access_level&.humanize || 'Select') ,
options: { toggle_class: 'js-allowed-to-create', dropdown_class: 'dropdown-menu-selectable capitalize-header js-allowed-to-create-container',
data: { field_name: "allowed_to_create_#{protected_tag.id}", access_level_id: create_access_level&.id }})
- if user_create_access_levels.any?
%p.small
The following
#{ 'user'.pluralize(user_create_access_levels.size) }
can also create tags:
#{ user_create_access_levels.map(&:humanize).to_sentence }
- if group_create_access_levels.any?
%p.small
Members of
#{ group_create_access_levels.size > 1 ? 'these groups' : 'this group' }
can also create tags:
#{ group_create_access_levels.map(&:humanize).to_sentence }
- project = local_assigns.fetch(:project)
.card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data } }
.card-header
%h3.card-title
= s_('PrometheusService|Custom metrics')
%span.badge.badge-pill.js-custom-monitored-count 0
= link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn btn-success js-new-metric-button hidden'
.card-body
.flash-container.hidden
.flash-warning
.flash-text
.loading-metrics.js-loading-custom-metrics
%p.prepend-top-10.prepend-left-10
= icon('spinner spin', class: 'metrics-load-spinner')
= s_('PrometheusService|Finding custom metrics...')
.empty-metrics.hidden.js-empty-custom-metrics
= link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn btn-success prepend-top-10 prepend-left-10 append-bottom-10'
%ul.list-unstyled.metrics-list.hidden.js-custom-metrics-list
= render_ce 'projects/services/prometheus/metrics', project: project
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment