Fixed issue boards when not logged in
This commit is contained in:
parent
763a89a301
commit
b16780f766
7 changed files with 10 additions and 6 deletions
|
@ -266,7 +266,7 @@ class Issue < ActiveRecord::Base
|
|||
|
||||
def as_json(options = {})
|
||||
super(options).tap do |json|
|
||||
json[:subscribed] = subscribed?(options[:user]) if options.has_key?(:user)
|
||||
json[:subscribed] = subscribed?(options[:user]) if options.has_key?(:user) && options[:user]
|
||||
|
||||
if options.has_key?(:labels)
|
||||
json[:labels] = labels.as_json(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%board-sidebar{ "inline-template" => true,
|
||||
":current-user" => "#{current_user.to_json(only: [:username, :id, :name], methods: [:avatar_url]) if current_user}" }
|
||||
":current-user" => "#{current_user ? current_user.to_json(only: [:username, :id, :name], methods: [:avatar_url]) : {}}" }
|
||||
%aside.right-sidebar.right-sidebar-expanded.issue-boards-sidebar{ "v-show" => "showSidebar" }
|
||||
.issuable-sidebar
|
||||
.block.issuable-sidebar-header
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.block.assignee
|
||||
.title.hide-collapsed
|
||||
Assignee
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
- if can?(current_user, :admin_issue, @project)
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
= link_to "Edit", "#", class: "edit-link pull-right"
|
||||
.value.hide-collapsed
|
||||
%span.assign-yourself.no-value{ "v-if" => "!issue.assignee" }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.block.due_date
|
||||
.title
|
||||
Due date
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
- if can?(current_user, :admin_issue, @project)
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
= link_to "Edit", "#", class: "edit-link pull-right"
|
||||
.value
|
||||
.value-content
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.block.labels
|
||||
.title
|
||||
Labels
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
- if can?(current_user, :admin_issue, @project)
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
= link_to "Edit", "#", class: "edit-link pull-right"
|
||||
.value.issuable-show-labels
|
||||
%span.no-value{ "v-if" => "issue.labels && issue.labels.length === 0" }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.block.milestone
|
||||
.title
|
||||
Milestone
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
- if can?(current_user, :admin_issue, @project)
|
||||
= icon("spinner spin", class: "block-loading")
|
||||
= link_to "Edit", "#", class: "edit-link pull-right"
|
||||
.value
|
||||
%span.no-value{ "v-if" => "!issue.milestone" }
|
||||
|
|
|
@ -659,6 +659,10 @@ describe 'Issue Boards', feature: true, js: true do
|
|||
wait_for_vue_resource
|
||||
end
|
||||
|
||||
it 'displays lists' do
|
||||
expect(page).to have_selector('.board')
|
||||
end
|
||||
|
||||
it 'does not show create new list' do
|
||||
expect(page).not_to have_selector('.js-new-board-list')
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue