Fix wording when agent has never been connected on the dashboard
The wording says: Never connected Never
which is a result from a string concatenation of the agent status and the last connected field:
In this case, the wording must be "improved"
Implementation guide:
Update the kubernetes_agent_info
component to not show the Never
text when the agent last contact date is not provided:
diff --git a/app/assets/javascripts/environments/environment_details/components/kubernetes/kubernetes_agent_info.vue b/app/assets/javascripts/environments/environment_details/components/kubernetes/kubernetes_agent_info.vue
index a2c7daf0797e..0a321e5b7cfb 100644
--- a/app/assets/javascripts/environments/environment_details/components/kubernetes/kubernetes_agent_info.vue
+++ b/app/assets/javascripts/environments/environment_details/components/kubernetes/kubernetes_agent_info.vue
@@ -33,7 +33,6 @@ export default {
methods: {},
i18n: {
agentId: s__('ClusterAgents|Agent ID #%{agentId}'),
- neverConnectedText: s__('ClusterAgents|Never'),
},
AGENT_STATUSES,
};
@@ -56,7 +55,6 @@ export default {
<span data-testid="agent-last-used-date">
<time-ago-tooltip v-if="agentLastContact" :time="agentLastContact" />
- <span v-else>{{ $options.i18n.neverConnectedText }}</span>
</span>
</div>
</template>
diff --git a/spec/frontend/environments/environment_details/components/kubernetes/kubernetes_agent_info_spec.js b/spec/frontend/environments/environment_details/components/kubernetes/kubernetes_agent_info_spec.js
index d04b02f1bad0..1d80b415ddab 100644
--- a/spec/frontend/environments/environment_details/components/kubernetes/kubernetes_agent_info_spec.js
+++ b/spec/frontend/environments/environment_details/components/kubernetes/kubernetes_agent_info_spec.js
@@ -45,7 +45,7 @@ describe('~/environments/environment_details/components/kubernetes/kubernetes_ag
describe.each`
lastUsedAt | status | lastUsedText
- ${null} | ${'unused'} | ${KubernetesAgentInfo.i18n.neverConnectedText}
+ ${null} | ${'unused'} | ${''}
${connectedTimeNow} | ${'active'} | ${'just now'}
${connectedTimeInactive} | ${'inactive'} | ${'8 minutes ago'}
`('when agent connection status is "$status"', ({ lastUsedAt, status, lastUsedText }) => {
Edited by Anna Vovchenko