Commit f72a0a0a authored by anna_vovchenko's avatar anna_vovchenko Committed by Anna Vovchenko

Updated wording for the agent token instructions

As we want to make the instructions more clear
and unify agent access token naming,
we are updating the working of the instructions screen.

Changelog: changed
parent 173060d1
......@@ -8,9 +8,6 @@ import { I18N_AGENT_TOKEN } from '../constants';
export default {
i18n: I18N_AGENT_TOKEN,
basicInstallPath: helpPagePath('user/clusters/agent/install/index', {
anchor: 'install-the-agent-into-the-cluster',
}),
advancedInstallPath: helpPagePath('user/clusters/agent/install/index', {
anchor: 'advanced-installation',
}),
......@@ -43,27 +40,7 @@ export default {
<template>
<div>
<p>
<strong>{{ $options.i18n.tokenTitle }}</strong>
</p>
<p>
<gl-sprintf :message="$options.i18n.tokenBody">
<template #link="{ content }">
<gl-link :href="$options.basicInstallPath" target="_blank"> {{ content }}</gl-link>
</template>
</gl-sprintf>
</p>
<p>
<gl-alert
:title="$options.i18n.tokenSingleUseWarningTitle"
variant="warning"
:dismissible="false"
>
{{ $options.i18n.tokenSingleUseWarningBody }}
</gl-alert>
</p>
<p class="gl-mb-3">{{ $options.i18n.tokenLabel }}</p>
<p>
<gl-form-input-group readonly :value="agentToken" :select-on-click="true">
......@@ -77,6 +54,10 @@ export default {
</gl-form-input-group>
</p>
<gl-alert :dismissible="false" variant="warning" class="gl-mb-5">
{{ $options.i18n.tokenSingleUseWarningTitle }}
</gl-alert>
<p>
<strong>{{ $options.i18n.basicInstallTitle }}</strong>
</p>
......
......@@ -90,26 +90,19 @@ export const I18N_AGENT_TABLE = {
export const I18N_AGENT_TOKEN = {
copyToken: s__('ClusterAgents|Copy token'),
copyCommand: s__('ClusterAgents|Copy command'),
tokenTitle: s__('ClusterAgents|Registration token'),
tokenBody: s__(
`ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd}`,
),
tokenLabel: s__('ClusterAgents|Agent access token:'),
tokenSingleUseWarningTitle: s__(
'ClusterAgents|You cannot see this token again after you close this window.',
),
tokenSingleUseWarningBody: s__(
`ClusterAgents|The recommended installation method includes the token. If you want to follow the advanced installation method provided in the docs, make sure you save the token value before you close this window.`,
),
basicInstallTitle: s__('ClusterAgents|Recommended installation method'),
basicInstallBody: __(
`Open a CLI and connect to the cluster you want to install the agent in. Use this installation method to minimize any manual steps. The token is already included in the command.`,
basicInstallBody: s__(
'ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included.',
),
advancedInstallTitle: s__('ClusterAgents|Advanced installation methods'),
advancedInstallBody: s__(
'ClusterAgents|For the advanced installation method %{linkStart}see the documentation%{linkEnd}.',
'ClusterAgents|%{linkStart}View the documentation%{linkEnd} for advanced installation. Ensure you have your access token available.',
),
};
......@@ -118,7 +111,7 @@ export const I18N_AGENT_MODAL = {
close: __('Close'),
cancel: __('Cancel'),
modalTitle: s__('ClusterAgents|Connect a cluster through an agent'),
modalTitle: s__('ClusterAgents|Connect a Kubernetes cluster'),
modalBody: s__(
'ClusterAgents|Add an agent configuration file to %{linkStart}this repository%{linkEnd} and select it, or create a new one to register with GitLab:',
),
......@@ -127,11 +120,6 @@ export const I18N_AGENT_MODAL = {
),
altText: s__('ClusterAgents|GitLab Agent for Kubernetes'),
learnMoreLink: s__('ClusterAgents|How do I register an agent?'),
copyToken: s__('ClusterAgents|Copy token'),
tokenTitle: s__('ClusterAgents|Registration token'),
tokenBody: s__(
`ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd}`,
),
registrationErrorTitle: s__('ClusterAgents|Failed to register an agent'),
unknownError: s__('ClusterAgents|An unknown error occurred. Please try again.'),
};
......
......@@ -7807,6 +7807,9 @@ msgstr ""
msgid "Cluster type must be specified for Stages::ClusterEndpointInserter"
msgstr ""
msgid "ClusterAgents|%{linkStart}View the documentation%{linkEnd} for advanced installation. Ensure you have your access token available."
msgstr ""
msgid "ClusterAgents|%{name} successfully deleted"
msgstr ""
......@@ -7846,6 +7849,9 @@ msgstr ""
msgid "ClusterAgents|Agent %{strongStart}disconnected%{strongEnd}"
msgstr ""
msgid "ClusterAgents|Agent access token:"
msgstr ""
msgid "ClusterAgents|Agent might not be connected to GitLab"
msgstr ""
......@@ -7900,6 +7906,9 @@ msgstr ""
msgid "ClusterAgents|Connect a cluster through an agent"
msgstr ""
msgid "ClusterAgents|Connect a Kubernetes cluster"
msgstr ""
msgid "ClusterAgents|Connect existing cluster"
msgstr ""
......@@ -7969,7 +7978,7 @@ msgstr ""
msgid "ClusterAgents|Failed to register an agent"
msgstr ""
msgid "ClusterAgents|For the advanced installation method %{linkStart}see the documentation%{linkEnd}."
msgid "ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included."
msgstr ""
msgid "ClusterAgents|GitLab Agent"
......@@ -8032,9 +8041,6 @@ msgstr ""
msgid "ClusterAgents|Registering agent"
msgstr ""
msgid "ClusterAgents|Registration token"
msgstr ""
msgid "ClusterAgents|Requires a Maintainer or greater role to delete agents"
msgstr ""
......@@ -8068,12 +8074,6 @@ msgstr ""
msgid "ClusterAgents|The agent version do not match each other across your cluster's pods. This can happen when a new agent version was just deployed and Kubernetes is shutting down the old pods."
msgstr ""
msgid "ClusterAgents|The recommended installation method includes the token. If you want to follow the advanced installation method provided in the docs, make sure you save the token value before you close this window."
msgstr ""
msgid "ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd}"
msgstr ""
msgid "ClusterAgents|There's no activity from the past day"
msgid_plural "ClusterAgents|There's no activity from the past %d days"
msgstr[0] ""
......@@ -26150,9 +26150,6 @@ msgstr ""
msgid "Open Selection"
msgstr ""
msgid "Open a CLI and connect to the cluster you want to install the agent in. Use this installation method to minimize any manual steps. The token is already included in the command."
msgstr ""
msgid "Open errors"
msgstr ""
......
......@@ -53,7 +53,7 @@ describe('InstallAgentModal', () => {
});
it('shows agent token as an input value', () => {
expect(findInput().props('value')).toBe('agent-token');
expect(findInput().props('value')).toBe(agentToken);
});
it('renders a copy button', () => {
......@@ -65,12 +65,12 @@ describe('InstallAgentModal', () => {
});
it('shows warning alert', () => {
expect(findAlert().props('title')).toBe(I18N_AGENT_TOKEN.tokenSingleUseWarningTitle);
expect(findAlert().text()).toBe(I18N_AGENT_TOKEN.tokenSingleUseWarningTitle);
});
it('shows code block with agent installation command', () => {
expect(findCodeBlock().props('code')).toContain('--agent-token=agent-token');
expect(findCodeBlock().props('code')).toContain('--kas-address=kas.example.com');
expect(findCodeBlock().props('code')).toContain(`--agent-token=${agentToken}`);
expect(findCodeBlock().props('code')).toContain(`--kas-address=${kasAddress}`);
});
});
});
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