@gitlab/duo-ui 11.1.2 → 11.2.1

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 (31) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/agentic_chat/web_agentic_duo_chat.js +14 -4
  3. package/dist/components/chat/components/duo_chat_message/message_types/message_tool.js +8 -4
  4. package/dist/components/chat/components/duo_chat_message_tool_approval/components/base_tool_params.js +79 -0
  5. package/dist/components/chat/components/duo_chat_message_tool_approval/components/issuable_tool_params.js +116 -0
  6. package/dist/components/chat/components/duo_chat_message_tool_approval/components/run_command_tool_params.js +45 -5
  7. package/dist/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.js +67 -20
  8. package/dist/components/chat/constants.js +12 -1
  9. package/dist/components/chat/mock_data.js +77 -1
  10. package/dist/components/chat/web_duo_chat.js +21 -7
  11. package/dist/components.css +1 -1
  12. package/dist/components.css.map +1 -1
  13. package/dist/tailwind.css +1 -1
  14. package/dist/tailwind.css.map +1 -1
  15. package/package.json +2 -2
  16. package/src/components/agentic_chat/web_agentic_duo_chat.vue +25 -9
  17. package/src/components/chat/components/duo_chat_message/message_types/message_tool.vue +23 -11
  18. package/src/components/chat/components/duo_chat_message_tool_approval/components/base_tool_params.vue +55 -0
  19. package/src/components/chat/components/duo_chat_message_tool_approval/components/issuable_tool_params.vue +112 -0
  20. package/src/components/chat/components/duo_chat_message_tool_approval/components/run_command_tool_params.vue +51 -6
  21. package/src/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.vue +97 -22
  22. package/src/components/chat/constants.js +12 -0
  23. package/src/components/chat/mock_data.js +80 -0
  24. package/src/components/chat/web_duo_chat.scss +10 -0
  25. package/src/components/chat/web_duo_chat.vue +46 -12
  26. package/src/scss/components.scss +1 -0
  27. package/translations.js +26 -7
  28. package/dist/components/chat/components/duo_chat_message_tool_approval/components/create_issue_tool_params.js +0 -88
  29. package/dist/components/chat/components/duo_chat_message_tool_approval/components/create_merge_request_tool_params.js +0 -83
  30. package/src/components/chat/components/duo_chat_message_tool_approval/components/create_issue_tool_params.vue +0 -80
  31. package/src/components/chat/components/duo_chat_message_tool_approval/components/create_merge_request_tool_params.vue +0 -74
@@ -205,6 +205,51 @@ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND = {
205
205
  role: 'request',
206
206
  };
207
207
 
208
+ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_RESPONSE = {
209
+ id: '125',
210
+ content: 'Tool run_command requires approval. Please confirm if you want to proceed.',
211
+ message_type: MESSAGE_MODEL_ROLES.request,
212
+ tool_info: {
213
+ args: { command: 'cat Dockerfile | grep ENV' },
214
+ name: 'run_command',
215
+ tool_response: {
216
+ id: null,
217
+ name: 'run_command',
218
+ type: 'ToolMessage',
219
+ status: 'success',
220
+ content:
221
+ '\u001b]133;C;\u0007\u001b]633;E;cat Dockerfile | grep ENV;790e289b-7fc3-4fa8-accb-83538d075bfb\u0007\u001b]633;C\u0007ENV PYTHONDONTWRITEBYTECODE=1 \\\r\n',
222
+ artifact: null,
223
+ tool_call_id: 'toolu_01W1DWmLp26vLrohCV5ernd4',
224
+ additional_kwargs: {},
225
+ response_metadata: {},
226
+ },
227
+ },
228
+ timestamp: '2025-06-25T19:22:21.290791+00:00',
229
+ status: 'success',
230
+ role: 'request',
231
+ };
232
+
233
+ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_GIT_COMMAND = {
234
+ status: 'success',
235
+ content: 'Tool run_git_command requires approval. Please confirm if you want to proceed.',
236
+ timestamp: '2025-09-24T10:05:58.707330+00:00',
237
+ tool_info: {
238
+ args: {
239
+ args: '-r',
240
+ command: 'branch',
241
+ repository_url: 'https://gdk.test:3443/gitlab-duo/test',
242
+ },
243
+ name: 'run_git_command',
244
+ },
245
+ message_type: 'request',
246
+ correlation_id: null,
247
+ message_sub_type: null,
248
+ additional_context: null,
249
+ requestId: '41-1',
250
+ role: 'assistant',
251
+ };
252
+
208
253
  export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE = {
209
254
  id: '125',
210
255
  content: 'Tool run_command requires approval. Please confirm if you want to proceed.',
@@ -224,6 +269,41 @@ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE = {
224
269
  role: 'request',
225
270
  };
226
271
 
272
+ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_ISSUE = {
273
+ id: '125',
274
+ content: 'Tool update_issue requires approval. Please confirm if you want to proceed.',
275
+ message_type: MESSAGE_MODEL_ROLES.request,
276
+ tool_info: {
277
+ name: 'update_issue',
278
+ args: {
279
+ project_id: 123,
280
+ issue_iid: 2,
281
+ title: 'CSP bug in VSCode Fork prevents loading external web views in Web IDE',
282
+ },
283
+ },
284
+ timestamp: '2025-06-25T19:22:21.290791+00:00',
285
+ status: 'success',
286
+ role: 'request',
287
+ };
288
+
289
+ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_EPIC = {
290
+ id: '125',
291
+ content: 'Tool create_epic requires approval. Please confirm if you want to proceed.',
292
+ message_type: MESSAGE_MODEL_ROLES.request,
293
+ tool_info: {
294
+ name: 'create_epic',
295
+ args: {
296
+ group_id: 'gitlab-duo',
297
+ title: 'CI Pipeline roadmap',
298
+ description:
299
+ 'This epic contains issues related to making the CI pipeline of various projects more efficient',
300
+ },
301
+ },
302
+ timestamp: '2025-06-25T19:22:21.290791+00:00',
303
+ status: 'success',
304
+ role: 'request',
305
+ };
306
+
227
307
  export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT = {
228
308
  id: '125',
229
309
  content: 'Tool create_commit requires approval. Please confirm if you want to proceed.',
@@ -0,0 +1,10 @@
1
+ .duo-chat-input {
2
+ &.web-only {
3
+ position: relative;
4
+ overflow: visible;
5
+
6
+ &::after {
7
+ @apply gl-p-2;
8
+ }
9
+ }
10
+ }
@@ -10,7 +10,7 @@ import {
10
10
  GlSafeHtmlDirective as SafeHtml,
11
11
  } from '@gitlab/ui';
12
12
 
13
- import { translate } from '../../utils/i18n';
13
+ import { sprintf, translate, translatePlural } from '@gitlab/ui/dist/utils/i18n';
14
14
 
15
15
  import {
16
16
  badgeTypes,
@@ -401,6 +401,13 @@ export default {
401
401
  activeThreadTitleForView() {
402
402
  return (this.currentView === VIEW_TYPES.CHAT && this.activeThreadTitle) || '';
403
403
  },
404
+ hasFooterControls() {
405
+ return (
406
+ this.$scopedSlots?.['footer-controls'] &&
407
+ typeof this.$scopedSlots['footer-controls'] === 'function' &&
408
+ this.$scopedSlots['footer-controls']()
409
+ );
410
+ },
404
411
  },
405
412
  watch: {
406
413
  multiThreadedView(newView) {
@@ -671,10 +678,28 @@ export default {
671
678
  document.execCommand('redo');
672
679
  },
673
680
  remainingCharacterCountMessage(count) {
674
- return `${count} characters remaining`;
681
+ return sprintf(
682
+ translatePlural(
683
+ 'WebDuoChat.remainingCharacterCountMessage',
684
+ '%{count} character remaining.',
685
+ '%{count} characters remaining.'
686
+ )(count),
687
+ {
688
+ count,
689
+ }
690
+ );
675
691
  },
676
692
  overLimitCharacterCountMessage(count) {
677
- return `${Math.abs(count)} characters over limit`;
693
+ return sprintf(
694
+ translatePlural(
695
+ 'WebDuoChat.overLimitCharacterCountMessage',
696
+ '%{count} character over limit.',
697
+ '%{count} characters over limit.'
698
+ )(count),
699
+ {
700
+ count,
701
+ }
702
+ );
678
703
  },
679
704
  },
680
705
  i18n,
@@ -784,7 +809,7 @@ export default {
784
809
  </div>
785
810
 
786
811
  <div
787
- class="duo-chat-input gl-min-h-8 gl-max-w-full gl-grow gl-flex-col gl-rounded-bl-[12px] gl-rounded-br-[18px] gl-rounded-tl-[12px] gl-rounded-tr-[12px] gl-align-top"
812
+ class="duo-chat-input web-only gl-relative gl-min-h-8 gl-max-w-full gl-grow gl-flex-col gl-rounded-bl-[12px] gl-rounded-br-[18px] gl-rounded-tl-[12px] gl-rounded-tr-[12px] gl-align-top"
788
813
  >
789
814
  <div
790
815
  class="gl-flex gl-justify-between gl-border-0 gl-border-b-1 gl-border-solid gl-border-strong gl-px-4 gl-py-4"
@@ -792,7 +817,7 @@ export default {
792
817
  <div>{{ $options.i18n.CHAT_MODEL_PLACEHOLDER }}</div>
793
818
  <div><slot name="agentic-switch"></slot></div>
794
819
  </div>
795
- <div class="gl-h-[40px] gl-grow" :data-value="prompt">
820
+ <div class="gl-h-[80px] gl-grow" :data-value="prompt">
796
821
  <gl-card
797
822
  v-if="shouldShowSlashCommands"
798
823
  ref="commands"
@@ -845,25 +870,34 @@ export default {
845
870
  <template #remaining-character-count-text="{ count }">
846
871
  <span
847
872
  v-if="count <= promptLengthWarningCount"
848
- class="gl-absolute gl-bottom-[-25px] gl-right-px gl-pr-3"
873
+ class="gl-absolute gl-bottom-0 gl-bottom-[-1.6rem] gl-right-0 gl-pr-3 gl-text-sm"
874
+ :class="{
875
+ 'gl-bottom-[-5rem]': hasFooterControls,
876
+ 'gl-bottom-[-1.6rem]': !hasFooterControls,
877
+ }"
849
878
  >
850
879
  {{ remainingCharacterCountMessage(count) }}
851
880
  </span>
852
881
  </template>
853
882
  <template #character-count-over-limit-text="{ count }">
854
- <span class="gl-absolute gl-bottom-[-25px] gl-right-px gl-pr-3">{{
855
- overLimitCharacterCountMessage(count)
856
- }}</span>
883
+ <span
884
+ class="gl-absolute gl-bottom-[-1.6rem] gl-right-px gl-pr-3 gl-text-sm"
885
+ :class="{
886
+ 'gl-bottom-[-5rem]': hasFooterControls,
887
+ 'gl-bottom-[-1.6rem]': !hasFooterControls,
888
+ }"
889
+ >{{ overLimitCharacterCountMessage(count) }}</span
890
+ >
857
891
  </template>
858
892
  </gl-form-textarea>
859
893
  </div>
860
- <div class="gl-flex gl-justify-end gl-px-3 gl-pb-3">
894
+ <div class="gl-absolute gl-bottom-0 gl-right-0 gl-px-3 gl-pb-3">
861
895
  <gl-button
862
896
  v-if="displaySubmitButton"
863
897
  icon="paper-airplane"
864
898
  category="primary"
865
899
  variant="confirm"
866
- class="gl-bottom-2 gl-right-2 gl-ml-auto !gl-rounded-full"
900
+ class="!gl-rounded-full"
867
901
  type="submit"
868
902
  data-testid="chat-prompt-submit-button"
869
903
  :disabled="isPromptEmpty"
@@ -874,7 +908,7 @@ export default {
874
908
  icon="stop"
875
909
  category="primary"
876
910
  variant="default"
877
- class="gl-bottom-2 gl-right-2 gl-ml-auto !gl-rounded-full"
911
+ class="!gl-rounded-full"
878
912
  data-testid="chat-prompt-cancel-button"
879
913
  :aria-label="$options.i18n.CHAT_CANCEL_LABEL"
880
914
  @click="cancelPrompt"
@@ -2,6 +2,7 @@
2
2
  @import '@gitlab/ui/src/scss/mixins';
3
3
 
4
4
  @import '../components/chat/duo_chat';
5
+ @import '../components/chat/web_duo_chat';
5
6
  @import '../components/chat/components/duo_chat_loader/duo_chat_loader';
6
7
  @import '../components/chat/components/duo_chat_message/duo_chat_message';
7
8
  @import '../components/ui/duo_recent_collapsible/duo_recent_collapsible';
package/translations.js CHANGED
@@ -35,6 +35,7 @@ export default {
35
35
  'AgenticToolRejectionModal.placeholder': "Explain why you're rejecting this tool execution...",
36
36
  'AgenticToolRejectionModal.submitText': 'Submit Rejection',
37
37
  'AgenticToolRejectionModal.title': 'Provide Rejection Reason',
38
+ 'BaseToolParams.ACCORDION_TITLE': 'Read description',
38
39
  'CreateCommitToolParams.actionWithNoContent': 'This action does not have any content.',
39
40
  'CreateCommitToolParams.actionsCountMessage': null,
40
41
  'CreateCommitToolParams.chmodFileActionLabel': 'Change permissions for file %{filePath}',
@@ -48,12 +49,7 @@ export default {
48
49
  'CreateCommitToolParams.unknownFileActionLabel': 'Modify file %{filePath}',
49
50
  'CreateCommitToolParams.updateFileActionLabel': 'Update file %{filePath}',
50
51
  'CreateIssueToolParams.ACCORDION_TITLE': 'Read description',
51
- 'CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_BASE':
52
- 'Open an issue with title "%{title}" in project %{project}.',
53
- 'CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_WITH_LABELS': 'Assign the labels %{labels}.',
54
- 'CreateMergeRequestToolParams.ACCORDION_TITLE': 'Read description',
55
- 'CreateMergeRequestToolParams.MERGE_REQUEST_SUMMARY_MESSAGE':
56
- 'Open a merge request with title "%{title}" in project %{project} from branch %{sourceBranch} to branch %{targetBranch}.',
52
+ 'CreateIssueToolParams.ASSIGN_LABELS_MESSAGE': 'Assign the labels <code>%{labels}</code>.',
57
53
  'DuoChat.chatBackLabel': 'Back to history',
58
54
  'DuoChat.chatBackToChatToolTip': 'Back to chat',
59
55
  'DuoChat.chatCancelLabel': 'Cancel',
@@ -123,12 +119,28 @@ export default {
123
119
  'DuoRecentCollapsable.viewAllText': 'View All',
124
120
  'GlDuoChat.chatDisclamer': 'Responses may be inaccurate. Verify before use.',
125
121
  'GlDuoChat.chatHistoryTitle': 'Chat history',
122
+ 'IssuableToolParams.BRANCH_MESSAGE':
123
+ 'From branch <code>%{sourceBranch}</code> to branch <code>%{targetBranch}</code>.',
124
+ 'IssuableToolParams.CREATE_EPIC': 'Create an epic in group <code>%{groupId}</code>.',
125
+ 'IssuableToolParams.CREATE_ISSUE': 'Open an issue in project <code>%{project}</code>.',
126
+ 'IssuableToolParams.CREATE_MERGE_REQUEST':
127
+ 'Open a merge request in project <code>%{project}</code>.',
128
+ 'IssuableToolParams.TITLE_MESSAGE': 'Set the title "<em>%{title}</em>".',
129
+ 'IssuableToolParams.UPDATE_EPIC':
130
+ 'Update epic <code>%{epicId}</code> in group <code>%{groupId}</code>.',
131
+ 'IssuableToolParams.UPDATE_ISSUE':
132
+ 'Update issue <code>%{issueIid}</code> in project <code>%{project}</code>.',
133
+ 'IssuableToolParams.UPDATE_MERGE_REQUEST':
134
+ 'Update merge request <code>%{mergeRequestIid}</code> in project <code>%{project}</code>.',
126
135
  'MessageToolApproval.approveAllText': 'Always approve this tool',
127
136
  'MessageToolApproval.approveSessionText': 'Approve for session',
128
137
  'MessageToolApproval.approveText': 'Approve',
129
138
  'MessageToolApproval.approvingText': 'Approving...',
130
139
  'MessageToolApproval.cancelText': 'Cancel',
140
+ 'MessageToolApproval.collapseButtonCollapsed': 'Display tool details',
141
+ 'MessageToolApproval.collapseButtonExpanded': 'Hide tool details',
131
142
  'MessageToolApproval.createCommit': 'Duo wants to push a commit.',
143
+ 'MessageToolApproval.createEpic': 'Duo wants to create an epic.',
132
144
  'MessageToolApproval.createIssue': 'Duo wants to open an issue.',
133
145
  'MessageToolApproval.createMergeRequest': 'Duo wants to create a merge request.',
134
146
  'MessageToolApproval.denialReasonLabel': 'Rejection reason',
@@ -139,11 +151,16 @@ export default {
139
151
  'MessageToolApproval.noParametersText': 'No parameters will be sent with this request.',
140
152
  'MessageToolApproval.parametersText': 'Request',
141
153
  'MessageToolApproval.runCommand': 'Duo wants to run a command.',
154
+ 'MessageToolApproval.runGitCommand': 'Duo wants to run a git command.',
142
155
  'MessageToolApproval.toolApprovalDescription':
143
156
  'GitLab Duo Agentic Chat wants to execute a tool. Do you want to proceed?',
144
157
  'MessageToolApproval.toolLabel': 'Tool:',
145
- 'MessageToolApproval.toolStatus': 'Pending',
158
+ 'MessageToolApproval.toolStatusApproved': 'Approved',
159
+ 'MessageToolApproval.toolStatusPending': 'Pending',
146
160
  'MessageToolApproval.toolUnknown': 'Unknown',
161
+ 'MessageToolApproval.updateEpic': 'Duo wants to update an epic.',
162
+ 'MessageToolApproval.updateIssue': 'Duo wants to update an issue.',
163
+ 'RunCommandToolParams.ACCORDION_TITLE': 'Expand command output',
147
164
  'WebAgenticDuoChat.chatCancelLabel': 'Cancel',
148
165
  'WebAgenticDuoChat.chatDefaultPredefinedPromptsChangePassword':
149
166
  'How do I change my password in GitLab?',
@@ -186,4 +203,6 @@ export default {
186
203
  'WebDuoChat.copySessionIdFailedToast': 'Could not copy session ID',
187
204
  'WebDuoChat.copySessionIdSuccessToast': 'Session ID copied to clipboard',
188
205
  'WebDuoChat.copySessionIdTooltip': 'Copy session ID',
206
+ 'WebDuoChat.overLimitCharacterCountMessage': null,
207
+ 'WebDuoChat.remainingCharacterCountMessage': null,
189
208
  };
@@ -1,88 +0,0 @@
1
- import { GlSprintf, GlAccordion, GlAccordionItem } from '@gitlab/ui';
2
- import { translate } from '../../../../../utils/i18n';
3
- import PreBlock from './pre_block';
4
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
5
-
6
- var script = {
7
- name: 'CreateIssueToolParams',
8
- components: {
9
- GlSprintf,
10
- GlAccordion,
11
- GlAccordionItem,
12
- PreBlock
13
- },
14
- props: {
15
- projectId: {
16
- type: [String, Number],
17
- required: true
18
- },
19
- projectPath: {
20
- type: String,
21
- required: false,
22
- default: ''
23
- },
24
- title: {
25
- type: String,
26
- required: true
27
- },
28
- description: {
29
- type: String,
30
- required: true
31
- },
32
- labels: {
33
- type: String,
34
- required: false,
35
- default: ''
36
- }
37
- },
38
- computed: {
39
- issueMessage() {
40
- const baseMessage = this.$options.i18n.ISSUE_SUMMARY_MESSAGE_BASE;
41
- const labelsMessage = this.$options.i18n.ISSUE_SUMMARY_MESSAGE_WITH_LABELS;
42
- return this.labels ? `${baseMessage} ${labelsMessage}` : baseMessage;
43
- }
44
- },
45
- i18n: {
46
- ISSUE_SUMMARY_MESSAGE_BASE: translate('CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_BASE', 'Open an issue with title "%{title}" in project %{project}.'),
47
- ISSUE_SUMMARY_MESSAGE_WITH_LABELS: translate('CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_WITH_LABELS', 'Assign the labels %{labels}.'),
48
- ACCORDION_TITLE: translate('CreateIssueToolParams.ACCORDION_TITLE', 'Read description')
49
- }
50
- };
51
-
52
- /* script */
53
- const __vue_script__ = script;
54
-
55
- /* template */
56
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-flex-col"},[_c('div',[_c('gl-sprintf',{attrs:{"message":_vm.issueMessage},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('em',[_vm._v(_vm._s(_vm.title))])]},proxy:true},{key:"project",fn:function(){return [_c('code',[_vm._v(_vm._s(_vm.projectPath || _vm.projectId))])]},proxy:true},{key:"labels",fn:function(){return [_c('code',[_vm._v(_vm._s(_vm.labels))])]},proxy:true}])})],1),_vm._v(" "),_c('gl-accordion',{staticClass:"-gl-ml-2 gl-mt-3",attrs:{"header-level":3}},[_c('gl-accordion-item',{attrs:{"title":_vm.$options.i18n.ACCORDION_TITLE}},[_c('pre-block',[_vm._v(_vm._s(_vm.description))])],1)],1)],1)};
57
- var __vue_staticRenderFns__ = [];
58
-
59
- /* style */
60
- const __vue_inject_styles__ = undefined;
61
- /* scoped */
62
- const __vue_scope_id__ = undefined;
63
- /* module identifier */
64
- const __vue_module_identifier__ = undefined;
65
- /* functional template */
66
- const __vue_is_functional_template__ = false;
67
- /* style inject */
68
-
69
- /* style inject SSR */
70
-
71
- /* style inject shadow dom */
72
-
73
-
74
-
75
- const __vue_component__ = __vue_normalize__(
76
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
77
- __vue_inject_styles__,
78
- __vue_script__,
79
- __vue_scope_id__,
80
- __vue_is_functional_template__,
81
- __vue_module_identifier__,
82
- false,
83
- undefined,
84
- undefined,
85
- undefined
86
- );
87
-
88
- export default __vue_component__;
@@ -1,83 +0,0 @@
1
- import { GlSprintf, GlAccordion, GlAccordionItem } from '@gitlab/ui';
2
- import { translate } from '../../../../../utils/i18n';
3
- import PreBlock from './pre_block';
4
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
5
-
6
- var script = {
7
- name: 'CreateMergeRequestToolParams',
8
- components: {
9
- GlSprintf,
10
- GlAccordion,
11
- GlAccordionItem,
12
- PreBlock
13
- },
14
- props: {
15
- projectId: {
16
- type: [String, Number],
17
- required: true
18
- },
19
- projectPath: {
20
- type: String,
21
- required: false,
22
- default: ''
23
- },
24
- title: {
25
- type: String,
26
- required: true
27
- },
28
- sourceBranch: {
29
- type: String,
30
- required: true
31
- },
32
- targetBranch: {
33
- type: String,
34
- required: true
35
- },
36
- description: {
37
- type: String,
38
- required: true
39
- }
40
- },
41
- i18n: {
42
- MERGE_REQUEST_SUMMARY_MESSAGE: translate('CreateMergeRequestToolParams.MERGE_REQUEST_SUMMARY_MESSAGE', 'Open a merge request with title "%{title}" in project %{project} from branch %{sourceBranch} to branch %{targetBranch}.'),
43
- ACCORDION_TITLE: translate('CreateMergeRequestToolParams.ACCORDION_TITLE', 'Read description')
44
- }
45
- };
46
-
47
- /* script */
48
- const __vue_script__ = script;
49
-
50
- /* template */
51
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-flex gl-flex-col"},[_c('div',[_c('gl-sprintf',{attrs:{"message":_vm.$options.i18n.MERGE_REQUEST_SUMMARY_MESSAGE},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('em',[_vm._v(_vm._s(_vm.title))])]},proxy:true},{key:"project",fn:function(){return [_c('code',[_vm._v(_vm._s(_vm.projectPath || _vm.projectId))])]},proxy:true},{key:"sourceBranch",fn:function(){return [_c('code',[_vm._v(_vm._s(_vm.sourceBranch))])]},proxy:true},{key:"targetBranch",fn:function(){return [_c('code',[_vm._v(_vm._s(_vm.targetBranch))])]},proxy:true}])})],1),_vm._v(" "),_c('gl-accordion',{staticClass:"-gl-ml-2 gl-mt-3",attrs:{"header-level":3}},[_c('gl-accordion-item',{attrs:{"title":_vm.$options.i18n.ACCORDION_TITLE}},[_c('pre-block',[_vm._v(_vm._s(_vm.description))])],1)],1)],1)};
52
- var __vue_staticRenderFns__ = [];
53
-
54
- /* style */
55
- const __vue_inject_styles__ = undefined;
56
- /* scoped */
57
- const __vue_scope_id__ = undefined;
58
- /* module identifier */
59
- const __vue_module_identifier__ = undefined;
60
- /* functional template */
61
- const __vue_is_functional_template__ = false;
62
- /* style inject */
63
-
64
- /* style inject SSR */
65
-
66
- /* style inject shadow dom */
67
-
68
-
69
-
70
- const __vue_component__ = __vue_normalize__(
71
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
72
- __vue_inject_styles__,
73
- __vue_script__,
74
- __vue_scope_id__,
75
- __vue_is_functional_template__,
76
- __vue_module_identifier__,
77
- false,
78
- undefined,
79
- undefined,
80
- undefined
81
- );
82
-
83
- export default __vue_component__;
@@ -1,80 +0,0 @@
1
- <script>
2
- import { GlSprintf, GlAccordion, GlAccordionItem } from '@gitlab/ui';
3
- import { translate } from '../../../../../utils/i18n';
4
- import PreBlock from './pre_block.vue';
5
-
6
- export default {
7
- name: 'CreateIssueToolParams',
8
- components: {
9
- GlSprintf,
10
- GlAccordion,
11
- GlAccordionItem,
12
- PreBlock,
13
- },
14
- props: {
15
- projectId: {
16
- type: [String, Number],
17
- required: true,
18
- },
19
- projectPath: {
20
- type: String,
21
- required: false,
22
- default: '',
23
- },
24
- title: {
25
- type: String,
26
- required: true,
27
- },
28
- description: {
29
- type: String,
30
- required: true,
31
- },
32
- labels: {
33
- type: String,
34
- required: false,
35
- default: '',
36
- },
37
- },
38
- computed: {
39
- issueMessage() {
40
- const baseMessage = this.$options.i18n.ISSUE_SUMMARY_MESSAGE_BASE;
41
- const labelsMessage = this.$options.i18n.ISSUE_SUMMARY_MESSAGE_WITH_LABELS;
42
-
43
- return this.labels ? `${baseMessage} ${labelsMessage}` : baseMessage;
44
- },
45
- },
46
- i18n: {
47
- ISSUE_SUMMARY_MESSAGE_BASE: translate(
48
- 'CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_BASE',
49
- 'Open an issue with title "%{title}" in project %{project}.'
50
- ),
51
- ISSUE_SUMMARY_MESSAGE_WITH_LABELS: translate(
52
- 'CreateIssueToolParams.ISSUE_SUMMARY_MESSAGE_WITH_LABELS',
53
- 'Assign the labels %{labels}.'
54
- ),
55
- ACCORDION_TITLE: translate('CreateIssueToolParams.ACCORDION_TITLE', 'Read description'),
56
- },
57
- };
58
- </script>
59
- <template>
60
- <div class="gl-flex gl-flex-col">
61
- <div>
62
- <gl-sprintf :message="issueMessage">
63
- <template #title>
64
- <em>{{ title }}</em>
65
- </template>
66
- <template #project>
67
- <code>{{ projectPath || projectId }}</code>
68
- </template>
69
- <template #labels>
70
- <code>{{ labels }}</code>
71
- </template>
72
- </gl-sprintf>
73
- </div>
74
- <gl-accordion class="-gl-ml-2 gl-mt-3" :header-level="3">
75
- <gl-accordion-item :title="$options.i18n.ACCORDION_TITLE">
76
- <pre-block>{{ description }}</pre-block>
77
- </gl-accordion-item>
78
- </gl-accordion>
79
- </div>
80
- </template>
@@ -1,74 +0,0 @@
1
- <script>
2
- import { GlSprintf, GlAccordion, GlAccordionItem } from '@gitlab/ui';
3
- import { translate } from '../../../../../utils/i18n';
4
- import PreBlock from './pre_block.vue';
5
-
6
- export default {
7
- name: 'CreateMergeRequestToolParams',
8
- components: {
9
- GlSprintf,
10
- GlAccordion,
11
- GlAccordionItem,
12
- PreBlock,
13
- },
14
- props: {
15
- projectId: {
16
- type: [String, Number],
17
- required: true,
18
- },
19
- projectPath: {
20
- type: String,
21
- required: false,
22
- default: '',
23
- },
24
- title: {
25
- type: String,
26
- required: true,
27
- },
28
- sourceBranch: {
29
- type: String,
30
- required: true,
31
- },
32
- targetBranch: {
33
- type: String,
34
- required: true,
35
- },
36
- description: {
37
- type: String,
38
- required: true,
39
- },
40
- },
41
- i18n: {
42
- MERGE_REQUEST_SUMMARY_MESSAGE: translate(
43
- 'CreateMergeRequestToolParams.MERGE_REQUEST_SUMMARY_MESSAGE',
44
- 'Open a merge request with title "%{title}" in project %{project} from branch %{sourceBranch} to branch %{targetBranch}.'
45
- ),
46
- ACCORDION_TITLE: translate('CreateMergeRequestToolParams.ACCORDION_TITLE', 'Read description'),
47
- },
48
- };
49
- </script>
50
- <template>
51
- <div class="gl-flex gl-flex-col">
52
- <div>
53
- <gl-sprintf :message="$options.i18n.MERGE_REQUEST_SUMMARY_MESSAGE">
54
- <template #title>
55
- <em>{{ title }}</em>
56
- </template>
57
- <template #project>
58
- <code>{{ projectPath || projectId }}</code>
59
- </template>
60
- <template #sourceBranch>
61
- <code>{{ sourceBranch }}</code>
62
- </template>
63
- <template #targetBranch>
64
- <code>{{ targetBranch }}</code>
65
- </template>
66
- </gl-sprintf>
67
- </div>
68
- <gl-accordion class="-gl-ml-2 gl-mt-3" :header-level="3">
69
- <gl-accordion-item :title="$options.i18n.ACCORDION_TITLE">
70
- <pre-block>{{ description }}</pre-block>
71
- </gl-accordion-item>
72
- </gl-accordion>
73
- </div>
74
- </template>