summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue')
-rw-r--r--app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue74
1 files changed, 36 insertions, 38 deletions
diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue
index 45c886978f1..004c2e26c4e 100644
--- a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue
+++ b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue
@@ -1,9 +1,7 @@
<script>
-/* eslint-disable vue/no-v-html */
import { GlButton, GlFormGroup, GlFormInput, GlIcon, GlLink, GlSprintf, GlAlert } from '@gitlab/ui';
-import { escape } from 'lodash';
import { mapState, mapActions } from 'vuex';
-import { sprintf, s__, __ } from '~/locale';
+import { s__, __ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { DEFAULT_REGION } from '../constants';
@@ -38,6 +36,9 @@ export default {
regionHelpText: s__(
'ClusterIntegration|Select the region you want to create the new cluster in. Make sure you have access to this region for your role to be able to authenticate. If no region is selected, we will use %{codeStart}DEFAULT_REGION%{codeEnd}. Learn more about %{linkStart}Regions%{linkEnd}.',
),
+ accountAndExternalIdsHelpText: s__(
+ 'ClusterIntegration|The Amazon Resource Name (ARN) associated with your role. If you do not have a provisioned role, first create one on %{awsLinkStart}Amazon Web Services %{awsLinkEnd} using the above account and external IDs. %{moreInfoStart}More information%{moreInfoEnd}',
+ ),
regionHelpTextDefaultRegion: DEFAULT_REGION,
},
data() {
@@ -56,39 +57,8 @@ export default {
? __('Authenticating')
: s__('ClusterIntegration|Authenticate with AWS');
},
- accountAndExternalIdsHelpText() {
- const escapedUrl = escape(this.accountAndExternalIdsHelpPath);
-
- return sprintf(
- s__(
- 'ClusterIntegration|Create a provision role on %{startAwsLink}Amazon Web Services %{externalLinkIcon}%{endLink} using the account and external ID above. %{startMoreInfoLink}More information%{endLink}',
- ),
- {
- startAwsLink:
- '<a href="https://console.aws.amazon.com/iam/home?#roles" target="_blank" rel="noopener noreferrer">',
- startMoreInfoLink: `<a href="${escapedUrl}" target="_blank" rel="noopener noreferrer">`,
- externalLinkIcon: this.externalLinkIcon,
- endLink: '</a>',
- },
- false,
- );
- },
- provisionRoleArnHelpText() {
- const escapedUrl = escape(this.createRoleArnHelpPath);
-
- return sprintf(
- s__(
- 'ClusterIntegration|The Amazon Resource Name (ARN) associated with your role. If you do not have a provisioned role, first create one on %{startAwsLink}Amazon Web Services %{externalLinkIcon}%{endLink} using the above account and external IDs. %{startMoreInfoLink}More information%{endLink}',
- ),
- {
- startAwsLink:
- '<a href="https://console.aws.amazon.com/iam/home?#roles" target="_blank" rel="noopener noreferrer">',
- startMoreInfoLink: `<a href="${escapedUrl}" target="_blank" rel="noopener noreferrer">`,
- externalLinkIcon: this.externalLinkIcon,
- endLink: '</a>',
- },
- false,
- );
+ awsHelpLink() {
+ return 'https://console.aws.amazon.com/iam/home?#roles';
},
},
methods: {
@@ -142,13 +112,41 @@ export default {
</div>
</div>
<div class="col-12 mb-3 mt-n3">
- <p class="form-text text-muted" v-html="accountAndExternalIdsHelpText"></p>
+ <p class="form-text text-muted">
+ <gl-sprintf :message="$options.i18n.accountAndExternalIdsHelpText">
+ <template #awsLink="{ content }">
+ <gl-link :href="awsHelpLink" target="_blank">
+ {{ content }}
+ <gl-icon name="external-link" class="gl-vertical-align-middle" />
+ </gl-link>
+ </template>
+ <template #moreInfo="{ content }">
+ <gl-link :href="accountAndExternalIdsHelpPath" target="_blank">
+ {{ content }}
+ </gl-link>
+ </template>
+ </gl-sprintf>
+ </p>
</div>
</div>
<div class="form-group">
<label for="eks-provision-role-arn">{{ s__('ClusterIntegration|Provision Role ARN') }}</label>
<gl-form-input id="eks-provision-role-arn" v-model="roleArn" />
- <p class="form-text text-muted" v-html="provisionRoleArnHelpText"></p>
+ <p class="form-text text-muted">
+ <gl-sprintf :message="$options.i18n.accountAndExternalIdsHelpText">
+ <template #awsLink="{ content }">
+ <gl-link :href="awsHelpLink" target="_blank">
+ {{ content }}
+ <gl-icon name="external-link" class="gl-vertical-align-middle" />
+ </gl-link>
+ </template>
+ <template #moreInfo="{ content }">
+ <gl-link :href="accountAndExternalIdsHelpPath" target="_blank">
+ {{ content }}
+ </gl-link>
+ </template>
+ </gl-sprintf>
+ </p>
</div>
<gl-form-group :label="$options.i18n.regionInputLabel">