Commit 9e568113 authored by Mike Greiling's avatar Mike Greiling

Switch to GlSprintf for dropdown option

parent a4ed543f
<script> <script>
import { escape } from 'lodash';
import { import {
GlDropdown, GlDropdown,
GlDropdownDivider, GlDropdownDivider,
GlDropdownItem, GlDropdownItem,
GlLoadingIcon, GlLoadingIcon,
GlSearchBoxByType, GlSearchBoxByType,
GlSprintf,
} from '@gitlab/ui'; } from '@gitlab/ui';
import LoadingButton from '~/vue_shared/components/loading_button.vue'; import LoadingButton from '~/vue_shared/components/loading_button.vue';
import ClipboardButton from '../../vue_shared/components/clipboard_button.vue'; import ClipboardButton from '../../vue_shared/components/clipboard_button.vue';
import { __, s__, sprintf } from '~/locale'; import { __, s__ } from '~/locale';
import { APPLICATION_STATUS } from '~/clusters/constants'; import { APPLICATION_STATUS } from '~/clusters/constants';
...@@ -24,6 +24,7 @@ export default { ...@@ -24,6 +24,7 @@ export default {
GlDropdownDivider, GlDropdownDivider,
GlDropdownItem, GlDropdownItem,
GlSearchBoxByType, GlSearchBoxByType,
GlSprintf,
}, },
props: { props: {
knative: { knative: {
...@@ -71,15 +72,6 @@ export default { ...@@ -71,15 +72,6 @@ export default {
domainDropdownText() { domainDropdownText() {
return this.knativeHostname || s__('ClusterIntegration|Select existing domain or use new'); return this.knativeHostname || s__('ClusterIntegration|Select existing domain or use new');
}, },
useQueryText() {
return sprintf(
s__('ClusterIntegration|Use %{query}'),
{
query: `<code>${escape(this.searchQuery)}</code>`,
},
false,
);
},
availableDomains() { availableDomains() {
return this.knative.availableDomains || []; return this.knative.availableDomains || [];
}, },
...@@ -147,7 +139,13 @@ export default { ...@@ -147,7 +139,13 @@ export default {
<template v-if="searchQuery"> <template v-if="searchQuery">
<gl-dropdown-divider /> <gl-dropdown-divider />
<gl-dropdown-item key="custom-domain" @click="selectCustomDomain(searchQuery)"> <gl-dropdown-item key="custom-domain" @click="selectCustomDomain(searchQuery)">
<span class="ml-1" v-html="useQueryText"></span> <span class="ml-1">
<gl-sprintf :message="s__('ClusterIntegration|Use %{query}')">
<template #query>
<code>{{ searchQuery }}</code>
</template>
</gl-sprintf>
</span>
</gl-dropdown-item> </gl-dropdown-item>
</template> </template>
</gl-dropdown> </gl-dropdown>
......
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