Skip to content
代码片段 群组 项目
未验证 提交 ea0341fe 编辑于 作者: Paul Slaughter's avatar Paul Slaughter 提交者: GitLab
浏览文件

Merge branch...

Merge branch '443619-refactor-create-fragment-to-encapsulate-common-part-of-workspaces-query' into 'master' 

[Refactor] Create Fragment to encapsulate Workspaces fields

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



Merged-by: default avatarPaul Slaughter <pslaughter@gitlab.com>
Approved-by: default avatarPaul Slaughter <pslaughter@gitlab.com>
Co-authored-by: default avatarChad Woolley <cwoolley@gitlab.com>
No related branches found
No related tags found
加载中
fragment WorkspaceItem on Workspace {
id
name
namespace
projectId
desiredState
actualState
url
devfileRef
devfilePath
devfileWebUrl
createdAt
}
#import "../fragments/workspace_item.fragment.graphql"
mutation workspaceCreate($input: WorkspaceCreateInput!) {
workspaceCreate(input: $input) {
workspace {
id
name
namespace
projectId
desiredState
actualState
url
devfileRef
devfilePath
devfileWebUrl
createdAt
...WorkspaceItem
}
errors
}
......
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
#import "../fragments/workspace_item.fragment.graphql"
query agentWorkspaces(
$first: Int
......@@ -13,17 +14,7 @@ query agentWorkspaces(
id
workspaces(first: $first, before: $before, after: $after) {
nodes {
id
name
namespace
projectId
desiredState
actualState
url
devfileRef
devfilePath
devfileWebUrl
createdAt
...WorkspaceItem
}
pageInfo {
...PageInfo
......
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
#import "../fragments/workspace_item.fragment.graphql"
query userWorkspacesList(
$first: Int
......@@ -17,17 +18,7 @@ query userWorkspacesList(
projectIds: $projectIds
) {
nodes {
id
name
namespace
projectId
desiredState
actualState
url
devfileRef
devfilePath
devfileWebUrl
createdAt
...WorkspaceItem
}
pageInfo {
...PageInfo
......
......@@ -3,6 +3,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import { WORKSPACE_DESIRED_STATES, WORKSPACE_STATES } from 'ee/remote_development/constants';
export const WORKSPACE = {
__typename: 'Workspace',
id: 1,
name: 'Workspace 1',
namespace: 'Namespace',
......@@ -32,6 +33,7 @@ export const USER_WORKSPACES_LIST_QUERY_RESULT = {
workspaces: {
nodes: [
{
__typename: 'Workspace',
id: 'gid://gitlab/RemoteDevelopment::Workspace/2',
name: 'workspace-1-1-idmi02',
namespace: 'gl-rd-ns-1-1-idmi02',
......@@ -45,6 +47,7 @@ export const USER_WORKSPACES_LIST_QUERY_RESULT = {
createdAt: '2023-04-29T18:24:34Z',
},
{
__typename: 'Workspace',
id: 'gid://gitlab/RemoteDevelopment::Workspace/1',
name: 'workspace-1-1-rfu27q',
namespace: 'gl-rd-ns-1-1-rfu27q',
......@@ -95,6 +98,7 @@ export const AGENT_WORKSPACES_LIST_QUERY_RESULT = {
workspaces: {
nodes: [
{
__typename: 'Workspace',
id: 'gid://gitlab/RemoteDevelopment::Workspace/2',
name: 'workspace-1-1-idmi02',
namespace: 'gl-rd-ns-1-1-idmi02',
......@@ -109,6 +113,7 @@ export const AGENT_WORKSPACES_LIST_QUERY_RESULT = {
createdAt: '2023-04-29T18:24:34Z',
},
{
__typename: 'Workspace',
id: 'gid://gitlab/RemoteDevelopment::Workspace/1',
name: 'workspace-1-1-rfu27q',
namespace: 'gl-rd-ns-1-1-rfu27q',
......@@ -307,6 +312,7 @@ export const WORKSPACE_UPDATE_MUTATION_RESULT = {
workspaceUpdate: {
errors: [],
workspace: {
__typename: 'Workspace',
id: WORKSPACE.id,
actualState: WORKSPACE_STATES.running,
desiredState: WORKSPACE_DESIRED_STATES.restartRequested,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册