@gitlab/ui 104.1.2 → 105.0.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.
- package/CHANGELOG.md +20 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +0 -5
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +1 -3
- package/src/index.js +0 -5
- package/src/scss/components.scss +0 -3
- package/src/scss/typography.scss +14 -1
- package/src/vendor/bootstrap/scss/_reboot.scss +0 -31
- package/translations.js +0 -57
- package/dist/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +0 -159
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +0 -273
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.js +0 -77
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.js +0 -89
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.js +0 -147
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.js +0 -61
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.js +0 -137
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.js +0 -163
- package/dist/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -308
- package/dist/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -140
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +0 -109
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +0 -111
- package/dist/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -33
- package/dist/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -14
- package/dist/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +0 -300
- package/dist/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -56
- package/dist/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -17
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +0 -115
- package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +0 -72
- package/dist/components/experimental/duo/chat/constants.js +0 -35
- package/dist/components/experimental/duo/chat/duo_chat.js +0 -553
- package/dist/components/experimental/duo/chat/markdown_renderer.js +0 -25
- package/dist/components/experimental/duo/chat/mock_data.js +0 -170
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +0 -106
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +0 -154
- package/dist/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.js +0 -106
- package/dist/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.js +0 -246
- package/src/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +0 -182
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.md +0 -44
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +0 -288
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.vue +0 -54
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.vue +0 -86
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +0 -168
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.vue +0 -43
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +0 -170
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +0 -196
- package/src/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -362
- package/src/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -169
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +0 -27
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +0 -99
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +0 -44
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +0 -112
- package/src/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -39
- package/src/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -12
- package/src/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.md +0 -69
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +0 -105
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +0 -363
- package/src/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -51
- package/src/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -18
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +0 -91
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +0 -45
- package/src/components/experimental/duo/chat/constants.js +0 -37
- package/src/components/experimental/duo/chat/duo_chat.md +0 -202
- package/src/components/experimental/duo/chat/duo_chat.scss +0 -413
- package/src/components/experimental/duo/chat/duo_chat.vue +0 -751
- package/src/components/experimental/duo/chat/markdown_renderer.js +0 -29
- package/src/components/experimental/duo/chat/mock_data.js +0 -187
- package/src/components/experimental/duo/chat/variables.scss +0 -9
- package/src/components/experimental/duo/user_feedback/user_feedback.md +0 -90
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +0 -95
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +0 -167
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +0 -42
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +0 -96
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +0 -46
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +0 -270
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
|
|
4
|
-
*
|
|
5
|
-
* Please use the corresponding component in Duo-UI going forward.
|
|
6
|
-
* All future development and maintenance for Duo components should take place in Duo-UI.
|
|
7
|
-
*
|
|
8
|
-
* For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import GlIcon from '../../../../../base/icon/icon.vue';
|
|
12
|
-
import GlCollapse from '../../../../../base/collapse/collapse.vue';
|
|
13
|
-
import GlButton from '../../../../../base/button/button.vue';
|
|
14
|
-
import { GlTooltipDirective as GlTooltip } from '../../../../../../directives/tooltip';
|
|
15
|
-
import { translate } from '../../../../../../utils/i18n';
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: 'GlDuoWorkflowPanel',
|
|
19
|
-
components: { GlCollapse, GlButton, GlIcon },
|
|
20
|
-
directives: { GlTooltip },
|
|
21
|
-
props: {
|
|
22
|
-
/**
|
|
23
|
-
* The icon to show in the header.
|
|
24
|
-
*/
|
|
25
|
-
headerIcon: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: false,
|
|
28
|
-
default: '',
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* The text used as the title and aria-label for the button when the collapse is collapsed
|
|
32
|
-
*/
|
|
33
|
-
expandPanelButtonTitle: {
|
|
34
|
-
type: String,
|
|
35
|
-
required: false,
|
|
36
|
-
default: translate('GlDuoWorkflowPanel.expandButtonTitle', 'Expand'),
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* The text used as the title and aria-label for the button when the collapse is expanded
|
|
40
|
-
*/
|
|
41
|
-
collapsePanelButtonTitle: {
|
|
42
|
-
type: String,
|
|
43
|
-
required: false,
|
|
44
|
-
default: translate('GlDuoWorkflowPanel.collapseButtonTitle', 'Collapse'),
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Whether the panel is expanded or not
|
|
48
|
-
*/
|
|
49
|
-
expanded: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
required: false,
|
|
52
|
-
default: true,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
computed: {
|
|
56
|
-
buttonIcon() {
|
|
57
|
-
return this.expanded ? 'chevron-up' : 'chevron-down';
|
|
58
|
-
},
|
|
59
|
-
buttonTitle() {
|
|
60
|
-
return this.expanded ? this.collapsePanelButtonTitle : this.expandPanelButtonTitle;
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
</script>
|
|
65
|
-
<template>
|
|
66
|
-
<div>
|
|
67
|
-
<div class="gl-flex gl-flex-nowrap gl-items-center">
|
|
68
|
-
<gl-icon v-if="headerIcon" :name="headerIcon" :size="24" class="gl-mr-3" />
|
|
69
|
-
<div class="gl-flex gl-flex-grow gl-items-baseline">
|
|
70
|
-
<h2 class="gl-mb-0">
|
|
71
|
-
<!-- @slot Panel title. -->
|
|
72
|
-
<slot name="title"></slot>
|
|
73
|
-
</h2>
|
|
74
|
-
<small class="gl-ml-3">
|
|
75
|
-
<!-- @slot Panel subtitle. -->
|
|
76
|
-
<slot name="subtitle"></slot
|
|
77
|
-
></small>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<gl-button
|
|
81
|
-
v-gl-tooltip
|
|
82
|
-
category="tertiary"
|
|
83
|
-
:icon="buttonIcon"
|
|
84
|
-
:title="buttonTitle"
|
|
85
|
-
:aria-label="buttonTitle"
|
|
86
|
-
@click="$emit('toggle-panel')"
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
<gl-collapse :visible="expanded">
|
|
90
|
-
<div class="gl-ml-7 gl-mt-4 gl-flex-grow">
|
|
91
|
-
<!-- @slot Panel content. -->
|
|
92
|
-
<slot name="content"></slot>
|
|
93
|
-
</div>
|
|
94
|
-
</gl-collapse>
|
|
95
|
-
</div>
|
|
96
|
-
</template>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
|
|
3
|
-
|
|
4
|
-
Please use the corresponding component in Duo-UI going forward.
|
|
5
|
-
All future development and maintenance for Duo components should take place in Duo-UI.
|
|
6
|
-
|
|
7
|
-
For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
|
|
8
|
-
-->
|
|
9
|
-
|
|
10
|
-
This is the UI panel to capture the user's AI prompt for Duo Workflow. This
|
|
11
|
-
prompt is emitted upwards so it may be sent to the Duo Workflow service.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
To use this component, import it and be sure to set the following props:
|
|
16
|
-
|
|
17
|
-
* `prompt`: the prompt the user enters, can be provided if the prompt has been
|
|
18
|
-
cached
|
|
19
|
-
* `summary`: the summary of the goal as provided by the Duo Workflow service,
|
|
20
|
-
displayed adjacent to the title
|
|
21
|
-
* `loading`: sets the loading state for the panel while waiting on responses
|
|
22
|
-
|
|
23
|
-
Also listen to the following events:
|
|
24
|
-
|
|
25
|
-
* `update:prompt`: Emitted when the prompt textarea's `input` event fires, when
|
|
26
|
-
the text within the textarea is changed
|
|
27
|
-
* `update:image`: Emitted when the image input's `input` event fires, when the
|
|
28
|
-
text within the input is changed
|
|
29
|
-
* `confirm`: Emitted when the confirm button is clicked
|
|
30
|
-
* `cancel`: Emitted when the cancel button is clicked
|
|
31
|
-
|
|
32
|
-
Translations for the title of the panel, labels, and other strings can be set via
|
|
33
|
-
the props as documented or via translation configuration:
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
setConfigs({
|
|
37
|
-
translations: {
|
|
38
|
-
'GlDuoWorkflowPrompt.header': __('Plan'),
|
|
39
|
-
'GlDuoWorkflowPrompt.promptLabel': __('Prompt'),
|
|
40
|
-
'GlDuoWorkflowPrompt.promptLabelDescription': __('What is your task?'),
|
|
41
|
-
'GlDuoWorkflowPrompt.promptDescription': __('Be specific and include references!'),
|
|
42
|
-
'GlDuoWorkflowPrompt.confirmButtonText': __('Start plan'),
|
|
43
|
-
'GlDuoWorkflowPrompt.cancelButtonText': __('Stop'),
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
```
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
|
|
4
|
-
*
|
|
5
|
-
* Please use the corresponding component in Duo-UI going forward.
|
|
6
|
-
* All future development and maintenance for Duo components should take place in Duo-UI.
|
|
7
|
-
*
|
|
8
|
-
* For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import GlDuoWorkflowPanel from '../duo_workflow_panel/duo_workflow_panel.vue';
|
|
12
|
-
import GlButton from '../../../../../base/button/button.vue';
|
|
13
|
-
import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
|
|
14
|
-
import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea.vue';
|
|
15
|
-
import GlFormInput from '../../../../../base/form/form_input/form_input.vue';
|
|
16
|
-
import { translate } from '../../../../../../utils/i18n';
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
name: 'GlDuoWorkflowPrompt',
|
|
20
|
-
components: {
|
|
21
|
-
GlDuoWorkflowPanel,
|
|
22
|
-
GlButton,
|
|
23
|
-
GlFormGroup,
|
|
24
|
-
GlFormInput,
|
|
25
|
-
GlFormTextarea,
|
|
26
|
-
},
|
|
27
|
-
props: {
|
|
28
|
-
/**
|
|
29
|
-
* The prompt the user has entered
|
|
30
|
-
*/
|
|
31
|
-
prompt: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: false,
|
|
34
|
-
default: '',
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* The image to run the workflow in
|
|
38
|
-
*/
|
|
39
|
-
image: {
|
|
40
|
-
type: String,
|
|
41
|
-
required: false,
|
|
42
|
-
default: '',
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* The text for the title of the panel
|
|
46
|
-
*/
|
|
47
|
-
title: {
|
|
48
|
-
type: String,
|
|
49
|
-
required: false,
|
|
50
|
-
default: translate('GlDuoWorkflowPrompt.title', 'Goal'),
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* The summary of the ongoing workflow plan
|
|
54
|
-
*/
|
|
55
|
-
summary: {
|
|
56
|
-
type: String,
|
|
57
|
-
required: false,
|
|
58
|
-
default: '',
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* Whether or not the panel is loading
|
|
62
|
-
*/
|
|
63
|
-
loading: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
required: false,
|
|
66
|
-
default: false,
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* The label of the prompt text area
|
|
70
|
-
*
|
|
71
|
-
* See `GlFormGroup` for text placement.
|
|
72
|
-
*/
|
|
73
|
-
promptLabel: {
|
|
74
|
-
type: String,
|
|
75
|
-
required: false,
|
|
76
|
-
default: translate('GlDuoWorkflowPrompt.promptLabel', 'Description'),
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* The label description of the prompt text area
|
|
80
|
-
*
|
|
81
|
-
* See `GlFormGroup` for text placement.
|
|
82
|
-
*/
|
|
83
|
-
promptLabelDescription: {
|
|
84
|
-
type: String,
|
|
85
|
-
required: false,
|
|
86
|
-
default: translate(
|
|
87
|
-
'GlDuoWorkflowPrompt.promptLabelDescription',
|
|
88
|
-
'What would you like to do and how.'
|
|
89
|
-
),
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* The description of the prompt text area
|
|
93
|
-
*
|
|
94
|
-
* See `GlFormGroup` for text placement.
|
|
95
|
-
*/
|
|
96
|
-
promptDescription: {
|
|
97
|
-
type: String,
|
|
98
|
-
required: false,
|
|
99
|
-
default: translate(
|
|
100
|
-
'GlDuoWorkflowPrompt.promptDescription',
|
|
101
|
-
'Be specific and include any requirements.'
|
|
102
|
-
),
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The HTML ID of the textarea for the prompt
|
|
107
|
-
*/
|
|
108
|
-
promptId: {
|
|
109
|
-
type: String,
|
|
110
|
-
required: false,
|
|
111
|
-
default: 'duo-workflow-prompt',
|
|
112
|
-
},
|
|
113
|
-
/**
|
|
114
|
-
* The label of the image input
|
|
115
|
-
*/
|
|
116
|
-
imageLabel: {
|
|
117
|
-
type: String,
|
|
118
|
-
required: false,
|
|
119
|
-
default: translate('GlDuoWorkflowPrompt.imageLabel', 'Image'),
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* The label description of the image input
|
|
123
|
-
*
|
|
124
|
-
* See `GlFormGroup` for text placement.
|
|
125
|
-
*/
|
|
126
|
-
imageLabelDescription: {
|
|
127
|
-
type: String,
|
|
128
|
-
required: false,
|
|
129
|
-
default: translate(
|
|
130
|
-
'GlDuoWorkflowPrompt.imageLabelDescription',
|
|
131
|
-
'The container image to run the workflow in.'
|
|
132
|
-
),
|
|
133
|
-
},
|
|
134
|
-
/**
|
|
135
|
-
* The description of the image input
|
|
136
|
-
*
|
|
137
|
-
* See `GlFormGroup` for text placement.
|
|
138
|
-
*/
|
|
139
|
-
imageDescription: {
|
|
140
|
-
type: String,
|
|
141
|
-
required: false,
|
|
142
|
-
default: translate(
|
|
143
|
-
'GlDuoWorkflowPrompt.imageDescription',
|
|
144
|
-
'It should have any tools necessary for the workflow installed.'
|
|
145
|
-
),
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* The ID of the image input
|
|
149
|
-
*/
|
|
150
|
-
imageId: {
|
|
151
|
-
type: String,
|
|
152
|
-
required: false,
|
|
153
|
-
default: 'duo-workflow-image',
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* The text for the confirmation button. This button emits a `confirm` event.
|
|
157
|
-
*/
|
|
158
|
-
confirmButtonText: {
|
|
159
|
-
type: String,
|
|
160
|
-
required: false,
|
|
161
|
-
default: translate('GlDuoWorkflowPrompt.confirmButtonText', 'Generate plan'),
|
|
162
|
-
},
|
|
163
|
-
/**
|
|
164
|
-
* The text for the cancellation button. This button emits a `cancel` event.
|
|
165
|
-
*/
|
|
166
|
-
cancelButtonText: {
|
|
167
|
-
type: String,
|
|
168
|
-
required: false,
|
|
169
|
-
default: translate('GlDuoWorkflowPrompt.cancelButtonText', 'Cancel'),
|
|
170
|
-
},
|
|
171
|
-
/**
|
|
172
|
-
* The text used as the title and aria-label for the button when the collapse is collapsed
|
|
173
|
-
*
|
|
174
|
-
* See `GlDuoWorkflowPanel`
|
|
175
|
-
*/
|
|
176
|
-
expandPanelButtonTitle: {
|
|
177
|
-
type: String,
|
|
178
|
-
required: false,
|
|
179
|
-
default: '',
|
|
180
|
-
},
|
|
181
|
-
/**
|
|
182
|
-
* The text used as the title and aria-label for the button when the collapse is expanded
|
|
183
|
-
*
|
|
184
|
-
* See `GlDuoWorkflowPanel`
|
|
185
|
-
*/
|
|
186
|
-
collapsePanelButtonTitle: {
|
|
187
|
-
type: String,
|
|
188
|
-
required: false,
|
|
189
|
-
default: '',
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
methods: {
|
|
193
|
-
emitChange(prompt) {
|
|
194
|
-
/**
|
|
195
|
-
* Notify listeners about prompt change
|
|
196
|
-
* @param {string} prompt The newly entered prompt
|
|
197
|
-
*/
|
|
198
|
-
this.$emit('update:prompt', prompt);
|
|
199
|
-
},
|
|
200
|
-
emitImage(image) {
|
|
201
|
-
/**
|
|
202
|
-
* Notify listeners about image change
|
|
203
|
-
* @param {string} image The newly entered image
|
|
204
|
-
*/
|
|
205
|
-
this.$emit('update:image', image);
|
|
206
|
-
},
|
|
207
|
-
clickConfirm(event) {
|
|
208
|
-
/**
|
|
209
|
-
* Notify listeners about prompt submission
|
|
210
|
-
* @param {*} event A click event
|
|
211
|
-
*/
|
|
212
|
-
this.$emit('confirm', event);
|
|
213
|
-
},
|
|
214
|
-
clickCancel(event) {
|
|
215
|
-
/**
|
|
216
|
-
* Notify listeners about prompt submission cancellation.
|
|
217
|
-
* @param {*} event A click event
|
|
218
|
-
*/
|
|
219
|
-
this.$emit('cancel', event);
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
</script>
|
|
224
|
-
|
|
225
|
-
<template>
|
|
226
|
-
<gl-duo-workflow-panel
|
|
227
|
-
header-icon="issue-type-objective"
|
|
228
|
-
:expand-panel-button-title="expandPanelButtonTitle"
|
|
229
|
-
:collapse-panel-button-title="collapsePanelButtonTitle"
|
|
230
|
-
>
|
|
231
|
-
<template #title>{{ title }}</template>
|
|
232
|
-
<template #subtitle>{{ summary }}</template>
|
|
233
|
-
<template #content>
|
|
234
|
-
<gl-form-group
|
|
235
|
-
:label="promptLabel"
|
|
236
|
-
:label-for="promptId"
|
|
237
|
-
:label-description="promptLabelDescription"
|
|
238
|
-
:description="promptDescription"
|
|
239
|
-
>
|
|
240
|
-
<gl-form-textarea
|
|
241
|
-
:id="promptId"
|
|
242
|
-
:value="prompt"
|
|
243
|
-
:disable="loading"
|
|
244
|
-
:no-resize="false"
|
|
245
|
-
@input="emitChange"
|
|
246
|
-
/>
|
|
247
|
-
</gl-form-group>
|
|
248
|
-
<gl-form-group
|
|
249
|
-
:label="imageLabel"
|
|
250
|
-
:label-for="imageId"
|
|
251
|
-
:label-description="imageLabelDescription"
|
|
252
|
-
:description="imageDescription"
|
|
253
|
-
>
|
|
254
|
-
<gl-form-input :id="imageId" :value="image" :disable="loading" @input="emitImage" />
|
|
255
|
-
</gl-form-group>
|
|
256
|
-
<div class="gl-flex gl-gap-3">
|
|
257
|
-
<gl-button
|
|
258
|
-
variant="confirm"
|
|
259
|
-
data-test-id="duo-workflow-prompt-confirm"
|
|
260
|
-
:loading="loading"
|
|
261
|
-
@click="clickConfirm"
|
|
262
|
-
>{{ confirmButtonText }}</gl-button
|
|
263
|
-
>
|
|
264
|
-
<gl-button data-test-id="duo-workflow-prompt-cancel" @click="clickCancel">{{
|
|
265
|
-
cancelButtonText
|
|
266
|
-
}}</gl-button>
|
|
267
|
-
</div>
|
|
268
|
-
</template>
|
|
269
|
-
</gl-duo-workflow-panel>
|
|
270
|
-
</template>
|