Commit cfed288b authored by Vijay Hawoldar's avatar Vijay Hawoldar

Add a new badge for billable membership types

parent 2393b1eb
...@@ -183,7 +183,13 @@ export default { ...@@ -183,7 +183,13 @@ export default {
:size="$options.avatarSize" :size="$options.avatarSize"
:label="item.user.name" :label="item.user.name"
:sub-label="item.user.username" :sub-label="item.user.username"
/> >
<template v-if="item.user.membership_type === 'group_invite'" #meta>
<gl-badge size="sm" variant="muted">
{{ s__('Billing|Group invite') }}
</gl-badge>
</template>
</gl-avatar-labeled>
</gl-avatar-link> </gl-avatar-link>
</div> </div>
</template> </template>
......
export const tableItems = (state) => { export const tableItems = (state) => {
if (state.members.length) { if (state.members.length) {
return state.members.map( return state.members.map(
({ id, name, username, avatar_url, web_url, email, last_activity_on }) => { ({ id, name, username, avatar_url, web_url, email, last_activity_on, membership_type }) => {
const formattedUserName = `@${username}`; const formattedUserName = `@${username}`;
return { return {
...@@ -12,6 +12,7 @@ export const tableItems = (state) => { ...@@ -12,6 +12,7 @@ export const tableItems = (state) => {
avatar_url, avatar_url,
web_url, web_url,
last_activity_on, last_activity_on,
membership_type,
}, },
email, email,
}; };
......
---
title: Add a new badge for billable membership types
merge_request: 61366
author:
type: changed
...@@ -75,6 +75,7 @@ export const mockDataSeats = { ...@@ -75,6 +75,7 @@ export const mockDataSeats = {
web_url: 'path/to/administrator', web_url: 'path/to/administrator',
email: 'administrator@email.com', email: 'administrator@email.com',
last_activity_on: '2020-03-01', last_activity_on: '2020-03-01',
membership_type: 'group_member',
}, },
{ {
id: 3, id: 3,
...@@ -84,6 +85,7 @@ export const mockDataSeats = { ...@@ -84,6 +85,7 @@ export const mockDataSeats = {
web_url: 'path/to/agustin_walker', web_url: 'path/to/agustin_walker',
email: 'agustin_walker@email.com', email: 'agustin_walker@email.com',
last_activity_on: '2020-03-01', last_activity_on: '2020-03-01',
membership_type: 'group_member',
}, },
{ {
id: 4, id: 4,
...@@ -93,6 +95,7 @@ export const mockDataSeats = { ...@@ -93,6 +95,7 @@ export const mockDataSeats = {
web_url: 'path/to/joella_miller', web_url: 'path/to/joella_miller',
last_activity_on: null, last_activity_on: null,
email: null, email: null,
membership_type: 'group_invite',
}, },
], ],
headers: { headers: {
...@@ -123,6 +126,7 @@ export const mockTableItems = [ ...@@ -123,6 +126,7 @@ export const mockTableItems = [
username: '@root', username: '@root',
web_url: 'path/to/administrator', web_url: 'path/to/administrator',
last_activity_on: '2020-03-01', last_activity_on: '2020-03-01',
membership_type: 'group_member',
}, },
}, },
{ {
...@@ -134,6 +138,7 @@ export const mockTableItems = [ ...@@ -134,6 +138,7 @@ export const mockTableItems = [
username: '@lester.orn', username: '@lester.orn',
web_url: 'path/to/agustin_walker', web_url: 'path/to/agustin_walker',
last_activity_on: '2020-03-01', last_activity_on: '2020-03-01',
membership_type: 'group_member',
}, },
}, },
{ {
...@@ -145,6 +150,7 @@ export const mockTableItems = [ ...@@ -145,6 +150,7 @@ export const mockTableItems = [
username: '@era', username: '@era',
web_url: 'path/to/joella_miller', web_url: 'path/to/joella_miller',
last_activity_on: null, last_activity_on: null,
membership_type: 'group_invite',
}, },
}, },
]; ];
...@@ -42,7 +42,9 @@ Array [ ...@@ -42,7 +42,9 @@ Array [
"avatarLabeled": Object { "avatarLabeled": Object {
"size": "32", "size": "32",
"src": "path/to/img_joella_miller", "src": "path/to/img_joella_miller",
"text": "Joella Miller @era", "text": "Joella Miller
Group invite
@era",
}, },
"avatarLink": Object { "avatarLink": Object {
"alt": "Joella Miller", "alt": "Joella Miller",
......
...@@ -34,7 +34,7 @@ describe('Seat usage table getters', () => { ...@@ -34,7 +34,7 @@ describe('Seat usage table getters', () => {
}); });
describe('when data is available', () => { describe('when data is available', () => {
it('returns user details statep', () => { it('returns user details state', () => {
state.userDetails[0] = { state.userDetails[0] = {
isLoading: false, isLoading: false,
items: mockMemberDetails, items: mockMemberDetails,
......
...@@ -5085,6 +5085,9 @@ msgstr "" ...@@ -5085,6 +5085,9 @@ msgstr ""
msgid "Billing|Group" msgid "Billing|Group"
msgstr "" msgstr ""
msgid "Billing|Group invite"
msgstr ""
msgid "Billing|No users to display." msgid "Billing|No users to display."
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment