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
36c12693
Commit
36c12693
authored
Dec 08, 2021
by
Mike Greiling
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-unused-partial' into 'master'
Remove unused partial See merge request gitlab-org/gitlab!76262
parents
8e4fed9e
7eb7aba5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
91 deletions
+0
-91
app/views/projects/buttons/_dropdown.html.haml
app/views/projects/buttons/_dropdown.html.haml
+0
-42
locale/gitlab.pot
locale/gitlab.pot
+0
-3
qa/qa/page/project/show.rb
qa/qa/page/project/show.rb
+0
-4
spec/views/projects/buttons/_dropdown.html.haml_spec.rb
spec/views/projects/buttons/_dropdown.html.haml_spec.rb
+0
-42
No files found.
app/views/projects/buttons/_dropdown.html.haml
deleted
100644 → 0
View file @
8e4fed9e
-
can_create_issue
=
show_new_issue_link?
(
@project
)
-
can_create_project_snippet
=
can?
(
current_user
,
:create_snippet
,
@project
)
-
can_push_code
=
can?
(
current_user
,
:push_code
,
@project
)
-
create_mr_from_new_fork
=
can?
(
current_user
,
:fork_project
,
@project
)
&&
can?
(
current_user
,
:create_merge_request_in
,
@project
)
-
merge_project
=
merge_request_source_project_for_project
(
@project
)
-
show_menu
=
can_create_issue
||
can_create_project_snippet
||
can_push_code
||
create_mr_from_new_fork
||
merge_project
-
if
show_menu
.project-action-button.dropdown.inline
<
%a
.btn.btn-default.gl-button.dropdown-toggle.has-tooltip.qa-create-new-dropdown
{
href:
'#'
,
title:
_
(
'Create new...'
),
'data-toggle'
=>
'dropdown'
,
'data-container'
=>
'body'
,
'aria-label'
=>
_
(
'Create new...'
),
'data-display'
=>
'static'
}
=
sprite_icon
(
'plus'
,
css_class:
'gl-icon'
)
=
sprite_icon
(
"chevron-down"
,
css_class:
'gl-icon'
)
%ul
.dropdown-menu.dropdown-menu-right.project-home-dropdown
-
if
can_create_issue
||
merge_project
||
can_create_project_snippet
%li
.dropdown-header
=
_
(
'This project'
)
-
if
can_create_issue
%li
=
link_to
_
(
'New issue'
),
new_project_issue_path
(
@project
)
-
if
merge_project
%li
=
link_to
_
(
'New merge request'
),
project_new_merge_request_path
(
merge_project
)
-
if
can_create_project_snippet
%li
=
link_to
_
(
'New snippet'
),
new_project_snippet_path
(
@project
)
-
if
can_push_code
%li
.dropdown-header
=
_
(
'This repository'
)
-
if
can_push_code
%li
.qa-new-file-option
=
link_to
_
(
'New file'
),
project_new_blob_path
(
@project
,
@project
.
default_branch_or_main
)
-
unless
@project
.
empty_repo?
%li
=
link_to
_
(
'New branch'
),
new_project_branch_path
(
@project
)
%li
=
link_to
_
(
'New tag'
),
new_project_tag_path
(
@project
)
-
elsif
can_collaborate_with_project?
(
@project
)
%li
=
link_to
_
(
'New file'
),
project_new_blob_path
(
@project
,
@project
.
default_branch_or_main
)
-
elsif
create_mr_from_new_fork
-
continue_params
=
{
to:
project_new_blob_path
(
@project
,
@project
.
default_branch_or_main
),
notice:
edit_in_new_fork_notice
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
project_forks_path
(
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
%li
=
link_to
_
(
'New file'
),
fork_path
,
method: :post
locale/gitlab.pot
View file @
36c12693
...
@@ -9932,9 +9932,6 @@ msgstr ""
...
@@ -9932,9 +9932,6 @@ msgstr ""
msgid "Create new project"
msgid "Create new project"
msgstr ""
msgstr ""
msgid "Create new..."
msgstr ""
msgid "Create or import your first project"
msgid "Create or import your first project"
msgstr ""
msgstr ""
...
...
qa/qa/page/project/show.rb
View file @
36c12693
...
@@ -45,10 +45,6 @@ module QA
...
@@ -45,10 +45,6 @@ module QA
element
:tree_holder
,
'.tree-holder'
# rubocop:disable QA/ElementWithPattern
element
:tree_holder
,
'.tree-holder'
# rubocop:disable QA/ElementWithPattern
end
end
view
'app/views/projects/buttons/_dropdown.html.haml'
do
element
:create_new_dropdown
end
view
'app/views/projects/buttons/_fork.html.haml'
do
view
'app/views/projects/buttons/_fork.html.haml'
do
element
:fork_label
,
"%span= s_('ProjectOverview|Fork')"
# rubocop:disable QA/ElementWithPattern
element
:fork_label
,
"%span= s_('ProjectOverview|Fork')"
# rubocop:disable QA/ElementWithPattern
element
:fork_link
,
"link_to new_project_fork_path(@project)"
# rubocop:disable QA/ElementWithPattern
element
:fork_link
,
"link_to new_project_fork_path(@project)"
# rubocop:disable QA/ElementWithPattern
...
...
spec/views/projects/buttons/_dropdown.html.haml_spec.rb
deleted
100644 → 0
View file @
8e4fed9e
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'projects/buttons/_dropdown'
do
let
(
:user
)
{
create
(
:user
)
}
context
'user with all abilities'
do
before
do
assign
(
:project
,
project
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:can?
).
with
(
user
,
:push_code
,
project
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:can_collaborate_with_project?
).
and_return
(
true
)
end
context
'empty repository'
do
let
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
it
'has a link to create a new file'
do
render
expect
(
view
).
to
render_template
(
'projects/buttons/_dropdown'
)
expect
(
rendered
).
to
have_link
(
'New file'
)
end
it
'does not have a link to create a new branch'
do
render
expect
(
view
).
to
render_template
(
'projects/buttons/_dropdown'
)
expect
(
rendered
).
not_to
have_link
(
'New branch'
)
end
it
'does not have a link to create a new tag'
do
render
expect
(
view
).
to
render_template
(
'projects/buttons/_dropdown'
)
expect
(
rendered
).
not_to
have_link
(
'New tag'
)
end
end
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