Skip to content
Snippets Groups Projects
Unverified Commit 59108d3b authored by Igor Drozdov's avatar Igor Drozdov Committed by GitLab
Browse files

Merge branch 'mokhax/489771/simple-fields' into 'master'

Add lastActivityOn field to GraphQL Member type

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168714



Merged-by: default avatarIgor Drozdov <idrozdov@gitlab.com>
Approved-by: default avatarSam Word <sword@gitlab.com>
Approved-by: default avatarIgor Drozdov <idrozdov@gitlab.com>
Co-authored-by: default avatarmo khan <mo@mokhan.ca>
parents 25f8f8c5 52fa24d2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,6 +22,9 @@ module MemberInterface
field :expires_at, Types::TimeType, null: true,
description: 'Date and time the membership expires.'
 
field :last_activity_on, Types::TimeType,
description: 'Date of last activity in the namespace (group or project).'
field :user, Types::UserType, null: true,
description: 'User that is associated with the member object.'
 
Loading
Loading
Loading
Loading
@@ -25155,6 +25155,7 @@ Represents a Group Membership.
| <a id="groupmemberexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="groupmembergroup"></a>`group` | [`Group`](#group) | Group that a user is a member of. |
| <a id="groupmemberid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="groupmemberlastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="groupmembernotificationemail"></a>`notificationEmail` | [`String`](#string) | Group notification email for user. Only available for admins. |
| <a id="groupmemberupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="groupmemberuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
Loading
Loading
@@ -29459,6 +29460,7 @@ Represents a Pending Group Membership.
| <a id="pendinggroupmemberexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="pendinggroupmemberid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="pendinggroupmemberinvited"></a>`invited` | [`Boolean`](#boolean) | Whether the pending member has been invited. |
| <a id="pendinggroupmemberlastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="pendinggroupmembername"></a>`name` | [`String`](#string) | Name of the pending member. |
| <a id="pendinggroupmemberupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="pendinggroupmemberuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
Loading
Loading
@@ -29496,6 +29498,7 @@ Represents a Pending Project Membership.
| <a id="pendingprojectmemberexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="pendingprojectmemberid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="pendingprojectmemberinvited"></a>`invited` | [`Boolean`](#boolean) | Whether the pending member has been invited. |
| <a id="pendingprojectmemberlastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="pendingprojectmembername"></a>`name` | [`String`](#string) | Name of the pending member. |
| <a id="pendingprojectmemberupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="pendingprojectmemberuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
Loading
Loading
@@ -32226,6 +32229,7 @@ Represents a Project Membership.
| <a id="projectmembercreatedby"></a>`createdBy` | [`UserCore`](#usercore) | User that authorized membership. |
| <a id="projectmemberexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="projectmemberid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="projectmemberlastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="projectmemberproject"></a>`project` | [`Project`](#project) | Project that User is a member of. |
| <a id="projectmemberupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="projectmemberuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
Loading
Loading
@@ -41449,6 +41453,7 @@ Implementations:
| <a id="memberinterfacecreatedby"></a>`createdBy` | [`UserCore`](#usercore) | User that authorized membership. |
| <a id="memberinterfaceexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="memberinterfaceid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="memberinterfacelastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="memberinterfaceupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="memberinterfaceuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
 
Loading
Loading
@@ -41563,6 +41568,7 @@ Implementations:
| <a id="pendingmemberinterfaceexpiresat"></a>`expiresAt` | [`Time`](#time) | Date and time the membership expires. |
| <a id="pendingmemberinterfaceid"></a>`id` | [`ID!`](#id) | ID of the member. |
| <a id="pendingmemberinterfaceinvited"></a>`invited` | [`Boolean`](#boolean) | Whether the pending member has been invited. |
| <a id="pendingmemberinterfacelastactivityon"></a>`lastActivityOn` | [`Time`](#time) | Date of last activity in the namespace (group or project). |
| <a id="pendingmemberinterfacename"></a>`name` | [`String`](#string) | Name of the pending member. |
| <a id="pendingmemberinterfaceupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="pendingmemberinterfaceuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
Loading
Loading
@@ -364,6 +364,7 @@ def query_epics(number)
invited
avatarUrl
approved
lastActivityOn
}
}
QUERY
Loading
Loading
@@ -405,6 +406,7 @@ def query_epics(number)
expect(pending_members.first[:avatarUrl]).to eq(GravatarService.new.execute(pending_member.user.email))
expect(pending_members.first[:approved]).to eq(pending_member.active?)
expect(pending_members.first[:invited]).to eq(pending_member.invite?)
expect(pending_members.first[:last_activity_on]).to eq(pending_member.last_activity_on)
end
 
it 'returns pending project members' do
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@
access_level
created_by
created_at
last_activity_on
updated_at
expires_at
user
Loading
Loading
@@ -18,6 +19,8 @@
expect(described_class).to have_graphql_fields(*expected_fields)
end
 
it { expect(described_class.fields['lastActivityOn']).to have_graphql_type(Types::TimeType) }
describe '.resolve_type' do
subject { described_class.resolve_type(object, {}) }
 
Loading
Loading
Loading
Loading
@@ -13,6 +13,7 @@
integerValue
stringValue
}
lastActivityOn
group {
id
}
Loading
Loading
@@ -30,4 +31,6 @@
 
it_behaves_like 'a working graphql query'
it_behaves_like 'a working membership object query'
it { expect(graphql_data.dig('user', 'groupMemberships', 'nodes', 0, 'lastActivityOn')).to be_present }
end
Loading
Loading
@@ -13,6 +13,7 @@
integerValue
stringValue
}
lastActivityOn
project {
id
}
Loading
Loading
@@ -30,4 +31,6 @@
 
it_behaves_like 'a working graphql query'
it_behaves_like 'a working membership object query'
it { expect(graphql_data.dig('user', 'projectMemberships', 'nodes', 0, 'lastActivityOn')).to be_present }
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment