From 3303b2d8b2ff2e87a1bc3f70f751325105475a5e Mon Sep 17 00:00:00 2001 From: Enrique Alcantara Date: Mon, 13 May 2024 09:29:59 +0200 Subject: [PATCH] Display unmapped agents in Agent authorization UI Display unmapped agents in the Agent Authorization UI. The user can choose to display unmapped agents by clicking the All Agents tab --- .../components/agent_mapping.vue | 94 ++++++++--- .../agent_mapping/components/agents_table.vue | 56 ++++++- .../get_agents_with_mapping_status_query.vue | 62 +++++++ .../components/get_available_agents_query.vue | 50 ------ .../workspaces/agent_mapping/constants.js | 2 + ...t_agents_with_mapping_status.query.graphql | 17 ++ .../remote_development/workspaces_spec.rb | 26 ++- .../components/agent_mapping_spec.js | 154 ++++++++++++++---- .../components/agents_table_spec.js | 55 ++++++- ..._agents_with_mapping_status_query_spec.js} | 69 ++++---- .../frontend/workspaces/mock_data/index.js | 41 +++++ locale/gitlab.pot | 17 +- 12 files changed, 487 insertions(+), 156 deletions(-) create mode 100644 ee/app/assets/javascripts/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue delete mode 100644 ee/app/assets/javascripts/workspaces/agent_mapping/components/get_available_agents_query.vue create mode 100644 ee/app/assets/javascripts/workspaces/agent_mapping/constants.js create mode 100644 ee/app/assets/javascripts/workspaces/agent_mapping/graphql/queries/get_agents_with_mapping_status.query.graphql rename ee/spec/frontend/workspaces/agent_mapping/components/{get_available_agents_query_spec.js => get_agents_with_mapping_status_query_spec.js} (54%) diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/components/agent_mapping.vue b/ee/app/assets/javascripts/workspaces/agent_mapping/components/agent_mapping.vue index 36ff1d9d4ffb90..c340fb97109174 100644 --- a/ee/app/assets/javascripts/workspaces/agent_mapping/components/agent_mapping.vue +++ b/ee/app/assets/javascripts/workspaces/agent_mapping/components/agent_mapping.vue @@ -1,12 +1,14 @@ diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/components/agents_table.vue b/ee/app/assets/javascripts/workspaces/agent_mapping/components/agents_table.vue index 67c1eee2069e9c..8adca77416cd20 100644 --- a/ee/app/assets/javascripts/workspaces/agent_mapping/components/agents_table.vue +++ b/ee/app/assets/javascripts/workspaces/agent_mapping/components/agents_table.vue @@ -1,6 +1,25 @@ diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue b/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue new file mode 100644 index 00000000000000..1303a52d3e0b68 --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue @@ -0,0 +1,62 @@ + diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_available_agents_query.vue b/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_available_agents_query.vue deleted file mode 100644 index 3816d6843bb16e..00000000000000 --- a/ee/app/assets/javascripts/workspaces/agent_mapping/components/get_available_agents_query.vue +++ /dev/null @@ -1,50 +0,0 @@ - diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/constants.js b/ee/app/assets/javascripts/workspaces/agent_mapping/constants.js new file mode 100644 index 00000000000000..ea3bbc3ffea667 --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/agent_mapping/constants.js @@ -0,0 +1,2 @@ +export const AGENT_MAPPING_STATUS_MAPPED = 'mapped'; +export const AGENT_MAPPING_STATUS_UNMAPPED = 'unmapped'; diff --git a/ee/app/assets/javascripts/workspaces/agent_mapping/graphql/queries/get_agents_with_mapping_status.query.graphql b/ee/app/assets/javascripts/workspaces/agent_mapping/graphql/queries/get_agents_with_mapping_status.query.graphql new file mode 100644 index 00000000000000..545ffcf8794d48 --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/agent_mapping/graphql/queries/get_agents_with_mapping_status.query.graphql @@ -0,0 +1,17 @@ +query getAgentsWithMappingStatus($namespace: ID!) { + group(fullPath: $namespace) { + id + remoteDevelopmentClusterAgents(filter: AVAILABLE) { + nodes { + id + name + } + } + clusterAgents { + nodes { + id + name + } + } + } +} diff --git a/ee/spec/features/groups/settings/remote_development/workspaces_spec.rb b/ee/spec/features/groups/settings/remote_development/workspaces_spec.rb index 0104628d78c8c1..be64b1852891fb 100644 --- a/ee/spec/features/groups/settings/remote_development/workspaces_spec.rb +++ b/ee/spec/features/groups/settings/remote_development/workspaces_spec.rb @@ -35,7 +35,7 @@ end end - context 'when there are available agents' do + context 'when there are mapped agents' do let_it_be(:cluster_agent_mapping) do create( :remote_development_namespace_cluster_agent_mapping, @@ -48,5 +48,29 @@ expect(page).to have_content agent.name end end + + context 'when there are mapped and unmapped agents' do + let_it_be(:agent_two) do + create(:ee_cluster_agent, :with_remote_development_agent_config, project: project, created_by_user: user) + end + + let_it_be(:cluster_agent_mapping) do + create( + :remote_development_namespace_cluster_agent_mapping, + user: user, agent: agent, + namespace: group + ) + end + + it 'displays all agents in the All agents tab with availability status' do + click_link 'All agents' + + expect(page).to have_content agent.name + expect(page).to have_content agent_two.name + + expect(page).to have_content 'Allowed' + expect(page).to have_content 'Blocked' + end + end end end diff --git a/ee/spec/frontend/workspaces/agent_mapping/components/agent_mapping_spec.js b/ee/spec/frontend/workspaces/agent_mapping/components/agent_mapping_spec.js index 2c3e88ef9550b0..f12e09f1bec20b 100644 --- a/ee/spec/frontend/workspaces/agent_mapping/components/agent_mapping_spec.js +++ b/ee/spec/frontend/workspaces/agent_mapping/components/agent_mapping_spec.js @@ -1,8 +1,13 @@ -import { GlAlert } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; +import { nextTick } from 'vue'; +import { GlAlert, GlTabs, GlTab, GlBadge } from '@gitlab/ui'; +import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; + +import { + AGENT_MAPPING_STATUS_MAPPED, + AGENT_MAPPING_STATUS_UNMAPPED, +} from 'ee/workspaces/agent_mapping/constants'; import AgentMapping from 'ee_component/workspaces/agent_mapping/components/agent_mapping.vue'; -import AgentsTable from 'ee_component/workspaces/agent_mapping/components/agents_table.vue'; -import GetAvailableAgentsQuery from 'ee_component/workspaces/agent_mapping/components/get_available_agents_query.vue'; +import GetAgentsWithMappingStatusQuery from 'ee_component/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue'; import { stubComponent } from 'helpers/stub_component'; describe('workspaces/agent_mapping/components/agent_mapping.vue', () => { @@ -10,22 +15,29 @@ describe('workspaces/agent_mapping/components/agent_mapping.vue', () => { const NAMESPACE = 'foo/bar'; const buildWrapper = ({ mappedAgentsQueryState = {} } = {}) => { - wrapper = shallowMount(AgentMapping, { + wrapper = shallowMountExtended(AgentMapping, { provide: { namespace: NAMESPACE, }, stubs: { - GetAvailableAgentsQuery: stubComponent(GetAvailableAgentsQuery, { + GetAgentsWithMappingStatusQuery: stubComponent(GetAgentsWithMappingStatusQuery, { render() { return this.$scopedSlots.default?.(mappedAgentsQueryState); }, }), + GlTabs, + GlTab, + GlBadge, }, }); }; - const findGetAvailableAgentsQuery = () => wrapper.findComponent(GetAvailableAgentsQuery); - const findAgentsTable = () => wrapper.findComponent(AgentsTable); + const findGetAgentsWithMappingStatusQuery = () => + wrapper.findComponent(GetAgentsWithMappingStatusQuery); + const findAllowedAgentsTable = () => wrapper.findByTestId('allowed-agents-table'); + const findAllAgentsTable = () => wrapper.findByTestId('all-agents-table'); const findErrorAlert = () => wrapper.findComponent(GlAlert); + const findAllowedAgentsTab = () => wrapper.findByTestId('allowed-agents-tab'); + const findAllAgentsTab = () => wrapper.findByTestId('all-agents-tab'); describe('default', () => { beforeEach(() => { @@ -38,61 +50,141 @@ describe('workspaces/agent_mapping/components/agent_mapping.vue', () => { }); describe('available agents table', () => { - it('renders GetAvailableAgentsQuery component and passes namespace path', () => { + it('renders GetAgentsWithMappingStatusQuery component and passes namespace path', () => { buildWrapper(); - expect(findGetAvailableAgentsQuery().props('namespace')).toBe(NAMESPACE); + expect(findGetAgentsWithMappingStatusQuery().props('namespace')).toBe(NAMESPACE); }); - describe('when GetAvailableAgentsQuery component emits results event', () => { + describe('when GetAgentsWithMappingStatusQuery component emits result event', () => { let agents; + let allowedAgents; - beforeEach(() => { + beforeEach(async () => { buildWrapper(); - agents = [{}]; - findGetAvailableAgentsQuery().vm.$emit('result', { agents }); + agents = [ + { + id: 'agent-1', + name: 'agent one', + mappingStatus: AGENT_MAPPING_STATUS_MAPPED, + }, + { + id: 'agent-2', + name: 'agent two', + mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED, + }, + { + id: 'agent-3', + name: 'agent three', + mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED, + }, + ]; + allowedAgents = agents.filter( + (agent) => agent.mappingStatus === AGENT_MAPPING_STATUS_MAPPED, + ); + findGetAgentsWithMappingStatusQuery().vm.$emit('result', { agents }); + await nextTick(); + }); + + it('displays the number of mapped agents in the Allowed Agents Tab', () => { + expect(findAllowedAgentsTab().findComponent(GlBadge).text()).toContain( + allowedAgents.length.toString(), + ); + }); + + it('displays the number of all unmapped agents in the All Agents Tab', () => { + expect(findAllAgentsTab().findComponent(GlBadge).text()).toContain( + agents.length.toString(), + ); + }); + + it('passes allowed agents to the allowed agents table', () => { + expect(findAllowedAgentsTable().props('agents')).toEqual(allowedAgents); }); - it('passes query result to the AgentsTable component', () => { - expect(findAgentsTable().props('agents')).toBe(agents); + it('passes all agents to the all agents table', () => { + expect(findAllAgentsTable().props('agents')).toEqual(agents); + }); + + it('sets displayMappingStatus on all agents table', () => { + expect(findAllAgentsTable().props('displayMappingStatus')).toBe(true); + }); + + describe('when there are unmapped agents but not mapped agents', () => { + beforeEach(async () => { + buildWrapper(); + + agents = [ + { + id: 'agent-2', + name: 'agent two', + mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED, + }, + { + id: 'agent-3', + name: 'agent three', + mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED, + }, + ]; + findGetAgentsWithMappingStatusQuery().vm.$emit('result', { agents }); + await nextTick(); + }); + + it('passes a "no allowed agents" empty message to the allowed agents table', () => { + expect(findAllowedAgentsTable().props('emptyStateMessage')).toBe( + 'This group has no available agents. Select the All agents tab and allow at least one agent.', + ); + }); + }); + + describe('when there are no agents', () => { + beforeEach(async () => { + buildWrapper(); + + agents = []; + findGetAgentsWithMappingStatusQuery().vm.$emit('result', { agents }); + await nextTick(); + }); + + it('passes a "not agents" empty message to the "allowed" and "all agents" tables', () => { + expect(findAllowedAgentsTable().props('emptyStateMessage')).toBe( + 'This group has no agents. Start by creating an agent.', + ); + expect(findAllAgentsTable().props('emptyStateMessage')).toBe( + 'This group has no agents. Start by creating an agent.', + ); + }); }); }); - describe('when GetAvailableAgentsQuery component emits error event', () => { + describe('when GetAgentsWithMappingStatusQuery component emits error event', () => { beforeEach(() => { buildWrapper(); - findGetAvailableAgentsQuery().vm.$emit('error'); + findGetAgentsWithMappingStatusQuery().vm.$emit('error'); }); it('displays error as a danger alert', () => { expect(findErrorAlert().text()).toContain('Could not load available agents'); }); - it('does not render AgentsTable component', () => { - expect(findAgentsTable().exists()).toBe(false); + it('does not render any table', () => { + expect(findAllowedAgentsTable().exists()).toBe(false); + expect(findAllAgentsTable().exists()).toBe(false); }); }); it('renders AgentsTable component', () => { buildWrapper(); - expect(findAgentsTable().exists()).toBe(true); - }); - - it('provides empty state message to the AgentsTable component', () => { - buildWrapper(); - - expect(findAgentsTable().props('emptyStateMessage')).toBe( - 'This group has no available agents. Select the All agents tab and allow at least one agent.', - ); + expect(findAllowedAgentsTable().exists()).toBe(true); }); - it('provides loading state from the GetAvailableAgentsQuery to the AgentsTable component', () => { + it('provides loading state from the GetAgentsWithMappingStatusQuery to the AgentsTable component', () => { buildWrapper({ mappedAgentsQueryState: { loading: true } }); - expect(findAgentsTable().props('isLoading')).toBe(true); + expect(findAllowedAgentsTable().props('isLoading')).toBe(true); }); }); }); diff --git a/ee/spec/frontend/workspaces/agent_mapping/components/agents_table_spec.js b/ee/spec/frontend/workspaces/agent_mapping/components/agents_table_spec.js index b4e1f0fd540140..637175089c75f3 100644 --- a/ee/spec/frontend/workspaces/agent_mapping/components/agents_table_spec.js +++ b/ee/spec/frontend/workspaces/agent_mapping/components/agents_table_spec.js @@ -1,12 +1,20 @@ import { GlTable, GlSkeletonLoader } from '@gitlab/ui'; -import { shallowMount, mount } from '@vue/test-utils'; +import { shallowMountExtended, mountExtended } from 'helpers/vue_test_utils_helper'; import AgentsTable from 'ee_component/workspaces/agent_mapping/components/agents_table.vue'; +import { + AGENT_MAPPING_STATUS_MAPPED, + AGENT_MAPPING_STATUS_UNMAPPED, +} from 'ee_component/workspaces/agent_mapping/constants'; describe('workspaces/agent_mapping/components/agents_table.vue', () => { let wrapper; const EMPTY_STATE_MESSAGE = 'No agents found'; + const agents = [ + { name: 'agent-1', mappingStatus: AGENT_MAPPING_STATUS_MAPPED }, + { name: 'agent-1', mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED }, + ]; - const buildWrapper = ({ propsData = {} } = {}, mountFn = shallowMount) => { + const buildWrapper = ({ propsData = {} } = {}, mountFn = shallowMountExtended) => { wrapper = mountFn(AgentsTable, { propsData: { agents: [], @@ -66,7 +74,7 @@ describe('workspaces/agent_mapping/components/agents_table.vue', () => { agents: [], }, }, - mount, + mountExtended, ); }); @@ -90,10 +98,10 @@ describe('workspaces/agent_mapping/components/agents_table.vue', () => { { propsData: { isLoading: false, - agents: [{ name: 'agent-1' }], + agents, }, }, - mount, + mountExtended, ); }); @@ -108,5 +116,42 @@ describe('workspaces/agent_mapping/components/agents_table.vue', () => { it('displays agents list', () => { expect(findAgentsTable().text()).toContain('agent-1'); }); + + describe('when displayMappingStatus is true', () => { + it('displays agent status using label', () => { + buildWrapper( + { + propsData: { + isLoading: false, + displayMappingStatus: true, + agents, + }, + }, + mountExtended, + ); + const labels = wrapper + .findAllByTestId('agent-mapping-status-label') + .wrappers.map((labelWrapper) => labelWrapper.text()); + + expect(labels).toEqual(['Allowed', 'Blocked']); + }); + }); + + describe('when displayAgentStatus is false', () => { + it('does not display agent status using label', () => { + buildWrapper( + { + propsData: { + isLoading: false, + mappingStatus: false, + agents, + }, + }, + mountExtended, + ); + + expect(wrapper.findAllByTestId('agent-mapping-status-label').length).toBe(0); + }); + }); }); }); diff --git a/ee/spec/frontend/workspaces/agent_mapping/components/get_available_agents_query_spec.js b/ee/spec/frontend/workspaces/agent_mapping/components/get_agents_with_mapping_status_query_spec.js similarity index 54% rename from ee/spec/frontend/workspaces/agent_mapping/components/get_available_agents_query_spec.js rename to ee/spec/frontend/workspaces/agent_mapping/components/get_agents_with_mapping_status_query_spec.js index c9325158efc761..d260c1cd620125 100644 --- a/ee/spec/frontend/workspaces/agent_mapping/components/get_available_agents_query_spec.js +++ b/ee/spec/frontend/workspaces/agent_mapping/components/get_agents_with_mapping_status_query_spec.js @@ -2,27 +2,31 @@ import { shallowMount } from '@vue/test-utils'; import VueApollo from 'vue-apollo'; import Vue from 'vue'; import { logError } from '~/lib/logger'; -import getRemoteDevelopmentClusterAgentsQuery from 'ee/workspaces/common/graphql/queries/get_remote_development_cluster_agents.query.graphql'; -import GetAvailableAgentsQuery from 'ee/workspaces/agent_mapping/components/get_available_agents_query.vue'; +import getAgentsWithMappingStatusQuery from 'ee/workspaces/agent_mapping/graphql/queries/get_agents_with_mapping_status.query.graphql'; +import GetAgentsWithAuthorizationStatusQuery from 'ee/workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue'; +import { + AGENT_MAPPING_STATUS_MAPPED, + AGENT_MAPPING_STATUS_UNMAPPED, +} from 'ee/workspaces/agent_mapping/constants'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; -import { GET_REMOTE_DEVELOPMENT_CLUSTER_AGENTS_QUERY_RESULT_TWO_AGENTS } from '../../mock_data'; +import { GET_AGENTS_WITH_MAPPING_STATUS_QUERY_RESULT } from '../../mock_data'; Vue.use(VueApollo); jest.mock('~/lib/logger'); -describe('workspaces/agent_mapping/components/get_available_agents_query.vue', () => { - let getRemoteDevelopmentClusterAgentsQueryHandler; +describe('workspaces/agent_mapping/components/get_agents_with_mapping_status_query.vue', () => { + let getAgentsWithMappingStatusQueryHandler; let wrapper; const NAMESPACE = 'gitlab-org/gitlab'; const buildWrapper = async ({ propsData = {}, scopedSlots = {} } = {}) => { const apolloProvider = createMockApollo([ - [getRemoteDevelopmentClusterAgentsQuery, getRemoteDevelopmentClusterAgentsQueryHandler], + [getAgentsWithMappingStatusQuery, getAgentsWithMappingStatusQueryHandler], ]); - wrapper = shallowMount(GetAvailableAgentsQuery, { + wrapper = shallowMount(GetAgentsWithAuthorizationStatusQuery, { apolloProvider, propsData: { ...propsData, @@ -36,22 +40,12 @@ describe('workspaces/agent_mapping/components/get_available_agents_query.vue', ( }; const buildWrapperWithNamespace = () => buildWrapper({ propsData: { namespace: NAMESPACE } }); - const setupRemoteDevelopmentClusterAgentsQueryHandler = (responses) => { - getRemoteDevelopmentClusterAgentsQueryHandler.mockResolvedValueOnce(responses); + const setupAgentsWithMappingStatusQueryHandler = (responses) => { + getAgentsWithMappingStatusQueryHandler.mockResolvedValueOnce(responses); }; - const transformRemoteDevelopmentClusterAgentGraphQLResultToClusterAgents = ( - clusterAgentsGraphQLResult, - ) => - clusterAgentsGraphQLResult.data.namespace.remoteDevelopmentClusterAgents.nodes.map( - ({ id, name }) => ({ - name, - id, - }), - ); - beforeEach(() => { - getRemoteDevelopmentClusterAgentsQueryHandler = jest.fn(); + getAgentsWithMappingStatusQueryHandler = jest.fn(); logError.mockReset(); }); @@ -72,19 +66,17 @@ describe('workspaces/agent_mapping/components/get_available_agents_query.vue', ( }); describe('when namespace path is provided', () => { - it('executes getRemoteDevelopmentClusterAgentsQuery query', async () => { + it('executes getAgentsWithAuthorizationStatusQuery query', async () => { await buildWrapperWithNamespace(); - expect(getRemoteDevelopmentClusterAgentsQueryHandler).toHaveBeenCalledWith({ + expect(getAgentsWithMappingStatusQueryHandler).toHaveBeenCalledWith({ namespace: NAMESPACE, }); }); describe('when the query is successful', () => { beforeEach(() => { - setupRemoteDevelopmentClusterAgentsQueryHandler( - GET_REMOTE_DEVELOPMENT_CLUSTER_AGENTS_QUERY_RESULT_TWO_AGENTS, - ); + setupAgentsWithMappingStatusQueryHandler(GET_AGENTS_WITH_MAPPING_STATUS_QUERY_RESULT); }); it('triggers result event with the agents list', async () => { @@ -93,9 +85,18 @@ describe('workspaces/agent_mapping/components/get_available_agents_query.vue', ( expect(wrapper.emitted('result')).toEqual([ [ { - agents: transformRemoteDevelopmentClusterAgentGraphQLResultToClusterAgents( - GET_REMOTE_DEVELOPMENT_CLUSTER_AGENTS_QUERY_RESULT_TWO_AGENTS, - ), + agents: [ + { + id: 'gid://gitlab/Clusters::Agent/1', + name: 'rootgroup-agent', + mappingStatus: AGENT_MAPPING_STATUS_MAPPED, + }, + { + id: 'gid://gitlab/Clusters::Agent/2', + name: 'rootgroup-agent-2', + mappingStatus: AGENT_MAPPING_STATUS_UNMAPPED, + }, + ], }, ], ]); @@ -106,8 +107,8 @@ describe('workspaces/agent_mapping/components/get_available_agents_query.vue', ( const error = new Error(); beforeEach(() => { - getRemoteDevelopmentClusterAgentsQueryHandler.mockReset(); - getRemoteDevelopmentClusterAgentsQueryHandler.mockRejectedValueOnce(error); + getAgentsWithMappingStatusQueryHandler.mockReset(); + getAgentsWithMappingStatusQueryHandler.mockRejectedValueOnce(error); }); it('logs the error', async () => { @@ -133,13 +134,11 @@ describe('workspaces/agent_mapping/components/get_available_agents_query.vue', ( }); describe('when namespace path is not provided', () => { - it('does not getRemoteDevelopmentClusterAgentsQuery query', async () => { - setupRemoteDevelopmentClusterAgentsQueryHandler( - GET_REMOTE_DEVELOPMENT_CLUSTER_AGENTS_QUERY_RESULT_TWO_AGENTS, - ); + it('does not getAgentsWithAuthorizationStatusQuery query', async () => { + setupAgentsWithMappingStatusQueryHandler(GET_AGENTS_WITH_MAPPING_STATUS_QUERY_RESULT); await buildWrapper(); - expect(getRemoteDevelopmentClusterAgentsQueryHandler).not.toHaveBeenCalled(); + expect(getAgentsWithMappingStatusQueryHandler).not.toHaveBeenCalled(); }); }); }); diff --git a/ee/spec/frontend/workspaces/mock_data/index.js b/ee/spec/frontend/workspaces/mock_data/index.js index c87e53c77794e9..4fb266153ca925 100644 --- a/ee/spec/frontend/workspaces/mock_data/index.js +++ b/ee/spec/frontend/workspaces/mock_data/index.js @@ -336,6 +336,47 @@ export const GET_REMOTE_DEVELOPMENT_CLUSTER_AGENTS_QUERY_RESULT_TWO_AGENTS = { }, }; +export const GET_AGENTS_WITH_MAPPING_STATUS_QUERY_RESULT = { + data: { + group: { + id: 'gid://gitlab/Group/81', + fullPath: 'gitlab-org/subgroup', + clusterAgents: { + nodes: [ + { + id: 'gid://gitlab/Clusters::Agent/1', + name: 'rootgroup-agent', + project: { + id: 'gid://gitlab/Project/101', + nameWithNamespace: 'GitLab Org / GitLab Agent One', + }, + }, + { + id: 'gid://gitlab/Clusters::Agent/2', + name: 'rootgroup-agent-2', + project: { + id: 'gid://gitlab/Project/102', + nameWithNamespace: 'GitLab Org / GitLab Agent Two', + }, + }, + ], + }, + remoteDevelopmentClusterAgents: { + nodes: [ + { + id: 'gid://gitlab/Clusters::Agent/1', + name: 'rootgroup-agent', + project: { + id: 'gid://gitlab/Project/101', + nameWithNamespace: 'GitLab Org / GitLab Agent One', + }, + }, + ], + }, + }, + }, +}; + export const WORKSPACE_CREATE_MUTATION_RESULT = { data: { workspaceCreate: { diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 95197407b22311..eb62aeb27afb3b 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -7616,6 +7616,9 @@ msgstr "" msgid "Autosave|Note" msgstr "" +msgid "Availability" +msgstr "" + msgid "Available" msgstr "" @@ -59065,6 +59068,12 @@ msgstr "" msgid "Workspaces|Agents connect workspaces to your Kubernetes cluster. To create a workspace with an allowed agent, group members must have at least the Developer role." msgstr "" +msgid "Workspaces|All agents" +msgstr "" + +msgid "Workspaces|Allowed Agents" +msgstr "" + msgid "Workspaces|Cancel" msgstr "" @@ -59167,7 +59176,10 @@ msgstr "" msgid "Workspaces|The branch, tag, or commit hash GitLab uses to create your workspace." msgstr "" -msgid "Workspaces|This group has no available agents. Select the All agents tab and allow at least one agent." +msgid "Workspaces|This group has no agents. Start by creating an agent." +msgstr "" + +msgid "Workspaces|This group has no available agents. Select the %{strongStart}All agents%{strongEnd} tab and allow at least one agent." msgstr "" msgid "Workspaces|To create a workspace, add a devfile to this project. A devfile is a configuration file for your workspace." @@ -60524,6 +60536,9 @@ msgstr "" msgid "added a Zoom call to this issue" msgstr "" +msgid "agents" +msgstr "" + msgid "ago" msgstr "" -- GitLab