Move EKS creation forms to GlSprintf and GlLink
Problem to solve
There are a lot of sprintf
uses in the EKS forms to create links within translations. They should be moved to GlSprintf
and GlLink
Original thread
The following discussion from !42309 (merged) should be addressed:
-
@emilyring started a discussion: We're supposed to use GlSprintf instead of
sprintf
now.import { GlFormInput, GlFormCheckbox, GlLink, GlSprintf } from '@gitlab/ui';
and
components: { ClusterFormDropdown, GlFormInput, GlFormCheckbox, GlSprintf, // add me! GlLink, // add me! LoadingButton, },
And then in the form, replace
<p class="form-text text-muted" v-html="namespacePerEnvironmentHelpText"></p>
with
<p> <gl-sprintf :message="namespacePerEnvironmentHelpText"> <template #link="{ content }"> <gl-link :href="namespacePerEnvironmentHelpPath"> {{ content }} </gl-link> </template> </gl-sprintf> </p>
and
namespacePerEnvironmentHelpText
namespacePerEnvironmentHelpText() { return s__( 'ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared. %{linkStart}More information%{linkEnd}', ) },
I hope I didn't miss anything
😅
Edited by Hordur Freyr Yngvason