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
3cd154d9
Commit
3cd154d9
authored
May 04, 2021
by
Jay
Committed by
Bob Van Landuyt
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more detailed tracking for the new_dropdown
parent
cc3ee889
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
15 deletions
+47
-15
app/views/layouts/header/_new_dropdown.html.haml
app/views/layouts/header/_new_dropdown.html.haml
+11
-8
app/views/layouts/header/_new_repo_experiment.html.haml
app/views/layouts/header/_new_repo_experiment.html.haml
+5
-6
ee/app/views/layouts/header/_create_epic_new_dropdown_item.haml
.../views/layouts/header/_create_epic_new_dropdown_item.haml
+1
-1
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+29
-0
spec/views/layouts/header/_new_dropdown.haml_spec.rb
spec/views/layouts/header/_new_dropdown.haml_spec.rb
+1
-0
No files found.
app/views/layouts/header/_new_dropdown.html.haml
View file @
3cd154d9
-
new_repo_experiment_text
=
content_for
(
:new_repo_experiment
)
%li
.header-new.dropdown
{
data:
{
track_label:
"new_dropdown"
,
track_event:
"click_dropdown"
,
track_experiment:
"new_repo"
}
}
=
link_to
new_project_path
,
class:
"header-new-dropdown-toggle has-tooltip qa-new-menu-toggle"
,
id:
"js-onboarding-new-project-link"
,
title:
_
(
"New..."
),
ref:
'tooltip'
,
aria:
{
label:
_
(
"New..."
)
},
data:
{
toggle:
'dropdown'
,
placement:
'bottom'
,
container:
'body'
,
display:
'static'
}
do
=
sprite_icon
(
'plus-square'
)
...
...
@@ -12,9 +13,9 @@
%li
.dropdown-bold-header
=
_
(
'This group'
)
-
if
create_group_project
%li
=
link_to
_
(
'New project'
),
new_project_path
(
namespace_id:
@group
.
id
)
%li
=
link_to
new_repo_experiment_text
,
new_project_path
(
namespace_id:
@group
.
id
),
data:
{
track_experiment:
'new_repo'
,
track_event:
'click_link_new_project_group'
,
track_label:
'plus_menu_dropdown'
}
-
if
create_group_subgroup
%li
=
link_to
_
(
'New subgroup'
),
new_group_path
(
parent_id:
@group
.
id
)
%li
=
link_to
_
(
'New subgroup'
),
new_group_path
(
parent_id:
@group
.
id
)
,
data:
{
track_event:
'click_link_new_subgroup'
,
track_label:
'plus_menu_dropdown'
}
=
render_if_exists
'layouts/header/create_epic_new_dropdown_item'
=
render
'layouts/header/group_invite_members_new_dropdown_item'
%li
.divider
...
...
@@ -29,16 +30,18 @@
%li
.dropdown-bold-header
=
_
(
'This project'
)
-
if
create_project_issue
%li
=
link_to
_
(
'New issue'
),
new_project_issue_path
(
@project
)
%li
=
link_to
_
(
'New issue'
),
new_project_issue_path
(
@project
)
,
data:
{
track_event:
'click_link_new_issue'
,
track_label:
'plus_menu_dropdown'
}
-
if
merge_project
%li
=
link_to
_
(
'New merge request'
),
project_new_merge_request_path
(
merge_project
)
%li
=
link_to
_
(
'New merge request'
),
project_new_merge_request_path
(
merge_project
),
data:
{
track_event:
'click_link_new_mr'
,
track_label:
'plus_menu_dropdown'
}
-
if
create_project_snippet
%li
=
link_to
_
(
'New snippet'
),
new_project_snippet_path
(
@project
)
%li
=
link_to
_
(
'New snippet'
),
new_project_snippet_path
(
@project
)
,
data:
{
track_event:
'click_link_new_snippet_project'
,
track_label:
'plus_menu_dropdown'
}
=
render
'layouts/header/project_invite_members_new_dropdown_item'
%li
.divider
%li
.dropdown-bold-header
GitLab
=
content_for
:new_repo_experiment
-
if
current_user
.
can_create_project?
%li
=
link_to
new_repo_experiment_text
,
new_project_path
,
class:
'qa-global-new-project-link'
,
data:
{
track_experiment:
'new_repo'
,
track_event:
'click_link_new_project'
,
track_label:
'plus_menu_dropdown'
}
-
if
current_user
.
can_create_group?
%li
=
link_to
_
(
'New group'
),
new_group_path
%li
=
link_to
_
(
'New group'
),
new_group_path
,
data:
{
track_event:
'click_link_new_group'
,
track_label:
'plus_menu_dropdown'
}
-
if
current_user
.
can?
(
:create_snippet
)
%li
=
link_to
_
(
'New snippet'
),
new_snippet_path
,
class:
'qa-global-new-snippet-link'
%li
=
link_to
_
(
'New snippet'
),
new_snippet_path
,
data:
{
track_event:
'click_link_new_snippet_parent'
,
track_label:
'plus_menu_dropdown'
},
class:
'qa-global-new-snippet-link'
app/views/layouts/header/_new_repo_experiment.html.haml
View file @
3cd154d9
-
content_for
:new_repo_experiment
do
-
if
current_user
&
.
can_create_project?
-
experiment
(
:new_repo
,
user:
current_user
)
do
|
e
|
-
e
.
use
do
%li
=
link_to
_
(
'New project'
),
new_project_path
,
class:
'qa-global-new-project-link'
,
data:
{
track_experiment:
'new_repo'
,
track_event:
'click_link'
,
track_label:
'plus_menu_dropdown'
}
-
e
.
try
do
%li
=
link_to
_
(
'New project/repository'
),
new_project_path
,
class:
'qa-global-new-project-link'
,
data:
{
track_experiment:
'new_repo'
,
track_event:
'click_link'
,
track_label:
'plus_menu_dropdown'
}
-
experiment
(
:new_repo
,
user:
current_user
)
do
|
e
|
-
e
.
use
do
=
_
(
'New project'
)
-
e
.
try
do
=
_
(
'New project/repository'
)
ee/app/views/layouts/header/_create_epic_new_dropdown_item.haml
View file @
3cd154d9
-
return
unless
can?
(
current_user
,
:create_epic
,
@group
)
%li
=
link_to
_
(
'New epic'
),
new_group_epic_path
(
@group
)
%li
=
link_to
_
(
'New epic'
),
new_group_epic_path
(
@group
)
,
data:
{
track_event:
'click_link_new_epic'
,
track_label:
'plus_menu_dropdown'
}
spec/features/groups_spec.rb
View file @
3cd154d9
...
...
@@ -439,6 +439,35 @@ RSpec.describe 'Group' do
end
end
describe
'new_repo experiment'
do
let_it_be
(
:group
)
{
create_default
(
:group
)
}
it
'when in candidate renders "project/repository"'
do
stub_experiments
(
new_repo: :candidate
)
visit
group_path
(
group
)
find
(
'li.header-new.dropdown'
).
click
page
.
within
(
'li.header-new.dropdown'
)
do
expect
(
page
).
to
have_selector
(
'a'
,
text:
'New project/repository'
)
end
end
it
'when in control renders "project/repository"'
do
stub_experiments
(
new_repo: :control
)
visit
group_path
(
group
)
find
(
'li.header-new.dropdown'
).
click
page
.
within
(
'li.header-new.dropdown'
)
do
expect
(
page
).
to
have_selector
(
'a'
,
text:
'New project'
)
expect
(
page
).
to
have_no_selector
(
'a'
,
text:
'New project/repository'
)
end
end
end
def
remove_with_confirm
(
button_text
,
confirm_with
)
click_button
button_text
fill_in
'confirm_name_input'
,
with:
confirm_with
...
...
spec/views/layouts/header/_new_dropdown.haml_spec.rb
View file @
3cd154d9
...
...
@@ -52,6 +52,7 @@ RSpec.describe 'layouts/header/_new_dropdown' do
end
it
'has a "New project" link'
do
render
(
'layouts/header/new_repo_experiment'
)
render
expect
(
rendered
).
to
have_link
(
'New project'
,
href:
new_project_path
(
namespace_id:
group
.
id
))
...
...
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