Commit 982a6c39 authored by Mike Greiling's avatar Mike Greiling

scope "hide warning" buttons to the specific namespace path

parent 3294f46e
......@@ -38,13 +38,17 @@
return e.preventDefault();
});
$('.hide-shared-runner-limit-message-one-month').on('click', function(e) {
Cookies.set('hide_shared_runner_quota_message', 'false', { expires: 31 });
$(this).parents('.shared-runner-quota-message').remove();
var $alert = $(this).parents('.shared-runner-quota-message');
var scope = $alert.data('scope');
Cookies.set('hide_shared_runner_quota_message', 'false', { expires: 31, path: scope });
$alert.remove();
e.preventDefault();
});
$('.hide-shared-runner-limit-message').on('click', function(e) {
Cookies.set('hide_shared_runner_quota_message', 'false');
$(this).parents('.shared-runner-quota-message').remove();
var $alert = $(this).parents('.shared-runner-quota-message');
var scope = $alert.data('scope');
Cookies.set('hide_shared_runner_quota_message', 'false', { path: scope });
$alert.remove();
e.preventDefault();
});
this.projectSelectDropdown();
......
- project = local_assigns.fetch(:project, nil)
- if cookies[:hide_shared_runner_quota_message].blank? && project.shared_runners_minutes_quota? && namespace.shared_runners_minutes_used? && can?(current_user, :create_pipeline, project)
.shared-runner-quota-message.alert.alert-warning.hidden-xs
- namespace = local_assigns.fetch(:namespace, project && project.namespace)
- scope = (project || namespace).full_path
- has_limit = (project || namespace).shared_runners_minutes_limit_enabled?
- can_see_status = project.nil? || can?(current_user, :create_pipeline, project)
- if cookies[:hide_shared_runner_quota_message].blank? && has_limit && namespace.shared_runners_minutes_used? && can_see_status
.shared-runner-quota-message.alert.alert-warning.hidden-xs{ data: { scope: scope }}
= namespace.name
has exceeded its build minutes quota. Pipelines will not run anymore on shared runners.
has exceeded their build minutes quota. Pipelines will not run anymore on shared runners.
.pull-right
= link_to "Don't show again this month", '#', class: 'hide-shared-runner-limit-message-one-month alert-link'
......
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