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
0cf37693
Commit
0cf37693
authored
Jan 18, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifies a settings page call - removes project.owner
Update tests
parent
1673727e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
app/helpers/avatars_helper.rb
app/helpers/avatars_helper.rb
+2
-2
app/models/project.rb
app/models/project.rb
+3
-0
ee/app/views/projects/settings/subscriptions/_project.html.haml
.../views/projects/settings/subscriptions/_project.html.haml
+2
-2
ee/spec/features/projects/settings/pipeline_subscriptions_spec.rb
...features/projects/settings/pipeline_subscriptions_spec.rb
+1
-1
spec/helpers/avatars_helper_spec.rb
spec/helpers/avatars_helper_spec.rb
+1
-1
No files found.
app/helpers/avatars_helper.rb
View file @
0cf37693
...
@@ -103,8 +103,8 @@ module AvatarsHelper
...
@@ -103,8 +103,8 @@ module AvatarsHelper
end
end
def
avatar_without_link
(
resource
,
options
=
{})
def
avatar_without_link
(
resource
,
options
=
{})
if
resource
.
is_a?
(
User
)
if
resource
.
is_a?
(
Namespaces
::
UserNamespace
)
user_avatar_without_link
(
options
.
merge
(
user:
resource
))
user_avatar_without_link
(
options
.
merge
(
user:
resource
.
first_owner
))
elsif
resource
.
is_a?
(
Group
)
elsif
resource
.
is_a?
(
Group
)
group_icon
(
resource
,
options
.
merge
(
class:
'avatar'
))
group_icon
(
resource
,
options
.
merge
(
class:
'avatar'
))
end
end
...
...
app/models/project.rb
View file @
0cf37693
...
@@ -1513,6 +1513,9 @@ class Project < ApplicationRecord
...
@@ -1513,6 +1513,9 @@ class Project < ApplicationRecord
# rubocop: enable CodeReuse/ServiceClass
# rubocop: enable CodeReuse/ServiceClass
def
owner
def
owner
# This will be phased out and replaced with `owners` relationship
# backed by memberships with direct/inherited Owner access roles
# See https://gitlab.com/gitlab-org/gitlab/-/issues/241503
group
||
namespace
.
try
(
:owner
)
group
||
namespace
.
try
(
:owner
)
end
end
...
...
ee/app/views/projects/settings/subscriptions/_project.html.haml
View file @
0cf37693
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
=
link_to
project
.
name
,
project_path
(
project
)
=
link_to
project
.
name
,
project_path
(
project
)
%td
%td
.gl-display-flex.gl-align-items-center
.gl-display-flex.gl-align-items-center
=
avatar_without_link
(
project
.
owner
,
size:
32
)
=
avatar_without_link
(
project
.
namespace
,
size:
32
)
=
project
.
owner
.
name
=
project
.
namespace
.
name
-
if
is_upstream_mode
-
if
is_upstream_mode
%td
.gl-text-right
%td
.gl-text-right
=
link_to
project_subscription_path
(
@project
,
subscription
.
id
),
method: :delete
,
data:
{
toggle:
'tooltip'
,
title:
tooltip
,
container:
'body'
,
testid:
'delete-subscription'
},
class:
"gl-button btn btn-danger"
do
=
link_to
project_subscription_path
(
@project
,
subscription
.
id
),
method: :delete
,
data:
{
toggle:
'tooltip'
,
title:
tooltip
,
container:
'body'
,
testid:
'delete-subscription'
},
class:
"gl-button btn btn-danger"
do
...
...
ee/spec/features/projects/settings/pipeline_subscriptions_spec.rb
View file @
0cf37693
...
@@ -55,7 +55,7 @@ RSpec.describe 'Project Subscriptions', :js do
...
@@ -55,7 +55,7 @@ RSpec.describe 'Project Subscriptions', :js do
end
end
expect
(
page
).
to
have_content
(
upstream_project
.
name
)
expect
(
page
).
to
have_content
(
upstream_project
.
name
)
expect
(
page
).
to
have_content
(
upstream_project
.
owner
.
name
)
expect
(
page
).
to
have_content
(
upstream_project
.
namespace
.
name
)
end
end
expect
(
page
).
to
have_content
(
'Subscription successfully created.'
)
expect
(
page
).
to
have_content
(
'Subscription successfully created.'
)
...
...
spec/helpers/avatars_helper_spec.rb
View file @
0cf37693
...
@@ -428,7 +428,7 @@ RSpec.describe AvatarsHelper do
...
@@ -428,7 +428,7 @@ RSpec.describe AvatarsHelper do
subject
{
helper
.
avatar_without_link
(
resource
,
options
)
}
subject
{
helper
.
avatar_without_link
(
resource
,
options
)
}
context
'with users'
do
context
'with users'
do
let
(
:resource
)
{
user
}
let
(
:resource
)
{
user
.
namespace
}
it
'displays user avatar'
do
it
'displays user avatar'
do
is_expected
.
to
eq
tag
(
is_expected
.
to
eq
tag
(
...
...
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