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
08286581
Commit
08286581
authored
Jul 12, 2021
by
Coung Ngo
Committed by
Jose Ivan Vargas
Jul 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GlAvatar in `group_item.vue`
parent
b6f67b19
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
app/assets/javascripts/groups/components/group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+16
-16
spec/features/groups/show_spec.rb
spec/features/groups/show_spec.rb
+4
-4
spec/frontend/groups/components/group_item_spec.js
spec/frontend/groups/components/group_item_spec.js
+5
-5
No files found.
app/assets/javascripts/groups/components/group_item.vue
View file @
08286581
<
script
>
import
{
GlAvatar
,
GlLoadingIcon
,
GlBadge
,
GlIcon
,
...
...
@@ -7,7 +8,6 @@ import {
GlSafeHtmlDirective
,
}
from
'
@gitlab/ui
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
identicon
from
'
~/vue_shared/components/identicon.vue
'
;
import
UserAccessRoleBadge
from
'
~/vue_shared/components/user_access_role_badge.vue
'
;
import
{
VISIBILITY_TYPE_ICON
,
GROUP_VISIBILITY_TYPE
}
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
...
...
@@ -23,11 +23,11 @@ export default {
SafeHtml
:
GlSafeHtmlDirective
,
},
components
:
{
GlAvatar
,
GlBadge
,
GlLoadingIcon
,
GlIcon
,
UserAccessRoleBadge
,
identicon
,
itemCaret
,
itemTypeIcon
,
itemStats
,
...
...
@@ -125,21 +125,21 @@ export default {
size=
"lg"
class=
"d-none d-sm-inline-flex flex-shrink-0 gl-mr-3"
/>
<div
:class=
"
{ 'd-sm-flex': !group.isChildrenLoading }"
class="avatar-container rect-avatar s32 d-none flex-grow-0 flex-shrink-0"
<a
:class=
"
{ 'gl-sm-display-flex': !group.isChildrenLoading }"
class="gl-display-none gl-text-decoration-none! gl-mr-3"
:href="group.relativePath"
:aria-label="group.name"
>
<
a
:href=
"group.relativePath"
class=
"no-expand"
>
<img
v-if=
"hasAvatar
"
<
gl-avatar
shape=
"rect"
:entity-name=
"group.name
"
:src=
"group.avatarUrl"
data-testid=
"group-avatar
"
class=
"avatar s40
"
:alt=
"group.name
"
:size=
"32
"
:itemprop=
"microdata.imageItemprop"
/>
<identicon
v-else
:entity-id=
"group.id"
:entity-name=
"group.name"
size-class=
"s40"
/>
</a>
</div>
<div
class=
"group-text-container d-flex flex-fill align-items-center"
>
<div
class=
"group-text flex-grow-1 flex-shrink-1"
>
<div
class=
"d-flex align-items-center flex-wrap title namespace-title gl-mr-3"
>
...
...
spec/features/groups/show_spec.rb
View file @
08286581
...
...
@@ -208,13 +208,13 @@ RSpec.describe 'Group show page' do
expect
(
page
).
to
have_selector
(
'.content[itemscope][itemtype="https://schema.org/Organization"]'
)
page
.
within
(
'.group-home-panel'
)
do
expect
(
page
).
to
have_selector
(
'
img.avatar
[itemprop="logo"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="logo"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="name"]'
,
text:
group
.
name
)
expect
(
page
).
to
have_selector
(
'[itemprop="description"]'
,
text:
group
.
description
)
end
page
.
within
(
'[itemprop="owns"][itemtype="https://schema.org/SoftwareSourceCode"]'
)
do
expect
(
page
).
to
have_selector
(
'
img.avatar
[itemprop="image"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="image"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="name"]'
,
text:
project
.
name
)
expect
(
page
).
to
have_selector
(
'[itemprop="description"]'
,
text:
project
.
description
)
end
...
...
@@ -224,12 +224,12 @@ RSpec.describe 'Group show page' do
el
.
click
wait_for_all_requests
page
.
within
(
el
)
do
expect
(
page
).
to
have_selector
(
'
img.avatar
[itemprop="logo"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="logo"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="name"]'
,
text:
subgroup
.
name
)
expect
(
page
).
to
have_selector
(
'[itemprop="description"]'
,
text:
subgroup
.
description
)
page
.
within
(
'[itemprop="owns"][itemtype="https://schema.org/SoftwareSourceCode"]'
)
do
expect
(
page
).
to
have_selector
(
'
img.avatar
[itemprop="image"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="image"]'
)
expect
(
page
).
to
have_selector
(
'[itemprop="name"]'
,
text:
subproject
.
name
)
expect
(
page
).
to
have_selector
(
'[itemprop="description"]'
,
text:
subproject
.
description
)
end
...
...
spec/frontend/groups/components/group_item_spec.js
View file @
08286581
...
...
@@ -236,13 +236,13 @@ describe('GroupItemComponent', () => {
describe
(
'
schema.org props
'
,
()
=>
{
describe
(
'
when showSchemaMarkup is disabled on the group
'
,
()
=>
{
it
.
each
([
'
itemprop
'
,
'
itemtype
'
,
'
itemscope
'
],
'
it does not set %s
'
,
(
attr
)
=>
{
expect
(
wrapper
.
vm
.
$el
.
getAttribute
(
attr
)).
toBeNull
();
expect
(
wrapper
.
attributes
(
attr
)).
toBeUndefined
();
});
it
.
each
(
[
'
.js-group-avatar
'
,
'
.js-group-name
'
,
'
.js-group-description
'
],
'
it does not set `itemprop` on sub-nodes
'
,
(
selector
)
=>
{
expect
(
wrapper
.
vm
.
$el
.
querySelector
(
selector
).
getAttribute
(
'
itemprop
'
)).
toBeNull
();
expect
(
wrapper
.
find
(
selector
).
attributes
(
'
itemprop
'
)).
toBeUndefined
();
},
);
});
...
...
@@ -263,16 +263,16 @@ describe('GroupItemComponent', () => {
${
'
itemtype
'
}
|
${
'
https://schema.org/Organization
'
}
${
'
itemprop
'
}
|
${
'
subOrganization
'
}
`
(
'
it does set correct $attr
'
,
({
attr
,
value
}
=
{})
=>
{
expect
(
wrapper
.
vm
.
$el
.
getAttribute
(
attr
)).
toBe
(
value
);
expect
(
wrapper
.
attributes
(
attr
)).
toBe
(
value
);
});
it
.
each
`
selector | propValue
${
'
[data-testid="group-avatar"]
'
}
|
${
'
logo
'
}
${
'
img
'
}
|
${
'
logo
'
}
${
'
[data-testid="group-name"]
'
}
|
${
'
name
'
}
${
'
[data-testid="group-description"]
'
}
|
${
'
description
'
}
`
(
'
it does set correct $selector
'
,
({
selector
,
propValue
}
=
{})
=>
{
expect
(
wrapper
.
vm
.
$el
.
querySelector
(
selector
).
getAttribute
(
'
itemprop
'
)).
toBe
(
propValue
);
expect
(
wrapper
.
find
(
selector
).
attributes
(
'
itemprop
'
)).
toBe
(
propValue
);
});
});
});
...
...
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