diff options
Diffstat (limited to 'app/assets/javascripts/integrations/edit')
-rw-r--r-- | app/assets/javascripts/integrations/edit/components/dynamic_field.vue | 18 | ||||
-rw-r--r-- | app/assets/javascripts/integrations/edit/components/integration_form.vue | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/app/assets/javascripts/integrations/edit/components/dynamic_field.vue b/app/assets/javascripts/integrations/edit/components/dynamic_field.vue index 3655f94f06f..1fd4083b920 100644 --- a/app/assets/javascripts/integrations/edit/components/dynamic_field.vue +++ b/app/assets/javascripts/integrations/edit/components/dynamic_field.vue @@ -1,6 +1,12 @@ <script> -/* eslint-disable vue/no-v-html */ -import { GlFormGroup, GlFormCheckbox, GlFormInput, GlFormSelect, GlFormTextarea } from '@gitlab/ui'; +import { + GlFormGroup, + GlFormCheckbox, + GlFormInput, + GlFormSelect, + GlFormTextarea, + GlSafeHtmlDirective as SafeHtml, +} from '@gitlab/ui'; import { capitalize, lowerCase, isEmpty } from 'lodash'; import { mapGetters } from 'vuex'; import eventHub from '../event_hub'; @@ -14,6 +20,9 @@ export default { GlFormSelect, GlFormTextarea, }, + directives: { + SafeHtml, + }, props: { choices: { type: Array, @@ -122,6 +131,9 @@ export default { this.validated = true; }, }, + helpHtmlConfig: { + ADD_ATTR: ['target'], // allow external links, can be removed after https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1427 is implemented + }, }; </script> @@ -133,7 +145,7 @@ export default { :state="valid" > <template #description> - <span v-html="help"></span> + <span v-safe-html:[$options.helpHtmlConfig]="help"></span> </template> <template v-if="isCheckbox"> diff --git a/app/assets/javascripts/integrations/edit/components/integration_form.vue b/app/assets/javascripts/integrations/edit/components/integration_form.vue index 91f7c7dabf6..63f007170d0 100644 --- a/app/assets/javascripts/integrations/edit/components/integration_form.vue +++ b/app/assets/javascripts/integrations/edit/components/integration_form.vue @@ -86,7 +86,9 @@ export default { }, }, helpHtmlConfig: { + ADD_ATTR: ['target'], // allow external links, can be removed after https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1427 is implemented ADD_TAGS: ['use'], // to support icon SVGs + FORBID_ATTR: [], // This is trusted input so we can override the default config to allow data-* attributes }, }; </script> |