Commit 3032eef8 authored by peterhegman's avatar peterhegman

Hide "New issue" button on empty project issues page from auditors

Auditors have read-only permissions so can't create issues. Button
returned a 404
parent e10f7ccd
......@@ -43,7 +43,7 @@
.text-center
- if project_select_button
= render 'shared/new_project_item_select', path: 'issues/new', label: _('New issue'), type: :issues, with_feature_enabled: 'issues'
- else
- elsif show_new_issue_link?(@project)
= link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link'
- if show_import_button
......
---
title: Hide "New issue" button from Auditors on project issues page
merge_request: 56877
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Issues > User sees empty state' do
let_it_be(:project) { create(:project, :public) }
let_it_be(:auditor) { create(:user, auditor: true) }
context 'when signed in user is an Auditor' do
before do
sign_in(auditor)
end
it 'shows empty state without "New issue" button' do
visit project_issues_path(project)
expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project')
expect(page).to have_content('Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.')
expect(page).not_to have_link('New issue')
end
end
end
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