@@ -95,7 +111,7 @@ export default {
v-else-if="!loading && !agents.length"
data-testid="agent-availability-empty-state"
>
- {{ s__('Workspaces|No agents available') }}
+ {{ s__('Workspaces|No agents found.') }}
- {{
- item.name
- }}
+ {{ item.name }}
{{
diff --git a/ee/spec/frontend/workspaces/admin_settings/components/availability_toggle_spec.js b/ee/spec/frontend/workspaces/admin_settings/components/availability_toggle_spec.js
index fdfa414eac23a7bd04b7dba4c1bc10539caed7df..af9815d3988075e44146b11d12b9f184fa4729d9 100644
--- a/ee/spec/frontend/workspaces/admin_settings/components/availability_toggle_spec.js
+++ b/ee/spec/frontend/workspaces/admin_settings/components/availability_toggle_spec.js
@@ -9,6 +9,7 @@ import deleteClusterAgentMappingMutation from 'ee/workspaces/admin_settings/grap
import ClusterAgentAvailabilityToggle from 'ee/workspaces/admin_settings/components/availability_toggle.vue';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
+import { logError } from '~/lib/logger';
import {
DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT,
@@ -182,20 +183,14 @@ describe('workspaces/admin_settings/components/availability_toggle.vue', () => {
});
describe('on mutation error', () => {
- beforeEach(() => {
- setupApolloProvider(
- CREATE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR,
- DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR,
- );
- });
-
it.each`
- isMapped | expectedErrorMessage
- ${true} | ${'This agent is already blocked.'}
- ${false} | ${'This agent is already available.'}
+ isMapped | createResult | deleteResult | expectedErrorMessage
+ ${true} | ${CREATE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT} | ${DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR} | ${DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR.data.organizationDeleteClusterAgentMapping.errors[0]}
+ ${false} | ${CREATE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR} | ${DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT} | ${CREATE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR.data.organizationCreateClusterAgentMapping.errors[0]}
`(
- 'displays correct error message when mutation fails when agent is mapped: $isMapped',
- async ({ isMapped, expectedErrorMessage }) => {
+ 'handles error when mutation fails when an agent is mapped = $isMapped',
+ async ({ isMapped, createResult, deleteResult, expectedErrorMessage }) => {
+ setupApolloProvider(createResult, deleteResult);
buildWrapper({
isMapped,
});
@@ -204,7 +199,11 @@ describe('workspaces/admin_settings/components/availability_toggle.vue', () => {
await nextTick();
expect(findToggle().props('disabled')).toBe(false);
- expect(findErrorMessage().text()).toEqual(expectedErrorMessage);
+ expect(findErrorMessage().text()).toEqual('Unable to complete request. Please try again.');
+ expect(logError).toHaveBeenCalledWith(
+ 'Error updating Workspaces agent availability',
+ expectedErrorMessage,
+ );
},
);
});
diff --git a/ee/spec/frontend/workspaces/admin_settings/pages/app_spec.js b/ee/spec/frontend/workspaces/admin_settings/pages/app_spec.js
index 3d970cf9e9a097b20f7bf078206417aef8e482fe..7441798077bafdd7d72952ece695cfec5bb6398f 100644
--- a/ee/spec/frontend/workspaces/admin_settings/pages/app_spec.js
+++ b/ee/spec/frontend/workspaces/admin_settings/pages/app_spec.js
@@ -1,12 +1,5 @@
import { nextTick } from 'vue';
-import {
- GlTableLite,
- GlBadge,
- GlLink,
- GlAlert,
- GlKeysetPagination,
- GlSkeletonLoader,
-} from '@gitlab/ui';
+import { GlTableLite, GlBadge, GlAlert, GlKeysetPagination, GlSkeletonLoader } from '@gitlab/ui';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import WorkspacesAgentAvailabilityApp from 'ee_component/workspaces/admin_settings/pages/app.vue';
import AvailabilityPopover from 'ee_component/workspaces/admin_settings/components/availability_popover.vue';
@@ -148,7 +141,7 @@ describe('workspaces/admin_settings/pages/app.vue', () => {
});
it('renders agent name with link to the agent page', () => {
- const nameElement = wrapper.findComponent(GlLink);
+ const nameElement = wrapper.findByTestId('agent-link');
expect(nameElement.exists()).toBe(true);
expect(nameElement.attributes('href')).toBe(mockResult[0].url);
diff --git a/ee/spec/frontend/workspaces/mock_data/index.js b/ee/spec/frontend/workspaces/mock_data/index.js
index 038bb58da2106841080e18ed5c1f183bbfd94b0d..8857d14702f13fd0169733ad8469c74c3bee86e1 100644
--- a/ee/spec/frontend/workspaces/mock_data/index.js
+++ b/ee/spec/frontend/workspaces/mock_data/index.js
@@ -935,7 +935,7 @@ export const DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT = {
export const DELETE_ORG_CLUSTER_AGENT_MAPPING_MUTATION_RESULT_WITH_ERROR = {
data: {
organizationDeleteClusterAgentMapping: {
- errors: ['Cluster agent mapping already exists'],
+ errors: ['Organization cluster agent mapping not found'],
},
},
};
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 3a5f9cd0a7f2793e147c461d125c76f9e8898333..2a95acaaf22d252747b12c50138cb2c9cb07aeae 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -70763,6 +70763,9 @@ msgstr ""
msgid "Workspaces|Available"
msgstr ""
+msgid "Workspaces|Available agents for workspaces"
+msgstr ""
+
msgid "Workspaces|Block agent"
msgstr ""
@@ -70772,10 +70775,10 @@ msgstr ""
msgid "Workspaces|Blocked"
msgstr ""
-msgid "Workspaces|Blocking an agent doesn't delete it. Agents can only be deleted in the project where they were created."
+msgid "Workspaces|Blocked agents are not deleted and existing workspaces continue running. You can delete agents in their source project."
msgstr ""
-msgid "Workspaces|Blocking an agent doesn't delete it. Agents can only be deleted in the project where they were created. In addition, existing workspaces using a blocked agent will continue to run."
+msgid "Workspaces|Blocking an agent doesn't delete it. Agents can only be deleted in the project where they were created."
msgstr ""
msgid "Workspaces|Cancel"
@@ -70784,7 +70787,7 @@ msgstr ""
msgid "Workspaces|Cluster agent"
msgstr ""
-msgid "Workspaces|Configure which Kubernetes agents are available for new workspaces. These settings do not affect existing workspaces."
+msgid "Workspaces|Configure which Kubernetes agents are available for new workspaces. %{learnMore}"
msgstr ""
msgid "Workspaces|Connected"
@@ -70868,6 +70871,9 @@ msgstr ""
msgid "Workspaces|Instant development environments"
msgstr ""
+msgid "Workspaces|Learn more about agents."
+msgstr ""
+
msgid "Workspaces|Learn more."
msgstr ""
@@ -70880,10 +70886,10 @@ msgstr ""
msgid "Workspaces|No active workspaces"
msgstr ""
-msgid "Workspaces|No agents available"
+msgid "Workspaces|No agents available to create workspaces. Please consult %{linkStart}Workspaces documentation%{linkEnd} for troubleshooting."
msgstr ""
-msgid "Workspaces|No agents available to create workspaces. Please consult %{linkStart}Workspaces documentation%{linkEnd} for troubleshooting."
+msgid "Workspaces|No agents found."
msgstr ""
msgid "Workspaces|No terminated workspaces"
@@ -70949,9 +70955,6 @@ msgstr ""
msgid "Workspaces|This agent is already allowed."
msgstr ""
-msgid "Workspaces|This agent is already available."
-msgstr ""
-
msgid "Workspaces|This agent is already blocked."
msgstr ""
@@ -70964,6 +70967,9 @@ msgstr ""
msgid "Workspaces|To create a workspace, add a devfile to this project. A devfile is a configuration file for your workspace."
msgstr ""
+msgid "Workspaces|Unable to complete request. Please try again."
+msgstr ""
+
msgid "Workspaces|Unable to complete this action"
msgstr ""
@@ -70988,9 +70994,6 @@ msgstr ""
msgid "Workspaces|Workspaces"
msgstr ""
-msgid "Workspaces|Workspaces Agent Availability"
-msgstr ""
-
msgid "Workspaces|Workspaces Settings"
msgstr ""