Added CSP view helpers (#259)

* Added CSP view helpers\nhttps://github.com/opf/openproject/pull/5884

* Fix moved project settings links

[ci skip]
pull/6827/head
Oliver Günther 7 years ago committed by GitHub
parent 5e875c9b73
commit 0961b792f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/helpers/rb_common_helper.rb
  2. 1
      config/locales/en.yml
  3. 2
      lib/open_project/backlogs/hooks.rb
  4. 4
      lib/open_project/backlogs/patches/projects_controller_patch.rb
  5. 4
      spec/controllers/versions_controller_spec.rb

@ -185,7 +185,7 @@ module RbCommonHelper
{},
class: 'show_burndown_chart button')
ret += javascript_tag "
ret += nonced_javascript_tag "
jQuery(document).ready(function(){
var burndown = RB.Factory.initialize(RB.Burndown, jQuery('.show_burndown_chart'));
burndown.setSprintId(#{sprint.id});

@ -163,6 +163,7 @@ en:
label_stories_tasks: "Stories/Tasks"
label_task_board: "Task board"
label_version_setting: "Versions"
label_version: 'Version'
label_webcal: "Webcal Feed"
label_wiki: "Wiki"

@ -93,7 +93,7 @@ module OpenProject::Backlogs::Hooks
# This wouldn't be necesary if the schedules plugin didn't disable the
# contextual hook
snippet += javascript_tag(<<-JS)
snippet += nonced_javascript_tag(<<-JS)
(function ($) {
$(document).ready(function() {
$('#edit_wiki_page_action').detach().appendTo("div.contextual");

@ -58,7 +58,7 @@ module OpenProject::Backlogs::Patches::ProjectsControllerPatch
flash[:notice] = l(:notice_successful_update)
redirect_to action: 'settings', id: @project, tab: 'backlogs_settings'
redirect_to controller: '/project_settings', action: 'show', id: @project, tab: 'backlogs_settings'
end
def rebuild_positions
@ -73,7 +73,7 @@ module OpenProject::Backlogs::Patches::ProjectsControllerPatch
logger.error($!)
logger.error($@)
redirect_to action: 'settings', id: @project, tab: 'backlogs_settings'
redirect_to controller: '/project_settings', action: 'show', id: @project, tab: 'backlogs_settings'
end
end
end

@ -57,7 +57,7 @@ describe VersionsController, type: :controller do
patch 'update', params: @params
@version.reload
expect(response).to redirect_to controller: '/projects', action: 'settings', tab: 'versions', id: @project
expect(response).to redirect_to controller: '/project_settings', action: 'show', tab: 'versions', id: @project
expect(@version.name).to eq(@oldVersionName)
end
@ -66,7 +66,7 @@ describe VersionsController, type: :controller do
patch 'update', params: @params
@version.reload
expect(response).to redirect_to controller: '/projects', action: 'settings', tab: 'versions', id: @version.project
expect(response).to redirect_to controller: '/project_settings', action: 'show', tab: 'versions', id: @version.project
expect(@version.name).to eq(@newVersionName)
end
end

Loading…
Cancel
Save