Get the project path through the DOM instead of `gon`
Open the settings section based on the location hash
This commit is contained in:
parent
edfb5d7b16
commit
38bcf699ab
|
@ -41,4 +41,8 @@ export default function initSettingsPanels() {
|
|||
$section.on('click.toggleSection', '.js-settings-toggle', () => toggleSection($section));
|
||||
$section.find('.settings-content:not(.expanded)').on('scroll.expandSection', () => expandSection($section));
|
||||
});
|
||||
|
||||
if (location.hash) {
|
||||
expandSection($(location.hash));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ export default class UserCallout {
|
|||
const $currentTarget = $(e.currentTarget);
|
||||
|
||||
if (this.options.setCalloutPerProject) {
|
||||
Cookies.set(this.cookieName, 'true', { expires: 365, path: gon.project_path });
|
||||
Cookies.set(this.cookieName, 'true', { expires: 365, path: this.userCalloutBody.data('project-path') });
|
||||
} else {
|
||||
Cookies.set(this.cookieName, 'true', { expires: 365 });
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ class Projects::ApplicationController < ApplicationController
|
|||
before_action :redirect_git_extension
|
||||
before_action :project
|
||||
before_action :repository
|
||||
before_action :add_gon_project_variables
|
||||
layout 'project'
|
||||
|
||||
helper_method :repository, :can_collaborate_with_project?
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
- expanded = Rails.env.test?
|
||||
|
||||
%section.settings
|
||||
%section.settings#js-general-pipeline-settings
|
||||
.settings-header
|
||||
%h4
|
||||
General pipelines settings
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.user-callout{ data: { uid: 'auto_devops_settings_dismissed' } }
|
||||
.user-callout{ data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }
|
||||
.bordered-box.landing.content-block
|
||||
%button.btn.btn-default.close.js-close-callout{ type: 'button',
|
||||
'aria-label' => 'Dismiss Auto DevOps box' }
|
||||
|
@ -12,4 +12,4 @@
|
|||
#{s_('LearnMoreInThe|Learn more in the')}
|
||||
= link_to _('Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer'
|
||||
|
||||
= link_to _('Enable in settings'), project_settings_ci_cd_path(@project), class: 'btn btn-primary js-close-callout'
|
||||
= link_to _('Enable in settings'), project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings'), class: 'btn btn-primary js-close-callout'
|
||||
|
|
|
@ -28,9 +28,5 @@ module Gitlab
|
|||
gon.current_user_avatar_url = current_user.avatar_url
|
||||
end
|
||||
end
|
||||
|
||||
def add_gon_project_variables
|
||||
gon.project_path = project_path(project)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue