Commit e1085b25 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'issue_325742' into 'master'

Prevent executing expensive query to show group issues zero state view

See merge request gitlab-org/gitlab!57411
parents 69f1919c 8d06b52e
......@@ -5,10 +5,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@group.name} issues")
- if group_issues_count(state: 'all') == 0
= render 'shared/empty_states/issues', project_select_button: true
- else
.top-area
.top-area
= render 'shared/issuable/nav', type: :issues
.nav-controls
= render 'shared/issuable/feed_buttons'
......@@ -18,12 +15,12 @@
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues, with_feature_enabled: 'issues', with_shared: false, include_projects_in_subgroups: true
= render 'shared/issuable/search_bar', type: :issues
= render 'shared/issuable/search_bar', type: :issues
- if @can_bulk_update
- if @can_bulk_update
= render_if_exists 'shared/issuable/group_bulk_update_sidebar', group: @group, type: :issues
- if Feature.enabled?(:vue_issuables_list, @group)
- if Feature.enabled?(:vue_issuables_list, @group) && @issues.to_a.any?
- if use_startup_call?
- add_page_startup_api_call(api_v4_groups_issues_path(id: @group.id, params: startup_call_params))
.js-issuables-list{ data: { endpoint: expose_url(api_v4_groups_issues_path(id: @group.id)),
......@@ -32,5 +29,5 @@
'sort-key': @sort,
type: 'issues',
'scoped-labels-available': scoped_labels_available?(@group).to_json } }
- else
= render 'shared/issues'
- else
= render 'shared/issues', project_select_button: true
......@@ -3,4 +3,5 @@
= render partial: 'projects/issues/issue', collection: @issues
= paginate @issues, theme: "gitlab"
- else
= render 'shared/empty_states/issues'
- project_select_button = local_assigns.fetch(:project_select_button, false)
= render 'shared/empty_states/issues', project_select_button: project_select_button
......@@ -108,7 +108,7 @@ RSpec.describe 'Group issues page' do
it 'shows projects only with issues feature enabled', :js do
find('.empty-state .js-lazy-loaded')
find('.new-project-item-link').click
find('.empty-state .new-project-item-link').click
page.within('.select2-results') do
expect(page).to have_content(project.full_name)
......
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