Commit e12ccef0 authored by Peter Hegman's avatar Peter Hegman Committed by Andrew Fontaine

Move `js-*` class to fix E2E spec

`.js-epic-container` was being added to multiple elements which was
causing JS errors
parent f3c349fa
...@@ -5,7 +5,7 @@ import { parseBoolean } from '~/lib/utils/common_utils'; ...@@ -5,7 +5,7 @@ import { parseBoolean } from '~/lib/utils/common_utils';
export default class EpicTabs { export default class EpicTabs {
constructor() { constructor() {
this.epicTreesEnabled = gon.features && gon.features.epicTrees; this.epicTreesEnabled = gon.features && gon.features.epicTrees;
this.wrapper = document.querySelector('.js-epic-container:not(.breadcrumbs)'); this.wrapper = document.querySelector('.js-epic-container');
this.epicTabs = this.wrapper.querySelector('.js-epic-tabs-container'); this.epicTabs = this.wrapper.querySelector('.js-epic-tabs-container');
this.discussionFilterContainer = this.epicTabs.querySelector('.js-discussion-filter-container'); this.discussionFilterContainer = this.epicTabs.querySelector('.js-discussion-filter-container');
const allowSubEpics = parseBoolean(this.epicTabs.dataset.allowSubEpics); const allowSubEpics = parseBoolean(this.epicTabs.dataset.allowSubEpics);
......
- @no_breadcrumb_container = false - @no_breadcrumb_container = false
- @no_container = false - @no_container = true
- @content_class = "js-epic-container #{'limit-container-width' unless fluid_layout}" - @content_class = 'limit-container-width' unless fluid_layout
- epic_reference = @epic.to_reference - epic_reference = @epic.to_reference
- sub_epics_feature_available = @group.feature_available?(:subepics) - sub_epics_feature_available = @group.feature_available?(:subepics)
...@@ -23,63 +23,64 @@ ...@@ -23,63 +23,64 @@
- add_page_startup_graphql_call('epic/epic_details', { fullPath: @group.full_path, iid: @epic.iid }) - add_page_startup_graphql_call('epic/epic_details', { fullPath: @group.full_path, iid: @epic.iid })
- add_page_startup_graphql_call('epic/epic_children', { fullPath: @group.full_path, iid: @epic.iid, pageSize: 100, epicEndCursor: '', issueEndCursor: '' }) - add_page_startup_graphql_call('epic/epic_children', { fullPath: @group.full_path, iid: @epic.iid, pageSize: 100, epicEndCursor: '', issueEndCursor: '' })
#epic-app-root{ data: epic_show_app_data(@epic), %div{ class: ['js-epic-container', container_class, @content_class] }
'data-allow-sub-epics' => allow_sub_epics } #epic-app-root{ data: epic_show_app_data(@epic),
'data-allow-sub-epics' => allow_sub_epics }
.epic-tabs-holder .epic-tabs-holder
.epic-tabs-container.js-epic-tabs-container{ data: { allow_sub_epics: allow_sub_epics } } .epic-tabs-container.js-epic-tabs-container{ data: { allow_sub_epics: allow_sub_epics } }
%ul.epic-tabs.nav-tabs.nav.nav-links.scrolling-tabs %ul.epic-tabs.nav-tabs.nav.nav-links.scrolling-tabs
%li.tree-tab %li.tree-tab
%a#tree-tab.active{ href: '#tree', data: { toggle: 'tab' } } %a#tree-tab.active{ href: '#tree', data: { toggle: 'tab' } }
- if sub_epics_feature_available - if sub_epics_feature_available
= _('Epics and Issues') = _('Epics and Issues')
- else - else
= _('Issues') = _('Issues')
- if sub_epics_feature_available - if sub_epics_feature_available
%li.roadmap-tab %li.roadmap-tab
%a#roadmap-tab{ href: '#roadmap', data: { toggle: 'tab' } } %a#roadmap-tab{ href: '#roadmap', data: { toggle: 'tab' } }
= _('Roadmap') = _('Roadmap')
.tab-content.epic-tabs-content.js-epic-tabs-content .tab-content.epic-tabs-content.js-epic-tabs-content
#tree.tab-pane.show.active #tree.tab-pane.show.active
.row
%section.col-md-12
#js-tree{ data: { id: @epic.to_global_id,
numerical_id: @epic.id,
iid: @epic.iid,
group_id: @group.id,
full_path: @group.full_path,
auto_complete_epics: 'true',
auto_complete_issues: 'true',
user_signed_in: current_user.present? ? 'true' : 'false',
allow_sub_epics: allow_sub_epics,
allow_issuable_health_status: allow_issuable_health_status,
initial: issuable_initial_data(@epic).to_json } }
- if sub_epics_feature_available
#roadmap.tab-pane
.row .row
%section.col-md-12 %section.col-md-12
#js-roadmap{ data: { epics_path: group_epics_path(@group, parent_id: @epic.id, format: :json), #js-tree{ data: { id: @epic.to_global_id,
group_id: @group.id, numerical_id: @epic.id,
iid: @epic.iid, iid: @epic.iid,
group_id: @group.id,
full_path: @group.full_path, full_path: @group.full_path,
empty_state_illustration: image_path('illustrations/epics/roadmap.svg'), auto_complete_epics: 'true',
has_filters_applied: 'false', auto_complete_issues: 'true',
new_epic_endpoint: group_epics_path(@group), user_signed_in: current_user.present? ? 'true' : 'false',
preset_type: roadmap_layout, allow_sub_epics: allow_sub_epics,
epics_state: 'all', allow_issuable_health_status: allow_issuable_health_status,
sorted_by: roadmap_sort_order, initial: issuable_initial_data(@epic).to_json } }
inner_height: '600', - if sub_epics_feature_available
child_epics: 'true' } } #roadmap.tab-pane
%hr.epic-discussion-separator.mt-1.mb-0 .row
.d-flex.justify-content-between.content-block.content-block-small.emoji-list-container.js-noteable-awards %section.col-md-12
= render 'award_emoji/awards_block', awardable: @epic, inline: true #js-roadmap{ data: { epics_path: group_epics_path(@group, parent_id: @epic.id, format: :json),
.d-flex.flex-wrap.align-items-center.justify-content-lg-end group_id: @group.id,
#js-vue-sort-issue-discussions iid: @epic.iid,
#js-vue-discussion-filter{ data: { default_filter: current_user&.notes_filter_for(@epic), full_path: @group.full_path,
notes_filters: UserPreference.notes_filters.to_json } } empty_state_illustration: image_path('illustrations/epics/roadmap.svg'),
.row has_filters_applied: 'false',
%section.col-md-12 new_epic_endpoint: group_epics_path(@group),
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe preset_type: roadmap_layout,
.issuable-discussion epics_state: 'all',
= render 'discussion' sorted_by: roadmap_sort_order,
inner_height: '600',
child_epics: 'true' } }
%hr.epic-discussion-separator.mt-1.mb-0
.d-flex.justify-content-between.content-block.content-block-small.emoji-list-container.js-noteable-awards
= render 'award_emoji/awards_block', awardable: @epic, inline: true
.d-flex.flex-wrap.align-items-center.justify-content-lg-end
#js-vue-sort-issue-discussions
#js-vue-discussion-filter{ data: { default_filter: current_user&.notes_filter_for(@epic),
notes_filters: UserPreference.notes_filters.to_json } }
.row
%section.col-md-12
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
.issuable-discussion
= render 'discussion'
---
title: Fix Epic tabs when open registration alert is visible
merge_request: 49150
author:
type: fixed
...@@ -36,7 +36,7 @@ module QA ...@@ -36,7 +36,7 @@ module QA
epic.visit! epic.visit!
end end
it 'adds/removes issue to/from epic', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/526', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/283932', type: :investigating } do it 'adds/removes issue to/from epic', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/526' do
EE::Page::Group::Epic::Show.perform do |show| EE::Page::Group::Epic::Show.perform do |show|
show.add_issue_to_epic(issue.web_url) show.add_issue_to_epic(issue.web_url)
......
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