Commit c26b14ae authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '355803-agent-token-naming' into 'master'

Adjust wording in the token instructions screen

See merge request gitlab-org/gitlab!83685
parents 9e938b81 2cd2ac48
......@@ -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,14 @@ export default {
</gl-form-input-group>
</p>
<p>
{{ $options.i18n.tokenSubtitle }}
</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,20 @@ 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.`,
),
tokenSubtitle: s__('ClusterAgents|The agent uses the token to connect with GitLab.'),
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 +112,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 +121,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 ""
......@@ -7885,6 +7891,9 @@ msgstr ""
msgid "ClusterAgents|Configuration"
msgstr ""
msgid "ClusterAgents|Connect a Kubernetes cluster"
msgstr ""
msgid "ClusterAgents|Connect a cluster"
msgstr ""
......@@ -7897,9 +7906,6 @@ msgstr ""
msgid "ClusterAgents|Connect a cluster (deprecated)"
msgstr ""
msgid "ClusterAgents|Connect a cluster through an agent"
msgstr ""
msgid "ClusterAgents|Connect existing cluster"
msgstr ""
......@@ -7969,7 +7975,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 +8038,6 @@ msgstr ""
msgid "ClusterAgents|Registering agent"
msgstr ""
msgid "ClusterAgents|Registration token"
msgstr ""
msgid "ClusterAgents|Requires a Maintainer or greater role to delete agents"
msgstr ""
......@@ -8065,13 +8068,10 @@ msgstr ""
msgid "ClusterAgents|The agent has not been connected in a long time. There might be a connectivity issue. Last contact was %{timeAgo}."
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."
msgid "ClusterAgents|The agent uses the token to connect with GitLab."
msgstr ""
msgid "ClusterAgents|The registration token will be used to connect the agent on your cluster to GitLab. %{linkStart}What are registration tokens?%{linkEnd}"
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|There's no activity from the past day"
......@@ -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