Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fa29be3f
Commit
fa29be3f
authored
Nov 25, 2019
by
Dan Davison
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'qa-dd-general-refactor-1' into 'master'
General QA refactoring See merge request gitlab-org/gitlab!20390
parents
2302ca66
11fd204f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
26 deletions
+22
-26
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+2
-2
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+4
-4
app/views/shared/snippets/_header.html.haml
app/views/shared/snippets/_header.html.haml
+2
-2
ee/app/helpers/ee/labels_helper.rb
ee/app/helpers/ee/labels_helper.rb
+1
-1
qa/qa/page/dashboard/snippet/show.rb
qa/qa/page/dashboard/snippet/show.rb
+4
-8
qa/qa/page/issuable/sidebar.rb
qa/qa/page/issuable/sidebar.rb
+7
-6
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+2
-3
No files found.
app/helpers/labels_helper.rb
View file @
fa29be3f
...
...
@@ -47,11 +47,11 @@ module LabelsHelper
end
end
def
render_label
(
label
,
tooltip:
true
,
link:
nil
,
css:
nil
)
def
render_label
(
label
,
tooltip:
true
,
link:
nil
,
css:
nil
,
dataset:
nil
)
# if scoped label is used then EE wraps label tag with scoped label
# doc link
html
=
render_colored_label
(
label
,
tooltip:
tooltip
)
html
=
link_to
(
html
,
link
,
class:
css
)
if
link
html
=
link_to
(
html
,
link
,
class:
css
,
data:
dataset
)
if
link
html
end
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
fa29be3f
...
...
@@ -30,10 +30,10 @@
=
render_if_exists
'shared/issuable/sidebar_item_epic'
,
issuable_sidebar:
issuable_sidebar
-
milestone
=
issuable_sidebar
[
:milestone
]
||
{}
.block.milestone
.block.milestone
{
data:
{
qa_selector:
'milestone_block'
}
}
.sidebar-collapsed-icon.has-tooltip
{
title:
sidebar_milestone_tooltip_label
(
milestone
),
data:
{
container:
'body'
,
html:
'true'
,
placement:
'left'
,
boundary:
'viewport'
}
}
=
icon
(
'clock-o'
,
'aria-hidden'
:
'true'
)
%span
.milestone-title.collapse-truncated-title
%span
.milestone-title.collapse-truncated-title
{
data:
{
qa_selector:
'milestone_title'
}
}
-
if
milestone
.
present?
=
milestone
[
:title
]
-
else
...
...
@@ -107,10 +107,10 @@
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
-
if
can_edit_issuable
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link qa-edit-link-labels float-right'
,
data:
{
track_label:
"right_sidebar"
,
track_property:
"labels"
,
track_event:
"click_edit_button"
,
track_value:
""
}
.value.issuable-show-labels.dont-hide.hide-collapsed
.qa-labels-block
{
class:
(
"has-labels"
if
selected_labels
.
any?
)
}
.value.issuable-show-labels.dont-hide.hide-collapsed
{
class:
(
"has-labels"
if
selected_labels
.
any?
),
data:
{
qa_selector:
'labels_block'
}
}
-
if
selected_labels
.
any?
-
selected_labels
.
each
do
|
label_hash
|
=
render_label
(
label_from_hash
(
label_hash
).
present
(
issuable_subject:
nil
),
link:
sidebar_label_filter_path
(
issuable_sidebar
[
:project_issuables_path
],
label_hash
[
:title
]))
=
render_label
(
label_from_hash
(
label_hash
).
present
(
issuable_subject:
nil
),
link:
sidebar_label_filter_path
(
issuable_sidebar
[
:project_issuables_path
],
label_hash
[
:title
])
,
dataset:
{
qa_selector:
'label'
,
qa_label_name:
label_hash
[
:title
]
}
)
-
else
%span
.no-value
=
_
(
'None'
)
...
...
app/views/shared/snippets/_header.html.haml
View file @
fa29be3f
...
...
@@ -17,11 +17,11 @@
=
render
"snippets/actions"
.snippet-header.limited-header-width
%h2
.snippet-title.prepend-top-0.mb-3
.qa-snippet-title
%h2
.snippet-title.prepend-top-0.mb-3
{
data:
{
qa_selector:
'snippet_title'
}
}
=
markdown_field
(
@snippet
,
:title
)
-
if
@snippet
.
description
.
present?
.description
.qa-snippet-description
.description
{
data:
{
qa_selector:
'snippet_description'
}
}
.md
=
markdown_field
(
@snippet
,
:description
)
%textarea
.hidden.js-task-list-field
...
...
ee/app/helpers/ee/labels_helper.rb
View file @
fa29be3f
...
...
@@ -2,7 +2,7 @@
module
EE
module
LabelsHelper
def
render_label
(
label
,
tooltip:
true
,
link:
nil
,
css:
nil
)
def
render_label
(
label
,
tooltip:
true
,
link:
nil
,
css:
nil
,
dataset:
nil
)
content
=
super
content
=
scoped_label_wrapper
(
content
,
label
)
if
label
.
scoped_label?
...
...
qa/qa/page/dashboard/snippet/show.rb
View file @
fa29be3f
...
...
@@ -6,8 +6,8 @@ module QA
module
Snippet
class
Show
<
Page
::
Base
view
'app/views/shared/snippets/_header.html.haml'
do
element
:snippet_title
element
:snippet_description
element
:snippet_title
,
required:
true
element
:snippet_description
,
required:
true
element
:embed_type
element
:snippet_box
end
...
...
@@ -21,15 +21,11 @@ module QA
end
def
has_snippet_title?
(
snippet_title
)
within_element
(
:snippet_title
)
do
has_text?
(
snippet_title
)
end
has_element?
:snippet_title
,
text:
snippet_title
end
def
has_snippet_description?
(
snippet_description
)
within_element
(
:snippet_description
)
do
has_text?
(
snippet_description
)
end
has_element?
:snippet_description
,
text:
snippet_description
end
def
has_embed_type?
(
embed_type
)
...
...
qa/qa/page/issuable/sidebar.rb
View file @
fa29be3f
...
...
@@ -5,19 +5,20 @@ module QA
module
Issuable
class
Sidebar
<
Page
::
Base
view
'app/views/shared/issuable/_sidebar.html.haml'
do
element
:labels_block
,
".issuable-show-labels"
# rubocop:disable QA/ElementWithPattern
element
:milestones_block
,
'.block.milestone'
# rubocop:disable QA/ElementWithPattern
element
:labels_block
element
:milestone_block
element
:milestone_title
end
def
has_label?
(
label
)
page
.
within
(
'.issuable-show-labels'
)
do
!!
find
(
'span'
,
text
:
label
)
within_element
(
:labels_block
)
do
has_element?
(
:label
,
label_name
:
label
)
end
end
def
has_milestone?
(
milestone
)
page
.
within
(
'.block.milestone'
)
do
!!
find
(
"[href*='/milestones/']"
,
text:
milestone
)
within_element
(
:milestone_block
)
do
has_element?
(
:milestone_title
,
text:
milestone
)
end
end
end
...
...
qa/qa/page/merge_request/show.rb
View file @
fa29be3f
...
...
@@ -122,9 +122,8 @@ module QA
end
def
has_label?
(
label
)
page
.
within
(
element_selector_css
(
:labels_block
))
do
element
=
find
(
'span'
,
text:
label
)
!
element
.
nil?
within_element
(
:labels_block
)
do
!!
has_element?
(
:label
,
label_name:
label
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment