@gitlab/ui 66.29.0 → 66.31.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 +14 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +7 -2
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +81 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +1 -1
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +2 -1
- package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +1 -1
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +1 -1
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +4 -1
- package/dist/components/experimental/experiment_badge/experiment_badge.js +3 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +2 -2
- package/src/components/base/dropdown/dropdown.md +3 -3
- package/src/components/base/dropdown/dropdown.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_item.stories.js +1 -1
- package/src/components/base/infinite_scroll/infinite_scroll.md +3 -1
- package/src/components/base/infinite_scroll/infinite_scroll.spec.js +2 -2
- package/src/components/base/infinite_scroll/infinite_scroll.vue +5 -2
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +1 -1
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +1 -1
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +8 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.spec.js +46 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.stories.js +59 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +67 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +1 -1
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +2 -1
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +1 -1
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +1 -1
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +4 -1
- package/src/components/experimental/experiment_badge/experiment_badge.vue +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [66.31.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.30.0...v66.31.0) (2023-10-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **InfiniteScroll:** Add support for scrolling behavior ([ca91a07](https://gitlab.com/gitlab-org/gitlab-ui/commit/ca91a07706107652d4b659e8bece8b5bfea31d89))
|
|
7
|
+
|
|
8
|
+
# [66.30.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.29.0...v66.30.0) (2023-10-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlDuoChatConversation:** added component ([68017ef](https://gitlab.com/gitlab-org/gitlab-ui/commit/68017ef7707a5984e41fb93d2fd25cd53ab5e323))
|
|
14
|
+
|
|
1
15
|
# [66.29.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.28.0...v66.29.0) (2023-10-12)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -115,13 +115,18 @@ var script = {
|
|
|
115
115
|
*
|
|
116
116
|
* @param params.top - Number of pixels along Y axis to
|
|
117
117
|
* scroll the list container.
|
|
118
|
+
* @param params.behavior - Determines whether scrolling
|
|
119
|
+
* is instant or animates smoothly. Can be 'auto', 'instant', or 'smooth'
|
|
120
|
+
* See [MDN spec](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo)
|
|
118
121
|
*/
|
|
119
122
|
scrollTo(_ref) {
|
|
120
123
|
let {
|
|
121
|
-
top
|
|
124
|
+
top,
|
|
125
|
+
behavior
|
|
122
126
|
} = _ref;
|
|
123
127
|
this.$refs.infiniteContainer.scrollTo({
|
|
124
|
-
top
|
|
128
|
+
top,
|
|
129
|
+
behavior
|
|
125
130
|
});
|
|
126
131
|
},
|
|
127
132
|
topReached: throttle(function topReachedThrottled() {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import GlDuoChatMessage from '../duo_chat_message/duo_chat_message';
|
|
2
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
+
|
|
4
|
+
const i18n = {
|
|
5
|
+
CONVERSATION_NEW_CHAT: 'New chat'
|
|
6
|
+
};
|
|
7
|
+
const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
|
|
8
|
+
const itemsValidator = items => items.every(isMessage);
|
|
9
|
+
var script = {
|
|
10
|
+
name: 'GlDuoChatConversation',
|
|
11
|
+
components: {
|
|
12
|
+
GlDuoChatMessage
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
/**
|
|
16
|
+
* Messages to display
|
|
17
|
+
*/
|
|
18
|
+
messages: {
|
|
19
|
+
type: Array,
|
|
20
|
+
required: false,
|
|
21
|
+
default: () => [],
|
|
22
|
+
validator: itemsValidator
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Whether to show the delimiter before this conversation
|
|
26
|
+
*/
|
|
27
|
+
showDelimiter: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: false,
|
|
30
|
+
default: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
onTrackFeedback(event) {
|
|
35
|
+
/**
|
|
36
|
+
* Notify listeners about the feedback form submission on a response message.
|
|
37
|
+
* @param {*} event An event, containing the feedback choices and the extended feedback text.
|
|
38
|
+
*/
|
|
39
|
+
this.$emit('track-feedback', event);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
i18n
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/* script */
|
|
46
|
+
const __vue_script__ = script;
|
|
47
|
+
|
|
48
|
+
/* template */
|
|
49
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-display-flex gl-flex-direction-column gl-justify-content-end"},[(_vm.showDelimiter)?_c('div',{staticClass:"gl-my-5 gl-display-flex gl-align-items-center gl-text-gray-500 gl-gap-4",attrs:{"data-testid":"conversation-delimiter"}},[_c('hr',{staticClass:"gl-flex-grow-1"}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.$options.i18n.CONVERSATION_NEW_CHAT))]),_vm._v(" "),_c('hr',{staticClass:"gl-flex-grow-1"})]):_vm._e(),_vm._v(" "),_vm._l((_vm.messages),function(msg,index){return _c('gl-duo-chat-message',{key:((msg.role) + "-" + index),attrs:{"message":msg},on:{"track-feedback":_vm.onTrackFeedback}})})],2)};
|
|
50
|
+
var __vue_staticRenderFns__ = [];
|
|
51
|
+
|
|
52
|
+
/* style */
|
|
53
|
+
const __vue_inject_styles__ = undefined;
|
|
54
|
+
/* scoped */
|
|
55
|
+
const __vue_scope_id__ = undefined;
|
|
56
|
+
/* module identifier */
|
|
57
|
+
const __vue_module_identifier__ = undefined;
|
|
58
|
+
/* functional template */
|
|
59
|
+
const __vue_is_functional_template__ = false;
|
|
60
|
+
/* style inject */
|
|
61
|
+
|
|
62
|
+
/* style inject SSR */
|
|
63
|
+
|
|
64
|
+
/* style inject shadow dom */
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const __vue_component__ = __vue_normalize__(
|
|
69
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
70
|
+
__vue_inject_styles__,
|
|
71
|
+
__vue_script__,
|
|
72
|
+
__vue_scope_id__,
|
|
73
|
+
__vue_is_functional_template__,
|
|
74
|
+
__vue_module_identifier__,
|
|
75
|
+
false,
|
|
76
|
+
undefined,
|
|
77
|
+
undefined,
|
|
78
|
+
undefined
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export default __vue_component__;
|
package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import GlDuoUserFeedback from '../../../user_feedback/user_feedback';
|
|
2
2
|
import { SafeHtmlDirective } from '../../../../../../directives/safe_html/safe_html';
|
|
3
3
|
import { MESSAGE_MODEL_ROLES } from '../../constants';
|
|
4
4
|
import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import GlIcon from '../../../../../base/icon/icon';
|
|
2
|
+
import GlLink from '../../../../../base/link/link';
|
|
2
3
|
import { DOCUMENTATION_SOURCE_TYPES } from '../../constants';
|
|
3
4
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
5
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import GlModal from '../../../base/modal/modal';
|
|
2
|
+
import GlFormGroup from '../../../base/form/form_group/form_group';
|
|
3
|
+
import GlFormTextarea from '../../../base/form/form_textarea/form_textarea';
|
|
4
|
+
import GlFormCheckboxGroup from '../../../base/form/form_checkbox/form_checkbox_group';
|
|
2
5
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
6
|
|
|
4
7
|
const i18n = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import uniqueId from 'lodash/uniqueId';
|
|
2
|
-
import
|
|
2
|
+
import GlBadge from '../../base/badge/badge';
|
|
3
|
+
import GlLink from '../../base/link/link';
|
|
4
|
+
import GlPopover from '../../base/popover/popover';
|
|
3
5
|
import GlSprintf from '../../utilities/sprintf/sprintf';
|
|
4
6
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
7
|
|
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "66.
|
|
3
|
+
"version": "66.31.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@gitlab/eslint-plugin": "19.0.0",
|
|
95
95
|
"@gitlab/fonts": "^1.2.0",
|
|
96
96
|
"@gitlab/stylelint-config": "5.0.0",
|
|
97
|
-
"@gitlab/svgs": "3.
|
|
97
|
+
"@gitlab/svgs": "3.66.0",
|
|
98
98
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
99
99
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
100
100
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
The dropdown component offers a user multiple items or actions to choose from which are initially
|
|
2
2
|
collapsed behind a button.
|
|
3
3
|
|
|
4
|
-
> **NOTE**: This component
|
|
4
|
+
> **NOTE**: This component has been deprecated in favor of components
|
|
5
5
|
> more suited to the various use cases for dropdowns. Consider using a more
|
|
6
6
|
> appropriate component instead:
|
|
7
7
|
>
|
|
8
8
|
> - For single or multiselect options, use `GlCollapsibleListbox`.
|
|
9
9
|
> - For displaying a list of actions like "Edit user", "Delete user", use `GlDisclosureDropdown`.
|
|
10
10
|
>
|
|
11
|
-
> See [
|
|
12
|
-
>
|
|
11
|
+
> See [Which component should you use?](https://design.gitlab.com/components/dropdown-overview#which-component-should-you-use)
|
|
12
|
+
> for what to use and when.
|
|
13
13
|
|
|
14
14
|
### Icon-only dropdown
|
|
15
15
|
|
|
@@ -536,7 +536,7 @@ export const OnRightEdge = (args, { argTypes }) => ({
|
|
|
536
536
|
OnRightEdge.args = generateProps({ text: 'Some dropdown' });
|
|
537
537
|
|
|
538
538
|
export default {
|
|
539
|
-
title: 'base/dropdown',
|
|
539
|
+
title: 'base/dropdown/deprecated',
|
|
540
540
|
component: GlDropdown,
|
|
541
541
|
subcomponents: {
|
|
542
542
|
GlDropdownDivider,
|
|
@@ -15,7 +15,9 @@ Useful public methods you can call via `$refs`:
|
|
|
15
15
|
|
|
16
16
|
- `.scrollUp()`: Scrolls to the top of the container.
|
|
17
17
|
- `.scrollDown()`: Scrolls to the bottom of the container.
|
|
18
|
-
- `.scrollTo({ top })`: Scrolls to a number of pixels
|
|
18
|
+
- `.scrollTo({ top, behavior })`: Scrolls to a number of pixels
|
|
19
|
+
along the Y axis of the container. The scrolling behavior can also be specified,
|
|
20
|
+
as per MDN spec (<https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo>)
|
|
19
21
|
|
|
20
22
|
## Implementation Example
|
|
21
23
|
|
|
@@ -174,9 +174,9 @@ describe('Infinite Scroll component', () => {
|
|
|
174
174
|
|
|
175
175
|
it('scrollTo', () => {
|
|
176
176
|
createComponent();
|
|
177
|
-
wrapper.vm.scrollTo({ top: 250 });
|
|
177
|
+
wrapper.vm.scrollTo({ top: 250, behavior: 'instant' });
|
|
178
178
|
|
|
179
|
-
expect(mockScrollTo).toHaveBeenCalledWith({ top: 250 });
|
|
179
|
+
expect(mockScrollTo).toHaveBeenCalledWith({ top: 250, behavior: 'instant' });
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
});
|
|
@@ -107,9 +107,12 @@ export default {
|
|
|
107
107
|
*
|
|
108
108
|
* @param params.top - Number of pixels along Y axis to
|
|
109
109
|
* scroll the list container.
|
|
110
|
+
* @param params.behavior - Determines whether scrolling
|
|
111
|
+
* is instant or animates smoothly. Can be 'auto', 'instant', or 'smooth'
|
|
112
|
+
* See [MDN spec](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo)
|
|
110
113
|
*/
|
|
111
|
-
scrollTo({ top }) {
|
|
112
|
-
this.$refs.infiniteContainer.scrollTo({ top });
|
|
114
|
+
scrollTo({ top, behavior }) {
|
|
115
|
+
this.$refs.infiniteContainer.scrollTo({ top, behavior });
|
|
113
116
|
},
|
|
114
117
|
|
|
115
118
|
topReached: throttle(function topReachedThrottled() {
|
|
@@ -333,7 +333,7 @@ MiscellaneousContent.args = {
|
|
|
333
333
|
MiscellaneousContent.decorators = [makeContainer({ height: '200px' })];
|
|
334
334
|
|
|
335
335
|
export default {
|
|
336
|
-
title: 'base/
|
|
336
|
+
title: 'base/dropdown/disclosure-dropdown',
|
|
337
337
|
component: GlDisclosureDropdown,
|
|
338
338
|
parameters: {
|
|
339
339
|
docs: {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { MOCK_USER_PROMPT_MESSAGE, MOCK_RESPONSE_MESSAGE } from '../../mock_data';
|
|
3
|
+
import GlDuoChatMessage from '../duo_chat_message/duo_chat_message.vue';
|
|
4
|
+
import GlDuoChatConversation from './duo_chat_conversation.vue';
|
|
5
|
+
|
|
6
|
+
describe('GlDuoChatConversation', () => {
|
|
7
|
+
let wrapper;
|
|
8
|
+
|
|
9
|
+
const findChatMessages = () => wrapper.findAllComponents(GlDuoChatMessage);
|
|
10
|
+
const findDelimiter = () => wrapper.find('[data-testid="conversation-delimiter"]');
|
|
11
|
+
const createComponent = ({ propsData = {} } = {}) => {
|
|
12
|
+
wrapper = shallowMount(GlDuoChatConversation, {
|
|
13
|
+
propsData,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe('rendering', () => {
|
|
18
|
+
const messages = [MOCK_USER_PROMPT_MESSAGE, MOCK_RESPONSE_MESSAGE];
|
|
19
|
+
|
|
20
|
+
describe('default state', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
createComponent();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('does not render messages by default', () => {
|
|
26
|
+
expect(findChatMessages().length).toBe(0);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('does render the delimiter', () => {
|
|
30
|
+
expect(findDelimiter().exists()).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('renders messages when messages are passed', () => {
|
|
35
|
+
createComponent({
|
|
36
|
+
propsData: { messages },
|
|
37
|
+
});
|
|
38
|
+
expect(findChatMessages().length).toBe(2);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('does not render delimiter when showDelimiter = false', () => {
|
|
42
|
+
createComponent({ propsData: { messages, showDelimiter: false } });
|
|
43
|
+
expect(findDelimiter().exists()).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MOCK_USER_PROMPT_MESSAGE, MOCK_RESPONSE_MESSAGE } from '../../mock_data';
|
|
2
|
+
import GlDuoChatConversation from './duo_chat_conversation.vue';
|
|
3
|
+
import readme from './duo_chat_conversation.md';
|
|
4
|
+
|
|
5
|
+
const defaultValue = (prop) => GlDuoChatConversation.props[prop].default;
|
|
6
|
+
const renderMarkdown = (content) => content;
|
|
7
|
+
const renderGFM = () => {};
|
|
8
|
+
|
|
9
|
+
const generateProps = ({ messages = [], showDelimiter = defaultValue('showDelimiter') } = {}) => ({
|
|
10
|
+
messages,
|
|
11
|
+
showDelimiter,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const Template = (args, { argTypes }) => ({
|
|
15
|
+
components: { GlDuoChatConversation },
|
|
16
|
+
props: Object.keys(argTypes),
|
|
17
|
+
provide: {
|
|
18
|
+
renderGFM,
|
|
19
|
+
renderMarkdown,
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<gl-duo-chat-conversation :messages="messages" :show-delimiter="showDelimiter" />
|
|
23
|
+
`,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const Default = Template.bind({});
|
|
27
|
+
Default.args = generateProps({
|
|
28
|
+
messages: [MOCK_USER_PROMPT_MESSAGE, MOCK_RESPONSE_MESSAGE],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const MultipleConversations = (args, { argTypes }) => ({
|
|
32
|
+
components: { GlDuoChatConversation },
|
|
33
|
+
props: Object.keys(argTypes),
|
|
34
|
+
provide: {
|
|
35
|
+
renderGFM,
|
|
36
|
+
renderMarkdown,
|
|
37
|
+
},
|
|
38
|
+
template: `
|
|
39
|
+
<div>
|
|
40
|
+
<gl-duo-chat-conversation :messages="messages" :show-delimiter="false" />
|
|
41
|
+
<gl-duo-chat-conversation :messages="messages" :show-delimiter="true" />
|
|
42
|
+
</div>
|
|
43
|
+
`,
|
|
44
|
+
});
|
|
45
|
+
MultipleConversations.args = generateProps({
|
|
46
|
+
messages: [MOCK_USER_PROMPT_MESSAGE, MOCK_RESPONSE_MESSAGE],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
title: 'experimental/duo/chat/duo-chat-conversation',
|
|
51
|
+
component: GlDuoChatConversation,
|
|
52
|
+
parameters: {
|
|
53
|
+
docs: {
|
|
54
|
+
description: {
|
|
55
|
+
component: readme,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import GlDuoChatMessage from '../duo_chat_message/duo_chat_message.vue';
|
|
3
|
+
|
|
4
|
+
const i18n = {
|
|
5
|
+
CONVERSATION_NEW_CHAT: 'New chat',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const isMessage = (item) => Boolean(item) && item?.role;
|
|
9
|
+
|
|
10
|
+
const itemsValidator = (items) => items.every(isMessage);
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'GlDuoChatConversation',
|
|
14
|
+
components: {
|
|
15
|
+
GlDuoChatMessage,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
/**
|
|
19
|
+
* Messages to display
|
|
20
|
+
*/
|
|
21
|
+
messages: {
|
|
22
|
+
type: Array,
|
|
23
|
+
required: false,
|
|
24
|
+
default: () => [],
|
|
25
|
+
validator: itemsValidator,
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show the delimiter before this conversation
|
|
29
|
+
*/
|
|
30
|
+
showDelimiter: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: false,
|
|
33
|
+
default: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
onTrackFeedback(event) {
|
|
38
|
+
/**
|
|
39
|
+
* Notify listeners about the feedback form submission on a response message.
|
|
40
|
+
* @param {*} event An event, containing the feedback choices and the extended feedback text.
|
|
41
|
+
*/
|
|
42
|
+
this.$emit('track-feedback', event);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
i18n,
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
<template>
|
|
49
|
+
<div class="gl-display-flex gl-flex-direction-column gl-justify-content-end">
|
|
50
|
+
<div
|
|
51
|
+
v-if="showDelimiter"
|
|
52
|
+
class="gl-my-5 gl-display-flex gl-align-items-center gl-text-gray-500 gl-gap-4"
|
|
53
|
+
data-testid="conversation-delimiter"
|
|
54
|
+
>
|
|
55
|
+
<hr class="gl-flex-grow-1" />
|
|
56
|
+
<span>{{ $options.i18n.CONVERSATION_NEW_CHAT }}</span>
|
|
57
|
+
<hr class="gl-flex-grow-1" />
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<gl-duo-chat-message
|
|
61
|
+
v-for="(msg, index) in messages"
|
|
62
|
+
:key="`${msg.role}-${index}`"
|
|
63
|
+
:message="msg"
|
|
64
|
+
@track-feedback="onTrackFeedback"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
|
|
3
3
|
import { SafeHtmlDirective as SafeHtml } from '../../../../../../directives/safe_html/safe_html';
|
|
4
4
|
import { MESSAGE_MODEL_ROLES } from '../../constants';
|
|
5
5
|
import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources.vue';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import GlIcon from '../../../../../base/icon/icon.vue';
|
|
3
|
+
import GlLink from '../../../../../base/link/link.vue';
|
|
3
4
|
import { DOCUMENTATION_SOURCE_TYPES } from '../../constants';
|
|
4
5
|
|
|
5
6
|
export const i18n = {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import GlModal from '../../../base/modal/modal.vue';
|
|
3
|
+
import GlFormGroup from '../../../base/form/form_group/form_group.vue';
|
|
4
|
+
import GlFormTextarea from '../../../base/form/form_textarea/form_textarea.vue';
|
|
5
|
+
import GlFormCheckboxGroup from '../../../base/form/form_checkbox/form_checkbox_group.vue';
|
|
3
6
|
|
|
4
7
|
export const i18n = {
|
|
5
8
|
MODAL_TITLE: 'Give feedback on AI content',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
|
-
import
|
|
3
|
+
import GlBadge from '../../base/badge/badge.vue';
|
|
4
|
+
import GlLink from '../../base/link/link.vue';
|
|
5
|
+
import GlPopover from '../../base/popover/popover.vue';
|
|
4
6
|
import GlSprintf from '../../utilities/sprintf/sprintf.vue';
|
|
5
7
|
|
|
6
8
|
export const i18n = {
|