@gitlab/ui 76.1.0 → 77.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +38 -3
  3. package/dist/components/experimental/duo/chat/duo_chat.js +1 -1
  4. package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +42 -25
  5. package/dist/index.css.map +1 -1
  6. package/dist/tokens/css/tokens.css +1 -1
  7. package/dist/tokens/css/tokens.dark.css +1 -1
  8. package/dist/tokens/js/tokens.dark.js +1 -1
  9. package/dist/tokens/js/tokens.js +1 -1
  10. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  11. package/dist/tokens/scss/_tokens.scss +1 -1
  12. package/dist/utility_classes.css +1 -1
  13. package/dist/utility_classes.css.map +1 -1
  14. package/package.json +2 -2
  15. package/src/components/base/alert/alert.scss +7 -7
  16. package/src/components/base/badge/badge.scss +1 -1
  17. package/src/components/base/banner/banner.scss +3 -3
  18. package/src/components/base/button/button.scss +2 -2
  19. package/src/components/base/card/card.scss +1 -1
  20. package/src/components/base/datepicker/datepicker.scss +5 -5
  21. package/src/components/base/drawer/drawer.scss +10 -10
  22. package/src/components/base/dropdown/dropdown_item.scss +1 -1
  23. package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +1 -1
  24. package/src/components/base/form/form_checkbox/form_checkbox.scss +3 -3
  25. package/src/components/base/label/label.scss +1 -1
  26. package/src/components/base/loading_icon/loading_icon.scss +1 -1
  27. package/src/components/base/modal/modal.scss +1 -1
  28. package/src/components/base/new_dropdowns/dropdown.scss +1 -1
  29. package/src/components/base/new_dropdowns/dropdown_item.scss +1 -1
  30. package/src/components/base/new_dropdowns/listbox/listbox.scss +3 -3
  31. package/src/components/base/path/path.scss +8 -8
  32. package/src/components/base/search_box_by_click/search_box_by_click.scss +7 -7
  33. package/src/components/base/search_box_by_type/search_box_by_type.scss +5 -5
  34. package/src/components/base/tabs/tabs/tabs.scss +5 -5
  35. package/src/components/base/toast/toast.scss +5 -5
  36. package/src/components/base/toggle/toggle.scss +4 -4
  37. package/src/components/charts/heatmap/heatmap.scss +1 -1
  38. package/src/components/charts/legend/legend.scss +3 -3
  39. package/src/components/charts/tooltip/tooltip.scss +1 -1
  40. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +3 -3
  41. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.spec.js +15 -3
  42. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +53 -1
  43. package/src/components/experimental/duo/chat/duo_chat.vue +2 -2
  44. package/src/components/experimental/duo/user_feedback/user_feedback.md +0 -5
  45. package/src/components/experimental/duo/user_feedback/user_feedback.spec.js +12 -4
  46. package/src/components/experimental/duo/user_feedback/user_feedback_modal.spec.js +49 -12
  47. package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +48 -31
  48. package/src/scss/tailwind.css +1 -0
  49. package/src/scss/utilities.scss +24 -430
  50. package/src/scss/utility-mixins/{appearance.scss → deprecated.scss} +9 -0
  51. package/src/scss/utility-mixins/index.scss +3 -2
  52. package/src/scss/utility-mixins/position.scss +0 -223
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [77.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v77.0.0...v77.1.0) (2024-02-27)
2
+
3
+
4
+ ### Features
5
+
6
+ * **DuoChat:** Improve the feedback mechanism in the DuoChat ([235077d](https://gitlab.com/gitlab-org/gitlab-ui/commit/235077d5a20a8a3848233450d8d1c9190008cc15))
7
+
8
+ # [77.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v76.1.0...v77.0.0) (2024-02-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * migrate internal positioning utilities to Tailwind ([bc9ad6a](https://gitlab.com/gitlab-org/gitlab-ui/commit/bc9ad6a8ed21e7a7c673daa23bd8a2bbddeaf30a))
14
+ * remove legacy positioning utilities ([8d0450a](https://gitlab.com/gitlab-org/gitlab-ui/commit/8d0450a9077c19e3ae0a49f8e80cd0887ec8ee65))
15
+
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * Positioning utilities have been removed. Consumers should enable the
20
+ following Tailwind CSS core plugins:
21
+ * `float`
22
+ * `inset`
23
+ * `position`
24
+
1
25
  # [76.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v76.0.1...v76.1.0) (2024-02-27)
2
26
 
3
27
 
@@ -1,4 +1,6 @@
1
1
  import GlDuoUserFeedback from '../../../user_feedback/user_feedback';
2
+ import GlFormGroup from '../../../../../base/form/form_group/form_group';
3
+ import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea';
2
4
  import { SafeHtmlDirective } from '../../../../../../directives/safe_html/safe_html';
3
5
  import { MESSAGE_MODEL_ROLES } from '../../constants';
4
6
  import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources';
@@ -6,6 +8,16 @@ import { renderDuoChatMarkdownPreview } from '../../markdown_renderer';
6
8
  import { CopyCodeElement } from './copy_code_element';
7
9
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
8
10
 
11
+ const i18n = {
12
+ MODAL: {
13
+ TITLE: 'Give feedback on GitLab Duo Chat',
14
+ ALERT_TEXT: 'GitLab team members cannot view your conversation. Please be as descriptive as possible.',
15
+ DID_WHAT: 'What were you doing?',
16
+ INTERACTION: 'The situation in which you interacted with GitLab Duo Chat.',
17
+ IMPROVE_WHAT: 'How could the response be improved?',
18
+ BETTER_RESPONSE: 'How the response might better meet your needs.'
19
+ }
20
+ };
9
21
  const concatUntilEmpty = arr => {
10
22
  if (!arr) return '';
11
23
  let end = arr.findIndex(el => !el);
@@ -19,11 +31,19 @@ var script = {
19
31
  },
20
32
  components: {
21
33
  DocumentationSources,
22
- GlDuoUserFeedback
34
+ GlDuoUserFeedback,
35
+ GlFormGroup,
36
+ GlFormTextarea
23
37
  },
24
38
  directives: {
25
39
  SafeHtml: SafeHtmlDirective
26
40
  },
41
+ provide() {
42
+ return {
43
+ modalTitle: i18n.MODAL.TITLE,
44
+ modalAlertText: i18n.MODAL.ALERT_TEXT
45
+ };
46
+ },
27
47
  inject: {
28
48
  // Note, we likely might move away from Provide/Inject for this
29
49
  // and only ship the versions that are currently in the default
@@ -49,6 +69,12 @@ var script = {
49
69
  required: true
50
70
  }
51
71
  },
72
+ data() {
73
+ return {
74
+ didWhat: '',
75
+ improveWhat: ''
76
+ };
77
+ },
52
78
  computed: {
53
79
  isAssistantMessage() {
54
80
  return this.message.role.toLowerCase() === MESSAGE_MODEL_ROLES.assistant;
@@ -84,8 +110,16 @@ var script = {
84
110
  if (this.message.contentHtml) {
85
111
  this.renderGFM(this.$refs.content);
86
112
  }
113
+ },
114
+ logEvent(e) {
115
+ this.$emit('track-feedback', {
116
+ ...e,
117
+ didWhat: this.didWhat,
118
+ improveWhat: this.improveWhat
119
+ });
87
120
  }
88
- }
121
+ },
122
+ i18n
89
123
  };
90
124
 
91
125
  /* script */
@@ -96,7 +130,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
96
130
  'gl-ml-auto gl-bg-blue-100 gl-text-blue-900 gl-rounded-bottom-right-none': _vm.isUserMessage,
97
131
  'gl-rounded-bottom-left-none gl-text-gray-900 gl-bg-white gl-border-1 gl-border-solid gl-border-gray-50':
98
132
  _vm.isAssistantMessage,
99
- }},[_c('div',{directives:[{name:"safe-html",rawName:"v-safe-html:[$options.safeHtmlConfigExtension]",value:(_vm.messageContent),expression:"messageContent",arg:_vm.$options.safeHtmlConfigExtension}],ref:"content"}),_vm._v(" "),(_vm.isAssistantMessage)?[(_vm.sources)?_c('documentation-sources',{attrs:{"sources":_vm.sources}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-align-items-flex-end gl-mt-4 duo-chat-message-feedback"},[_c('gl-duo-user-feedback',{on:{"feedback":function($event){return _vm.$emit('track-feedback', $event)}}})],1)]:_vm._e()],2)};
133
+ }},[_c('div',{directives:[{name:"safe-html",rawName:"v-safe-html:[$options.safeHtmlConfigExtension]",value:(_vm.messageContent),expression:"messageContent",arg:_vm.$options.safeHtmlConfigExtension}],ref:"content"}),_vm._v(" "),(_vm.isAssistantMessage)?[(_vm.sources)?_c('documentation-sources',{attrs:{"sources":_vm.sources}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-align-items-flex-end gl-mt-4 duo-chat-message-feedback"},[_c('gl-duo-user-feedback',{attrs:{"modal-title":_vm.$options.i18n.MODAL.TITLE,"modal-alert":_vm.$options.i18n.MODAL.ALERT_TEXT},on:{"feedback":_vm.logEvent},scopedSlots:_vm._u([{key:"feedback-extra-fields",fn:function(){return [_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL.DID_WHAT,"optional":""}},[_c('gl-form-textarea',{attrs:{"placeholder":_vm.$options.i18n.MODAL.INTERACTION},model:{value:(_vm.didWhat),callback:function ($$v) {_vm.didWhat=$$v;},expression:"didWhat"}})],1),_vm._v(" "),_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL.IMPROVE_WHAT,"optional":""}},[_c('gl-form-textarea',{attrs:{"placeholder":_vm.$options.i18n.MODAL.BETTER_RESPONSE},model:{value:(_vm.improveWhat),callback:function ($$v) {_vm.improveWhat=$$v;},expression:"improveWhat"}})],1)]},proxy:true}],null,false,419229417)})],1)]:_vm._e()],2)};
100
134
  var __vue_staticRenderFns__ = [];
101
135
 
102
136
  /* style */
@@ -129,3 +163,4 @@ var __vue_staticRenderFns__ = [];
129
163
  );
130
164
 
131
165
  export default __vue_component__;
166
+ export { i18n };
@@ -347,7 +347,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
347
347
  {
348
348
  'gl-h-full': !_vm.hasMessages,
349
349
  'force-scroll-bar': _vm.hasMessages,
350
- } ],attrs:{"tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"messages":conversation,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('gl-empty-state',{key:"empty-state",staticClass:"gl-flex-grow gl-justify-content-center",attrs:{"svg-path":_vm.$options.emptySvg,"svg-height":145,"title":_vm.emptyStateTitle,"description":_vm.emptyStateDescription}}),_vm._v(" "),_c('gl-duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})]:_vm._e(),_vm._v(" "),(_vm.isLoading)?_c('gl-duo-chat-loader',{key:"loader",attrs:{"tool-name":_vm.toolName}}):_vm._e(),_vm._v(" "),_c('div',{key:"anchor",ref:"anchor",staticClass:"scroll-anchor"})],2)],1),_vm._v(" "),(_vm.isChatAvailable)?_c('footer',{staticClass:"gl-drawer-footer gl-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10",class:{ 'gl-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [_c('gl-button',{staticClass:"gl-absolute! gl-bottom-2 gl-right-2 gl-rounded-base!",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL,"disabled":_vm.isLoading}})]},proxy:true}],null,false,2232229068)},[_c('div',{staticClass:"duo-chat-input gl-flex-grow-1 gl-vertical-align-top gl-max-w-full gl-min-h-8 gl-inset-border-1-gray-400 gl-rounded-base gl-bg-white",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands gl-absolute! gl-translate-y-n100 gl-list-style-none gl-pl-0 gl-w-full gl-shadow-md",attrs:{"body-class":"gl-p-2!"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-display-flex gl-justify-content-space-between"},[_c('span',{staticClass:"gl-display-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-text-gray-500 gl-font-style-italic gl-text-right gl-pl-3"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute gl-h-full! gl-py-4! gl-bg-transparent! gl-rounded-top-right-none gl-rounded-bottom-right-none gl-shadow-none!",class:{ 'gl-text-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"disabled":_vm.isLoading,"autofocus":""},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)]),_vm._v(" "),_c('gl-form-text',{staticClass:"gl-text-gray-400 gl-line-height-20 gl-mt-3",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER))])],1)],1):_vm._e()]):_vm._e()};
350
+ } ],attrs:{"tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"messages":conversation,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('gl-empty-state',{key:"empty-state",staticClass:"gl-flex-grow gl-justify-content-center",attrs:{"svg-path":_vm.$options.emptySvg,"svg-height":145,"title":_vm.emptyStateTitle,"description":_vm.emptyStateDescription}}),_vm._v(" "),_c('gl-duo-chat-predefined-prompts',{key:"predefined-prompts",attrs:{"prompts":_vm.predefinedPrompts},on:{"click":_vm.sendPredefinedPrompt}})]:_vm._e(),_vm._v(" "),(_vm.isLoading)?_c('gl-duo-chat-loader',{key:"loader",attrs:{"tool-name":_vm.toolName}}):_vm._e(),_vm._v(" "),_c('div',{key:"anchor",ref:"anchor",staticClass:"scroll-anchor"})],2)],1),_vm._v(" "),(_vm.isChatAvailable)?_c('footer',{staticClass:"gl-drawer-footer gl-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10",class:{ 'gl-drawer-body-scrim-on-footer': !_vm.scrolledToBottom },attrs:{"data-testid":"chat-footer"}},[_c('gl-form',{attrs:{"data-testid":"chat-prompt-form"},on:{"submit":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sendChatPrompt.apply(null, arguments)}}},[_c('gl-form-input-group',{scopedSlots:_vm._u([{key:"append",fn:function(){return [_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 gl-rounded-base!",attrs:{"icon":"paper-airplane","category":"primary","variant":"confirm","type":"submit","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL,"disabled":_vm.isLoading}})]},proxy:true}],null,false,3929529036)},[_c('div',{staticClass:"duo-chat-input gl-flex-grow-1 gl-vertical-align-top gl-max-w-full gl-min-h-8 gl-inset-border-1-gray-400 gl-rounded-base gl-bg-white",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands !gl-absolute gl-translate-y-n100 gl-list-style-none gl-pl-0 gl-w-full gl-shadow-md",attrs:{"body-class":"gl-p-2!"}},_vm._l((_vm.filteredSlashCommands),function(command,index){return _c('gl-dropdown-item',{key:command.name,class:{ 'active-command': index === _vm.activeCommandIndex },on:{"click":function($event){return _vm.selectSlashCommand(index)}},nativeOn:{"mouseenter":function($event){_vm.activeCommandIndex = index;}}},[_c('span',{staticClass:"gl-display-flex gl-justify-content-space-between"},[_c('span',{staticClass:"gl-display-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-text-gray-500 gl-font-style-italic gl-text-right gl-pl-3"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute gl-h-full! gl-py-4! gl-bg-transparent! gl-rounded-top-right-none gl-rounded-bottom-right-none gl-shadow-none!",class:{ 'gl-text-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"disabled":_vm.isLoading,"autofocus":""},nativeOn:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }if($event.ctrlKey||$event.shiftKey||$event.altKey||$event.metaKey){ return null; }$event.preventDefault();},"keyup":function($event){return _vm.onInputKeyup.apply(null, arguments)}},model:{value:(_vm.prompt),callback:function ($$v) {_vm.prompt=$$v;},expression:"prompt"}})],1)]),_vm._v(" "),_c('gl-form-text',{staticClass:"gl-text-gray-400 gl-line-height-20 gl-mt-3",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER))])],1)],1):_vm._e()]):_vm._e()};
351
351
  var __vue_staticRenderFns__ = [];
352
352
 
353
353
  /* style */
@@ -1,55 +1,72 @@
1
1
  import GlModal from '../../../base/modal/modal';
2
+ import GlAlert from '../../../base/alert/alert';
2
3
  import GlFormGroup from '../../../base/form/form_group/form_group';
3
4
  import GlFormTextarea from '../../../base/form/form_textarea/form_textarea';
4
5
  import GlFormCheckboxGroup from '../../../base/form/form_checkbox/form_checkbox_group';
5
6
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
7
 
7
8
  const i18n = {
8
- MODAL_TITLE: 'Give feedback on AI content',
9
- MODAL_DESCRIPTION: 'To help improve the quality of the content, send your feedback to GitLab team members.',
10
- MODAL_OPTIONS_LABEL: 'How was the AI content?',
11
- MODAL_MORE_LABEL: 'More information',
12
- MODAL_MORE_PLACEHOLDER: 'How could the content be improved?',
13
- MODAL_FEEDBACK_OPTIONS: {
14
- helpful: 'Helpful',
15
- unhelpful: 'Unhelpful or irrelevant',
16
- incorrect: 'Factually incorrect',
17
- long: 'Too long',
18
- abuse: 'Abusive or offensive',
19
- other: 'Something else'
20
- },
21
- MODAL_ACTIONS: {
22
- submit: 'Submit',
23
- cancel: 'Cancel'
9
+ MODAL: {
10
+ TITLE: 'Give feedback on GitLab Duo',
11
+ DESCRIPTION: 'To help improve GitLab Duo, send your feeback to GitLab team members.',
12
+ ALERT: 'GitLab team members cannot see the AI content. Please be as descriptive as possible.',
13
+ OPTIONS_LABEL: 'How could the AI content be improved?',
14
+ SITUATION_DESCRIPTION_LABEL: 'What were you doing?',
15
+ SITUATION_DESCRIPTION_PLACEHOLDER: 'The situation in which you interacted with GitLab Duo Chat.',
16
+ IMPROVEMENT_SUGGESTION_LABEL: 'How could the response be improved?',
17
+ IMPROVEMENT_SUGGESTION_PLACEHOLDER: 'How the response might better meet your needs.',
18
+ MORE_LABEL: 'More information',
19
+ MORE_PLACEHOLDER: 'How could the content be improved?',
20
+ FEEDBACK_OPTIONS: {
21
+ helpful: 'Helpful',
22
+ unhelpful: 'Unhelpful or irrelevant',
23
+ incorrect: 'Factually incorrect',
24
+ long: 'Too long',
25
+ abuse: 'Abusive or offensive',
26
+ other: 'Something else'
27
+ },
28
+ ACTIONS: {
29
+ submit: 'Submit',
30
+ cancel: 'Cancel'
31
+ }
24
32
  }
25
33
  };
26
34
  const feedbackOptions = [{
27
- text: i18n.MODAL_FEEDBACK_OPTIONS.helpful,
35
+ text: i18n.MODAL.FEEDBACK_OPTIONS.helpful,
28
36
  value: 'helpful'
29
37
  }, {
30
- text: i18n.MODAL_FEEDBACK_OPTIONS.unhelpful,
38
+ text: i18n.MODAL.FEEDBACK_OPTIONS.unhelpful,
31
39
  value: 'unhelpful'
32
40
  }, {
33
- text: i18n.MODAL_FEEDBACK_OPTIONS.incorrect,
41
+ text: i18n.MODAL.FEEDBACK_OPTIONS.incorrect,
34
42
  value: 'incorrect'
35
43
  }, {
36
- text: i18n.MODAL_FEEDBACK_OPTIONS.long,
44
+ text: i18n.MODAL.FEEDBACK_OPTIONS.long,
37
45
  value: 'long'
38
46
  }, {
39
- text: i18n.MODAL_FEEDBACK_OPTIONS.abuse,
47
+ text: i18n.MODAL.FEEDBACK_OPTIONS.abuse,
40
48
  value: 'abuse'
41
49
  }, {
42
- text: i18n.MODAL_FEEDBACK_OPTIONS.other,
50
+ text: i18n.MODAL.FEEDBACK_OPTIONS.other,
43
51
  value: 'other'
44
52
  }];
45
53
  var script = {
46
54
  name: 'DuoChatFeedbackModal',
47
55
  components: {
48
56
  GlModal,
57
+ GlAlert,
49
58
  GlFormCheckboxGroup,
50
59
  GlFormGroup,
51
60
  GlFormTextarea
52
61
  },
62
+ inject: {
63
+ modalTitle: {
64
+ default: i18n.MODAL.TITLE
65
+ },
66
+ modalAlert: {
67
+ default: i18n.MODAL.ALERT
68
+ }
69
+ },
53
70
  data() {
54
71
  return {
55
72
  selectedFeedbackOptions: [],
@@ -74,10 +91,10 @@ var script = {
74
91
  },
75
92
  actions: {
76
93
  primary: {
77
- text: i18n.MODAL_ACTIONS.submit
94
+ text: i18n.MODAL.ACTIONS.submit
78
95
  },
79
96
  cancel: {
80
- text: i18n.MODAL_ACTIONS.cancel
97
+ text: i18n.MODAL.ACTIONS.cancel
81
98
  }
82
99
  },
83
100
  feedbackOptions,
@@ -88,7 +105,7 @@ var script = {
88
105
  const __vue_script__ = script;
89
106
 
90
107
  /* template */
91
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-modal',{ref:"feedbackModal",attrs:{"modal-id":"feedbackModal","title":_vm.$options.i18n.MODAL_TITLE,"action-primary":_vm.$options.actions.primary,"action-cancel":_vm.$options.actions.cancel,"visible":false,"size":"sm"},on:{"primary":_vm.onFeedbackSubmit,"canceled":_vm.onFeedbackCanceled}},[_c('p',[_vm._v(_vm._s(_vm.$options.i18n.MODAL_DESCRIPTION))]),_vm._v(" "),_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL_OPTIONS_LABEL,"optional":false,"data-testid":"feedback-options"}},[_c('gl-form-checkbox-group',{attrs:{"options":_vm.$options.feedbackOptions},model:{value:(_vm.selectedFeedbackOptions),callback:function ($$v) {_vm.selectedFeedbackOptions=$$v;},expression:"selectedFeedbackOptions"}})],1),_vm._v(" "),_vm._t("feedback-extra-fields",function(){return [_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL_MORE_LABEL,"optional":""}},[_c('gl-form-textarea',{attrs:{"placeholder":_vm.$options.i18n.MODAL_MORE_PLACEHOLDER},model:{value:(_vm.extendedFeedback),callback:function ($$v) {_vm.extendedFeedback=$$v;},expression:"extendedFeedback"}})],1)]})],2)};
108
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-modal',{ref:"feedbackModal",attrs:{"modal-id":"feedbackModal","title":_vm.modalTitle,"action-primary":_vm.$options.actions.primary,"action-cancel":_vm.$options.actions.cancel,"visible":false,"size":"sm"},on:{"primary":_vm.onFeedbackSubmit,"canceled":_vm.onFeedbackCanceled}},[_c('p',[_vm._v(_vm._s(_vm.$options.i18n.MODAL.DESCRIPTION))]),_vm._v(" "),_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL.OPTIONS_LABEL,"optional":false,"data-testid":"feedback-options"}},[_c('gl-form-checkbox-group',{attrs:{"options":_vm.$options.feedbackOptions},model:{value:(_vm.selectedFeedbackOptions),callback:function ($$v) {_vm.selectedFeedbackOptions=$$v;},expression:"selectedFeedbackOptions"}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-mb-5",attrs:{"dismissible":false}},[_vm._v(_vm._s(_vm.modalAlert))]),_vm._v(" "),_vm._t("feedback-extra-fields",function(){return [_c('gl-form-group',{attrs:{"label":_vm.$options.i18n.MODAL.MORE_LABEL,"optional":""}},[_c('gl-form-textarea',{attrs:{"placeholder":_vm.$options.i18n.MODAL.MORE_PLACEHOLDER},model:{value:(_vm.extendedFeedback),callback:function ($$v) {_vm.extendedFeedback=$$v;},expression:"extendedFeedback"}})],1)]})],2)};
92
109
  var __vue_staticRenderFns__ = [];
93
110
 
94
111
  /* style */