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
5601765b
Commit
5601765b
authored
Nov 10, 2021
by
Ammar Alakkad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide details for invited members in seats usage
Changelog: other EE: true
parent
a61c457d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
ee/app/assets/javascripts/seat_usage/components/subscription_seats.vue
.../javascripts/seat_usage/components/subscription_seats.vue
+5
-1
ee/spec/frontend/seat_usage/components/subscription_seats_spec.js
...frontend/seat_usage/components/subscription_seats_spec.js
+27
-0
ee/spec/frontend/seat_usage/mock_data.js
ee/spec/frontend/seat_usage/mock_data.js
+2
-2
No files found.
ee/app/assets/javascripts/seat_usage/components/subscription_seats.vue
View file @
5601765b
...
...
@@ -112,6 +112,9 @@ export default {
isProjectInvite
(
item
)
{
return
item
.
user
.
membership_type
===
'
project_invite
'
;
},
shouldShowDetails
(
item
)
{
return
!
this
.
isGroupInvite
(
item
)
&&
!
this
.
isProjectInvite
(
item
);
},
},
i18n
:
{
emailNotVisibleTooltipText
:
s__
(
...
...
@@ -172,8 +175,9 @@ export default {
:empty-text=
"emptyText"
>
<template
#cell(user)=
"
{ item, toggleDetails, detailsShowing }">
<div
class=
"gl-display-flex"
>
<div
class=
"gl-display-flex"
:data-testid=
"`seat-cell-$
{item.user.id}`"
>
<gl-button
v-if=
"shouldShowDetails(item)"
variant=
"link"
class=
"gl-mr-2"
:aria-label=
"s__('Billing|Toggle seat details')"
...
...
ee/spec/frontend/seat_usage/components/subscription_seats_spec.js
View file @
5601765b
...
...
@@ -212,6 +212,33 @@ describe('Subscription Seats', () => {
},
);
});
describe
(
'
members details
'
,
()
=>
{
it
.
each
`
membershipType | shouldShowDetails
${
'
project_invite
'
}
|
${
false
}
${
'
group_invite
'
}
|
${
false
}
${
'
project_member
'
}
|
${
true
}
${
'
group_member
'
}
|
${
true
}
`
(
'
when membershipType is $membershipType, shouldShowDetails should be $shouldShowDetails
'
,
({
membershipType
,
shouldShowDetails
})
=>
{
const
seatCells
=
findTable
().
findAll
(
'
[data-testid*="seat-cell-"]
'
);
seatCells
.
wrappers
.
forEach
((
seatCellWrapper
)
=>
{
const
currentMember
=
mockTableItems
.
find
(
(
item
)
=>
seatCellWrapper
.
attributes
(
'
data-testid
'
)
===
`seat-cell-
${
item
.
user
.
id
}
`
,
);
if
(
membershipType
===
currentMember
.
user
.
membership_type
)
{
expect
(
seatCellWrapper
.
find
(
'
[data-testid="toggle-seat-usage-details"]
'
).
exists
(),
).
toBe
(
shouldShowDetails
);
}
});
},
);
});
});
describe
(
'
is loading
'
,
()
=>
{
...
...
ee/spec/frontend/seat_usage/mock_data.js
View file @
5601765b
...
...
@@ -25,7 +25,7 @@ export const mockDataSeats = {
web_url
:
'
path/to/agustin_walker
'
,
email
:
'
agustin_walker@email.com
'
,
last_activity_on
:
'
2020-03-01
'
,
membership_type
:
'
group
_member
'
,
membership_type
:
'
project
_member
'
,
removable
:
true
,
},
{
...
...
@@ -92,7 +92,7 @@ export const mockTableItems = [
username
:
'
@lester.orn
'
,
web_url
:
'
path/to/agustin_walker
'
,
last_activity_on
:
'
2020-03-01
'
,
membership_type
:
'
group
_member
'
,
membership_type
:
'
project
_member
'
,
removable
:
true
,
},
},
...
...
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