@gitlab/ui 66.18.0 → 66.20.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 +19 -0
- package/dist/components/base/banner/banner.js +1 -1
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +94 -0
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +121 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -0
- 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/banner/banner.scss +3 -27
- package/src/components/base/banner/banner.vue +1 -1
- package/src/components/experimental/duo/user_feedback/user_feedback.md +40 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.spec.js +80 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.stories.js +47 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +76 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.spec.js +61 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +124 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [66.20.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.19.0...v66.20.0) (2023-10-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Banner:** Make banner match design spec ([3e73557](https://gitlab.com/gitlab-org/gitlab-ui/commit/3e73557aba7cdcf3bbf21a3a92f100c66762b3b6))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **Banner:** Update heading to use heading scale ([4757149](https://gitlab.com/gitlab-org/gitlab-ui/commit/47571493f27b7fda9566a84f1b16a7b7c8335914))
|
|
12
|
+
|
|
13
|
+
# [66.19.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.18.0...v66.19.0) (2023-09-29)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **GlDuoUserFeedback:** Added the component ([f9a6f93](https://gitlab.com/gitlab-org/gitlab-ui/commit/f9a6f93fe0b46ba5638d9ad711e062afb7898636))
|
|
19
|
+
|
|
1
20
|
# [66.18.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.17.0...v66.18.0) (2023-09-27)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -109,7 +109,7 @@ var script = {
|
|
|
109
109
|
const __vue_script__ = script;
|
|
110
110
|
|
|
111
111
|
/* template */
|
|
112
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-card',{staticClass:"gl-
|
|
112
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-card',{staticClass:"gl-pl-6 gl-pr-8 gl-py-6",class:{ 'gl-banner-introduction': _vm.isIntroducing, 'gl-border-none!': _vm.embedded },attrs:{"body-class":"gl-display-flex gl-p-0!"}},[(_vm.svgPath)?_c('div',{staticClass:"gl-banner-illustration"},[_c('img',{attrs:{"src":_vm.svgPath,"alt":""}})]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-banner-content"},[_c('h2',{staticClass:"gl-banner-title"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_vm._t("default"),_vm._v(" "),_c('gl-button',_vm._b({attrs:{"variant":"confirm","category":"primary","data-testid":"gl-banner-primary-button","href":_vm.buttonLink},on:{"click":_vm.primaryButtonClicked}},'gl-button',_vm.buttonAttributes,false),[_vm._v(_vm._s(_vm.buttonText))]),_vm._v(" "),_vm._t("actions")],2),_vm._v(" "),_c('close-button',{staticClass:"gl-banner-close",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.handleClose}})],1)};
|
|
113
113
|
var __vue_staticRenderFns__ = [];
|
|
114
114
|
|
|
115
115
|
/* style */
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { GlButton } from '../../../../index';
|
|
2
|
+
import FeedbackModal from './user_feedback_modal';
|
|
3
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
const i18n = {
|
|
6
|
+
FEEDBACK_LINK_TEXT: 'Give feedback to improve this answer.',
|
|
7
|
+
FEEDBACK_THANKS: 'Thank you for your feedback.'
|
|
8
|
+
};
|
|
9
|
+
var script = {
|
|
10
|
+
name: 'GlDuoUserFeedback',
|
|
11
|
+
components: {
|
|
12
|
+
GlButton,
|
|
13
|
+
FeedbackModal
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* The text to be displayed as the feedback link/button.
|
|
18
|
+
*/
|
|
19
|
+
feedbackLinkText: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
default: i18n.FEEDBACK_LINK_TEXT
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* The URL of a page to provide more explanations on the experiment. If provided, clicking
|
|
26
|
+
* the feedback link will open a new tab with the URL instead of showing the feedback modal.
|
|
27
|
+
*/
|
|
28
|
+
feedbackLinkUrl: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
default: ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
feedbackReceived: false
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
shouldRenderModal() {
|
|
41
|
+
return !this.feedbackReceived && !this.feedbackLinkUrl;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
notify(event) {
|
|
46
|
+
/**
|
|
47
|
+
* Notify listeners about the feedback form submission.
|
|
48
|
+
* @param {*} event An event, containing the feedback choices and the extended feedback text.
|
|
49
|
+
*/
|
|
50
|
+
this.$emit('feedback', event);
|
|
51
|
+
this.feedbackReceived = true;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
i18n
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/* script */
|
|
58
|
+
const __vue_script__ = script;
|
|
59
|
+
|
|
60
|
+
/* template */
|
|
61
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-pt-4"},[_c('div',[(!_vm.feedbackReceived)?_c('gl-button',{attrs:{"variant":"link","target":"_blank","href":_vm.feedbackLinkUrl},on:{"click":function($event){_vm.shouldRenderModal && _vm.$refs.feedbackModal.show();}}},[_vm._v(_vm._s(_vm.feedbackLinkText))]):_c('span',{staticClass:"gl-text-gray-500"},[_vm._v("\n "+_vm._s(_vm.$options.i18n.FEEDBACK_THANKS)+"\n ")])],1),_vm._v(" "),(_vm.shouldRenderModal)?_c('feedback-modal',{ref:"feedbackModal",on:{"feedback-submitted":_vm.notify}}):_vm._e()],1)};
|
|
62
|
+
var __vue_staticRenderFns__ = [];
|
|
63
|
+
|
|
64
|
+
/* style */
|
|
65
|
+
const __vue_inject_styles__ = undefined;
|
|
66
|
+
/* scoped */
|
|
67
|
+
const __vue_scope_id__ = undefined;
|
|
68
|
+
/* module identifier */
|
|
69
|
+
const __vue_module_identifier__ = undefined;
|
|
70
|
+
/* functional template */
|
|
71
|
+
const __vue_is_functional_template__ = false;
|
|
72
|
+
/* style inject */
|
|
73
|
+
|
|
74
|
+
/* style inject SSR */
|
|
75
|
+
|
|
76
|
+
/* style inject shadow dom */
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const __vue_component__ = __vue_normalize__(
|
|
81
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
82
|
+
__vue_inject_styles__,
|
|
83
|
+
__vue_script__,
|
|
84
|
+
__vue_scope_id__,
|
|
85
|
+
__vue_is_functional_template__,
|
|
86
|
+
__vue_module_identifier__,
|
|
87
|
+
false,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined,
|
|
90
|
+
undefined
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export default __vue_component__;
|
|
94
|
+
export { i18n };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { GlModal, GlFormCheckboxGroup, GlFormGroup, GlFormTextarea } from '../../../../index';
|
|
2
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
+
|
|
4
|
+
const i18n = {
|
|
5
|
+
MODAL_TITLE: 'Give feedback on AI content',
|
|
6
|
+
MODAL_DESCRIPTION: 'To help improve the quality of the content, send your feedback to GitLab team members.',
|
|
7
|
+
MODAL_OPTIONS_LABEL: 'How was the AI content?',
|
|
8
|
+
MODAL_MORE_LABEL: 'More information',
|
|
9
|
+
MODAL_MORE_PLACEHOLDER: 'How could the content be improved?',
|
|
10
|
+
MODAL_FEEDBACK_OPTIONS: {
|
|
11
|
+
helpful: 'Helpful',
|
|
12
|
+
unhelpful: 'Unhelpful or irrelevant',
|
|
13
|
+
incorrect: 'Factually incorrect',
|
|
14
|
+
long: 'Too long',
|
|
15
|
+
abuse: 'Abusive or offensive',
|
|
16
|
+
other: 'Something else'
|
|
17
|
+
},
|
|
18
|
+
MODAL_ACTIONS: {
|
|
19
|
+
submit: 'Submit',
|
|
20
|
+
cancel: 'Cancel'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const feedbackOptions = [{
|
|
24
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.helpful,
|
|
25
|
+
value: 'helpful'
|
|
26
|
+
}, {
|
|
27
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.unhelpful,
|
|
28
|
+
value: 'unhelpful'
|
|
29
|
+
}, {
|
|
30
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.incorrect,
|
|
31
|
+
value: 'incorrect'
|
|
32
|
+
}, {
|
|
33
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.long,
|
|
34
|
+
value: 'long'
|
|
35
|
+
}, {
|
|
36
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.abuse,
|
|
37
|
+
value: 'abuse'
|
|
38
|
+
}, {
|
|
39
|
+
text: i18n.MODAL_FEEDBACK_OPTIONS.other,
|
|
40
|
+
value: 'other'
|
|
41
|
+
}];
|
|
42
|
+
var script = {
|
|
43
|
+
name: 'DuoChatFeedbackModal',
|
|
44
|
+
components: {
|
|
45
|
+
GlModal,
|
|
46
|
+
GlFormCheckboxGroup,
|
|
47
|
+
GlFormGroup,
|
|
48
|
+
GlFormTextarea
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
selectedFeedbackOptions: [],
|
|
53
|
+
extendedFeedback: ''
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
show() {
|
|
58
|
+
this.$refs.feedbackModal.show();
|
|
59
|
+
},
|
|
60
|
+
onFeedbackSubmit() {
|
|
61
|
+
if (this.selectedFeedbackOptions.length) {
|
|
62
|
+
this.$emit('feedback-submitted', {
|
|
63
|
+
feedbackChoices: this.selectedFeedbackOptions,
|
|
64
|
+
extendedTextFeedback: this.extendedFeedback
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
onFeedbackCanceled() {
|
|
69
|
+
this.$refs.feedbackModal.hide();
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
actions: {
|
|
73
|
+
primary: {
|
|
74
|
+
text: i18n.MODAL_ACTIONS.submit
|
|
75
|
+
},
|
|
76
|
+
cancel: {
|
|
77
|
+
text: i18n.MODAL_ACTIONS.cancel
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
feedbackOptions,
|
|
81
|
+
i18n
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/* script */
|
|
85
|
+
const __vue_script__ = script;
|
|
86
|
+
|
|
87
|
+
/* template */
|
|
88
|
+
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(" "),_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)],1)};
|
|
89
|
+
var __vue_staticRenderFns__ = [];
|
|
90
|
+
|
|
91
|
+
/* style */
|
|
92
|
+
const __vue_inject_styles__ = undefined;
|
|
93
|
+
/* scoped */
|
|
94
|
+
const __vue_scope_id__ = undefined;
|
|
95
|
+
/* module identifier */
|
|
96
|
+
const __vue_module_identifier__ = undefined;
|
|
97
|
+
/* functional template */
|
|
98
|
+
const __vue_is_functional_template__ = false;
|
|
99
|
+
/* style inject */
|
|
100
|
+
|
|
101
|
+
/* style inject SSR */
|
|
102
|
+
|
|
103
|
+
/* style inject shadow dom */
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
const __vue_component__ = __vue_normalize__(
|
|
108
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
109
|
+
__vue_inject_styles__,
|
|
110
|
+
__vue_script__,
|
|
111
|
+
__vue_scope_id__,
|
|
112
|
+
__vue_is_functional_template__,
|
|
113
|
+
__vue_module_identifier__,
|
|
114
|
+
false,
|
|
115
|
+
undefined,
|
|
116
|
+
undefined,
|
|
117
|
+
undefined
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export default __vue_component__;
|
|
121
|
+
export { feedbackOptions, i18n };
|