@gitlab/ui 91.2.0 → 91.4.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 +18 -0
- package/dist/components/base/alert/alert.js +3 -2
- package/dist/components/base/banner/banner.js +3 -2
- package/dist/components/base/broadcast_message/broadcast_message.js +3 -2
- package/dist/components/base/modal/modal.js +5 -1
- package/dist/components/base/token/token.js +10 -1
- package/dist/components/experimental/duo/chat/duo_chat.js +11 -2
- package/dist/components/shared_components/close_button/close_button.js +2 -1
- package/package.json +1 -1
- package/src/components/base/alert/alert.vue +3 -2
- package/src/components/base/banner/banner.vue +3 -2
- package/src/components/base/broadcast_message/broadcast_message.vue +3 -2
- package/src/components/base/modal/modal.vue +5 -1
- package/src/components/base/token/token.vue +10 -0
- package/src/components/experimental/duo/chat/duo_chat.vue +23 -3
- package/src/components/shared_components/close_button/close_button.vue +2 -1
- package/translations.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [91.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v91.3.0...v91.4.0) (2024-09-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlAlert:** Replace english text with translation ([38582dd](https://gitlab.com/gitlab-org/gitlab-ui/commit/38582dddee70e6bf2b19945b5f20953359f5bc7a))
|
|
7
|
+
* **GlBanner:** Replace english text with translation ([a8ad872](https://gitlab.com/gitlab-org/gitlab-ui/commit/a8ad872011660d2973c9008e63b314355032e632))
|
|
8
|
+
* **GlBroadcastMessage:** Replace english text with translation ([6cf3e7c](https://gitlab.com/gitlab-org/gitlab-ui/commit/6cf3e7cfe272c1eb48c61d0d79dec9245a825d75))
|
|
9
|
+
* **GlModal:** Replace english text with translation ([2498b0e](https://gitlab.com/gitlab-org/gitlab-ui/commit/2498b0e38f74d2af7efae62b3686ff189b056932))
|
|
10
|
+
* **GlToken:** Add property 'removeLabel' ([87b81a6](https://gitlab.com/gitlab-org/gitlab-ui/commit/87b81a6f0838e8a644af20558a65b02d5b99e25e))
|
|
11
|
+
|
|
12
|
+
# [91.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v91.2.0...v91.3.0) (2024-08-30)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **GlDuoChat:** Change empty state ([87d3384](https://gitlab.com/gitlab-org/gitlab-ui/commit/87d3384045da79aff0676bbe282626615f776b5f))
|
|
18
|
+
|
|
1
19
|
# [91.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v91.1.2...v91.2.0) (2024-08-30)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { translate } from '../../../utils/i18n';
|
|
1
2
|
import { alertVariantOptions, alertVariantIconMap, buttonCategoryOptions } from '../../../utils/constants';
|
|
2
3
|
import CloseButton from '../../shared_components/close_button/close_button';
|
|
3
4
|
import GlButton from '../button/button';
|
|
@@ -35,12 +36,12 @@ var script = {
|
|
|
35
36
|
default: true
|
|
36
37
|
},
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
39
40
|
*/
|
|
40
41
|
dismissLabel: {
|
|
41
42
|
type: String,
|
|
42
43
|
required: false,
|
|
43
|
-
default: 'Dismiss'
|
|
44
|
+
default: () => translate('GlAlert.closeButtonTitle', 'Dismiss')
|
|
44
45
|
},
|
|
45
46
|
variant: {
|
|
46
47
|
type: String,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { bannerVariants } from '../../../utils/constants';
|
|
2
|
+
import { translate } from '../../../utils/i18n';
|
|
2
3
|
import CloseButton from '../../shared_components/close_button/close_button';
|
|
3
4
|
import GlButton from '../button/button';
|
|
4
5
|
import GlCard from '../card/card';
|
|
@@ -62,12 +63,12 @@ var script = {
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
66
67
|
*/
|
|
67
68
|
dismissLabel: {
|
|
68
69
|
type: String,
|
|
69
70
|
required: false,
|
|
70
|
-
default: 'Dismiss'
|
|
71
|
+
default: () => translate('GlBanner.closeButtonTitle', 'Dismiss')
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
74
|
computed: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { colorThemes } from '../../../utils/constants';
|
|
2
|
+
import { translate } from '../../../utils/i18n';
|
|
2
3
|
import CloseButton from '../../shared_components/close_button/close_button';
|
|
3
4
|
import GlIcon from '../icon/icon';
|
|
4
5
|
import { TYPE_BANNER, TYPE_LIST, TYPE_NOTIFICATION } from './constants';
|
|
@@ -28,12 +29,12 @@ var script = {
|
|
|
28
29
|
default: true
|
|
29
30
|
},
|
|
30
31
|
/**
|
|
31
|
-
* The dismiss button's label, it is
|
|
32
|
+
* The dismiss button's label, it is used for the button's aria-label attribute.
|
|
32
33
|
*/
|
|
33
34
|
dismissLabel: {
|
|
34
35
|
type: String,
|
|
35
36
|
required: false,
|
|
36
|
-
default: 'Dismiss'
|
|
37
|
+
default: () => translate('GlBroadcastMessage.closeButtonTitle', 'Dismiss')
|
|
37
38
|
},
|
|
38
39
|
/**
|
|
39
40
|
* The theme's name to use, this should correspond to the user's selected theme in GitLab.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BModal } from '../../../vendor/bootstrap-vue/src/components/modal/modal';
|
|
2
|
+
import { translate } from '../../../utils/i18n';
|
|
2
3
|
import { modalSizeOptions, modalButtonDefaults, focusableTags, COMMA } from '../../../utils/constants';
|
|
3
4
|
import { logWarning, focusFirstFocusableElement } from '../../../utils/utils';
|
|
4
5
|
import CloseButton from '../../shared_components/close_button/close_button';
|
|
@@ -65,10 +66,13 @@ var script = {
|
|
|
65
66
|
default: modalSizeOptions.md,
|
|
66
67
|
validator: val => Object.keys(modalSizeOptions).includes(val)
|
|
67
68
|
},
|
|
69
|
+
/**
|
|
70
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
71
|
+
*/
|
|
68
72
|
dismissLabel: {
|
|
69
73
|
type: String,
|
|
70
74
|
required: false,
|
|
71
|
-
default: 'Close'
|
|
75
|
+
default: () => translate('GlModal.closeButtonTitle', 'Close')
|
|
72
76
|
},
|
|
73
77
|
visible: {
|
|
74
78
|
type: Boolean,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tokenVariants } from '../../../utils/constants';
|
|
2
|
+
import { translate } from '../../../utils/i18n';
|
|
2
3
|
import CloseButton from '../../shared_components/close_button/close_button';
|
|
3
4
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
5
|
|
|
@@ -22,6 +23,14 @@ var script = {
|
|
|
22
23
|
required: false,
|
|
23
24
|
default: 'default',
|
|
24
25
|
validator: variant => tokenVariants.includes(variant)
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
29
|
+
*/
|
|
30
|
+
removeLabel: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
default: () => translate('GlToken.closeButtonTitle', 'Remove')
|
|
25
34
|
}
|
|
26
35
|
},
|
|
27
36
|
computed: {
|
|
@@ -50,7 +59,7 @@ var script = {
|
|
|
50
59
|
const __vue_script__ = script;
|
|
51
60
|
|
|
52
61
|
/* template */
|
|
53
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._g({class:['gl-token', _vm.variantClass, _vm.viewOnlyClass]},_vm.$listeners),[_c('span',{staticClass:"gl-token-content"},[_vm._t("default"),_vm._v(" "),(!_vm.viewOnly)?_c('close-button',{staticClass:"gl-token-close gl-close-btn-color-inherit",on:{"click":_vm.close}}):_vm._e()],2)])};
|
|
62
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._g({class:['gl-token', _vm.variantClass, _vm.viewOnlyClass]},_vm.$listeners),[_c('span',{staticClass:"gl-token-content"},[_vm._t("default"),_vm._v(" "),(!_vm.viewOnly)?_c('close-button',{staticClass:"gl-token-close gl-close-btn-color-inherit",attrs:{"label":_vm.removeLabel},on:{"click":_vm.close}}):_vm._e()],2)])};
|
|
54
63
|
var __vue_staticRenderFns__ = [];
|
|
55
64
|
|
|
56
65
|
/* style */
|
|
@@ -22,7 +22,8 @@ const i18n = {
|
|
|
22
22
|
CHAT_CLOSE_LABEL: 'Close the Code Explanation',
|
|
23
23
|
CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
|
|
24
24
|
CHAT_EMPTY_STATE_TITLE: 'Ask a question',
|
|
25
|
-
CHAT_EMPTY_STATE_DESC: '
|
|
25
|
+
CHAT_EMPTY_STATE_DESC: 'GitLab Duo Chat is your AI-powered assistant.',
|
|
26
|
+
CHAT_EMPTY_STATE_SECONDARY_DESC: 'Responses may be inaccurate. Verify before use.',
|
|
26
27
|
CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
|
|
27
28
|
CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
|
|
28
29
|
CHAT_SUBMIT_LABEL: 'Send chat message.',
|
|
@@ -180,6 +181,14 @@ var script = {
|
|
|
180
181
|
required: false,
|
|
181
182
|
default: i18n.CHAT_EMPTY_STATE_DESC
|
|
182
183
|
},
|
|
184
|
+
/**
|
|
185
|
+
* Override the default empty state description secondary text.
|
|
186
|
+
*/
|
|
187
|
+
emptyStateSecondaryDescription: {
|
|
188
|
+
type: String,
|
|
189
|
+
required: false,
|
|
190
|
+
default: i18n.CHAT_EMPTY_STATE_SECONDARY_DESC
|
|
191
|
+
},
|
|
183
192
|
/**
|
|
184
193
|
* Override the default chat prompt placeholder text.
|
|
185
194
|
*/
|
|
@@ -425,7 +434,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
|
|
|
425
434
|
{
|
|
426
435
|
'gl-h-full': !_vm.hasMessages,
|
|
427
436
|
'force-scroll-bar': _vm.hasMessages,
|
|
428
|
-
} ],attrs:{"tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"enable-code-insertion":_vm.enableCodeInsertion,"messages":conversation,"canceled-request-ids":_vm.canceledRequestIds,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback,"insert-code-snippet":_vm.onInsertCodeSnippet}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('gl-empty-state',{key:"empty-state",staticClass:"gl-flex-grow gl-justify-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:"duo-chat-drawer-footer duo-chat-drawer-footer-sticky gl-border-t gl-bg-gray-10 gl-p-5",class:{ 'duo-chat-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 [(_vm.displaySubmitButton)?_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","data-testid":"chat-prompt-submit-button","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL}}):_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-base",attrs:{"icon":"stop","category":"primary","variant":"default","data-testid":"chat-prompt-cancel-button","aria-label":_vm.$options.i18n.CHAT_CANCEL_LABEL},on:{"click":_vm.cancelPrompt}})]},proxy:true}],null,false,677611116)},[_c('div',{staticClass:"duo-chat-input gl-min-h-8 gl-max-w-full gl-grow gl-rounded-base gl-bg-white gl-align-top gl-shadow-inner-1-gray-400",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands !gl-absolute gl-w-full -gl-translate-y-full gl-list-none gl-pl-0 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-flex gl-justify-between"},[_c('span',{staticClass:"gl-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-pl-3 gl-text-right gl-italic gl-text-gray-500"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute !gl-h-full gl-rounded-br-none gl-rounded-tr-none !gl-bg-transparent !gl-py-4 !gl-shadow-none",class:{ 'gl-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"autofocus":""},on:{"compositionend":_vm.compositionEnd},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('p',{staticClass:"gl-mb-0 gl-mt-3 gl-text-sm gl-leading-20 gl-text-subtle",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER)+"\n ")])],1)],1):_vm._e()]):_vm._e()};
|
|
437
|
+
} ],attrs:{"tag":"section","name":"message"}},[_vm._l((_vm.conversations),function(conversation,index){return _c('gl-duo-chat-conversation',{key:("conversation-" + index),attrs:{"enable-code-insertion":_vm.enableCodeInsertion,"messages":conversation,"canceled-request-ids":_vm.canceledRequestIds,"show-delimiter":index > 0},on:{"track-feedback":_vm.onTrackFeedback,"insert-code-snippet":_vm.onInsertCodeSnippet}})}),_vm._v(" "),(!_vm.hasMessages && !_vm.isLoading)?[_c('gl-empty-state',{key:"empty-state",staticClass:"gl-flex-grow gl-justify-center",attrs:{"svg-path":_vm.$options.emptySvg,"svg-height":145,"title":_vm.emptyStateTitle},scopedSlots:_vm._u([{key:"description",fn:function(){return [_c('p',{staticClass:"gl-mb-3",attrs:{"data-testid":"gl-duo-chat-empty-state-description"}},[_vm._v("\n "+_vm._s(_vm.emptyStateDescription)+"\n ")]),_vm._v(" "),_c('p',{staticClass:"gl-mt-3 gl-text-sm gl-text-subtle",attrs:{"data-testid":"gl-duo-chat-empty-state-secondary-description"}},[_vm._v("\n "+_vm._s(_vm.emptyStateSecondaryDescription)+"\n ")])]},proxy:true}],null,false,460840487)}),_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:"duo-chat-drawer-footer duo-chat-drawer-footer-sticky gl-border-t gl-bg-gray-10 gl-p-5",class:{ 'duo-chat-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 [(_vm.displaySubmitButton)?_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","data-testid":"chat-prompt-submit-button","aria-label":_vm.$options.i18n.CHAT_SUBMIT_LABEL}}):_c('gl-button',{staticClass:"!gl-absolute gl-bottom-2 gl-right-2 !gl-rounded-base",attrs:{"icon":"stop","category":"primary","variant":"default","data-testid":"chat-prompt-cancel-button","aria-label":_vm.$options.i18n.CHAT_CANCEL_LABEL},on:{"click":_vm.cancelPrompt}})]},proxy:true}],null,false,677611116)},[_c('div',{staticClass:"duo-chat-input gl-min-h-8 gl-max-w-full gl-grow gl-rounded-base gl-bg-white gl-align-top gl-shadow-inner-1-gray-400",attrs:{"data-value":_vm.prompt}},[(_vm.shouldShowSlashCommands)?_c('gl-card',{ref:"commands",staticClass:"slash-commands !gl-absolute gl-w-full -gl-translate-y-full gl-list-none gl-pl-0 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-flex gl-justify-between"},[_c('span',{staticClass:"gl-block"},[_vm._v(_vm._s(command.name))]),_vm._v(" "),_c('small',{staticClass:"gl-pl-3 gl-text-right gl-italic gl-text-gray-500"},[_vm._v(_vm._s(command.description))])])])}),1):_vm._e(),_vm._v(" "),_c('gl-form-textarea',{ref:"prompt",staticClass:"gl-absolute !gl-h-full gl-rounded-br-none gl-rounded-tr-none !gl-bg-transparent !gl-py-4 !gl-shadow-none",class:{ 'gl-truncate': !_vm.prompt },attrs:{"data-testid":"chat-prompt-input","placeholder":_vm.inputPlaceholder,"autofocus":""},on:{"compositionend":_vm.compositionEnd},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('p',{staticClass:"gl-mb-0 gl-mt-3 gl-text-sm gl-leading-20 gl-text-subtle",attrs:{"data-testid":"chat-legal-disclaimer"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.CHAT_LEGAL_DISCLAIMER)+"\n ")])],1)],1):_vm._e()]):_vm._e()};
|
|
429
438
|
var __vue_staticRenderFns__ = [];
|
|
430
439
|
|
|
431
440
|
/* style */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { translate } from '../../../utils/i18n';
|
|
1
2
|
import GlButton from '../../base/button/button';
|
|
2
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
4
|
|
|
@@ -10,7 +11,7 @@ var script = {
|
|
|
10
11
|
label: {
|
|
11
12
|
type: String,
|
|
12
13
|
required: false,
|
|
13
|
-
default: 'Close'
|
|
14
|
+
default: () => translate('CloseButton.title', 'Close')
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<script>
|
|
3
|
+
import { translate } from '../../../utils/i18n';
|
|
3
4
|
import {
|
|
4
5
|
alertVariantOptions,
|
|
5
6
|
alertVariantIconMap,
|
|
@@ -39,12 +40,12 @@ export default {
|
|
|
39
40
|
default: true,
|
|
40
41
|
},
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
43
44
|
*/
|
|
44
45
|
dismissLabel: {
|
|
45
46
|
type: String,
|
|
46
47
|
required: false,
|
|
47
|
-
default: 'Dismiss',
|
|
48
|
+
default: () => translate('GlAlert.closeButtonTitle', 'Dismiss'),
|
|
48
49
|
},
|
|
49
50
|
variant: {
|
|
50
51
|
type: String,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { bannerVariants } from '../../../utils/constants';
|
|
3
|
+
import { translate } from '../../../utils/i18n';
|
|
3
4
|
import CloseButton from '../../shared_components/close_button/close_button.vue';
|
|
4
5
|
import GlButton from '../button/button.vue';
|
|
5
6
|
import GlCard from '../card/card.vue';
|
|
@@ -62,12 +63,12 @@ export default {
|
|
|
62
63
|
},
|
|
63
64
|
},
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
66
67
|
*/
|
|
67
68
|
dismissLabel: {
|
|
68
69
|
type: String,
|
|
69
70
|
required: false,
|
|
70
|
-
default: 'Dismiss',
|
|
71
|
+
default: () => translate('GlBanner.closeButtonTitle', 'Dismiss'),
|
|
71
72
|
},
|
|
72
73
|
},
|
|
73
74
|
computed: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { colorThemes } from '../../../utils/constants';
|
|
3
|
+
import { translate } from '../../../utils/i18n';
|
|
3
4
|
import CloseButton from '../../shared_components/close_button/close_button.vue';
|
|
4
5
|
import GlIcon from '../icon/icon.vue';
|
|
5
6
|
import { TYPE_BANNER, TYPE_NOTIFICATION, TYPE_LIST } from './constants';
|
|
@@ -28,12 +29,12 @@ export default {
|
|
|
28
29
|
default: true,
|
|
29
30
|
},
|
|
30
31
|
/**
|
|
31
|
-
* The dismiss button's label, it is
|
|
32
|
+
* The dismiss button's label, it is used for the button's aria-label attribute.
|
|
32
33
|
*/
|
|
33
34
|
dismissLabel: {
|
|
34
35
|
type: String,
|
|
35
36
|
required: false,
|
|
36
|
-
default: 'Dismiss',
|
|
37
|
+
default: () => translate('GlBroadcastMessage.closeButtonTitle', 'Dismiss'),
|
|
37
38
|
},
|
|
38
39
|
/**
|
|
39
40
|
* The theme's name to use, this should correspond to the user's selected theme in GitLab.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<script>
|
|
3
3
|
import { BModal } from '../../../vendor/bootstrap-vue/src/components/modal/modal';
|
|
4
|
+
import { translate } from '../../../utils/i18n';
|
|
4
5
|
import {
|
|
5
6
|
COMMA,
|
|
6
7
|
focusableTags,
|
|
@@ -71,10 +72,13 @@ export default {
|
|
|
71
72
|
default: modalSizeOptions.md,
|
|
72
73
|
validator: (val) => Object.keys(modalSizeOptions).includes(val),
|
|
73
74
|
},
|
|
75
|
+
/**
|
|
76
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
77
|
+
*/
|
|
74
78
|
dismissLabel: {
|
|
75
79
|
type: String,
|
|
76
80
|
required: false,
|
|
77
|
-
default: 'Close',
|
|
81
|
+
default: () => translate('GlModal.closeButtonTitle', 'Close'),
|
|
78
82
|
},
|
|
79
83
|
visible: {
|
|
80
84
|
type: Boolean,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<script>
|
|
3
3
|
import { tokenVariants } from '../../../utils/constants';
|
|
4
|
+
import { translate } from '../../../utils/i18n';
|
|
4
5
|
import CloseButton from '../../shared_components/close_button/close_button.vue';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
@@ -23,6 +24,14 @@ export default {
|
|
|
23
24
|
default: 'default',
|
|
24
25
|
validator: (variant) => tokenVariants.includes(variant),
|
|
25
26
|
},
|
|
27
|
+
/**
|
|
28
|
+
* The close button's label, it is used for the button's aria-label attribute.
|
|
29
|
+
*/
|
|
30
|
+
removeLabel: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
default: () => translate('GlToken.closeButtonTitle', 'Remove'),
|
|
34
|
+
},
|
|
26
35
|
},
|
|
27
36
|
computed: {
|
|
28
37
|
variantClass() {
|
|
@@ -54,6 +63,7 @@ export default {
|
|
|
54
63
|
<close-button
|
|
55
64
|
v-if="!viewOnly"
|
|
56
65
|
class="gl-token-close gl-close-btn-color-inherit"
|
|
66
|
+
:label="removeLabel"
|
|
57
67
|
@click="close"
|
|
58
68
|
/>
|
|
59
69
|
</span>
|
|
@@ -22,7 +22,8 @@ export const i18n = {
|
|
|
22
22
|
CHAT_CLOSE_LABEL: 'Close the Code Explanation',
|
|
23
23
|
CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
|
|
24
24
|
CHAT_EMPTY_STATE_TITLE: 'Ask a question',
|
|
25
|
-
CHAT_EMPTY_STATE_DESC: '
|
|
25
|
+
CHAT_EMPTY_STATE_DESC: 'GitLab Duo Chat is your AI-powered assistant.',
|
|
26
|
+
CHAT_EMPTY_STATE_SECONDARY_DESC: 'Responses may be inaccurate. Verify before use.',
|
|
26
27
|
CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
|
|
27
28
|
CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
|
|
28
29
|
CHAT_SUBMIT_LABEL: 'Send chat message.',
|
|
@@ -188,6 +189,14 @@ export default {
|
|
|
188
189
|
required: false,
|
|
189
190
|
default: i18n.CHAT_EMPTY_STATE_DESC,
|
|
190
191
|
},
|
|
192
|
+
/**
|
|
193
|
+
* Override the default empty state description secondary text.
|
|
194
|
+
*/
|
|
195
|
+
emptyStateSecondaryDescription: {
|
|
196
|
+
type: String,
|
|
197
|
+
required: false,
|
|
198
|
+
default: i18n.CHAT_EMPTY_STATE_SECONDARY_DESC,
|
|
199
|
+
},
|
|
191
200
|
/**
|
|
192
201
|
* Override the default chat prompt placeholder text.
|
|
193
202
|
*/
|
|
@@ -517,9 +526,20 @@ export default {
|
|
|
517
526
|
:svg-path="$options.emptySvg"
|
|
518
527
|
:svg-height="145"
|
|
519
528
|
:title="emptyStateTitle"
|
|
520
|
-
:description="emptyStateDescription"
|
|
521
529
|
class="gl-flex-grow gl-justify-center"
|
|
522
|
-
|
|
530
|
+
>
|
|
531
|
+
<template #description>
|
|
532
|
+
<p data-testid="gl-duo-chat-empty-state-description" class="gl-mb-3">
|
|
533
|
+
{{ emptyStateDescription }}
|
|
534
|
+
</p>
|
|
535
|
+
<p
|
|
536
|
+
data-testid="gl-duo-chat-empty-state-secondary-description"
|
|
537
|
+
class="gl-mt-3 gl-text-sm gl-text-subtle"
|
|
538
|
+
>
|
|
539
|
+
{{ emptyStateSecondaryDescription }}
|
|
540
|
+
</p>
|
|
541
|
+
</template>
|
|
542
|
+
</gl-empty-state>
|
|
523
543
|
<gl-duo-chat-predefined-prompts
|
|
524
544
|
key="predefined-prompts"
|
|
525
545
|
:prompts="predefinedPrompts"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { translate } from '../../../utils/i18n';
|
|
2
3
|
import GlButton from '../../base/button/button.vue';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -10,7 +11,7 @@ export default {
|
|
|
10
11
|
label: {
|
|
11
12
|
type: String,
|
|
12
13
|
required: false,
|
|
13
|
-
default: 'Close',
|
|
14
|
+
default: () => translate('CloseButton.title', 'Close'),
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
17
|
};
|
package/translations.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/* eslint-disable import/no-default-export */
|
|
2
2
|
export default {
|
|
3
3
|
'ClearIconButton.title': 'Clear',
|
|
4
|
+
'CloseButton.title': 'Close',
|
|
4
5
|
'DuoChatContextItemPopover.DisabledReason': 'This item is disabled',
|
|
6
|
+
'GlAlert.closeButtonTitle': 'Dismiss',
|
|
7
|
+
'GlBanner.closeButtonTitle': 'Dismiss',
|
|
5
8
|
'GlBreadcrumb.showMoreLabel': 'Show more breadcrumbs',
|
|
9
|
+
'GlBroadcastMessage.closeButtonTitle': 'Dismiss',
|
|
6
10
|
'GlCollapsibleListbox.srOnlyResultsLabel': null,
|
|
7
11
|
'GlDuoChatMessage.SelectedContextItemsTitleAssistantMessage': null,
|
|
8
12
|
'GlDuoChatMessage.SelectedContextItemsTitleUserMessage': null,
|
|
@@ -21,6 +25,7 @@ export default {
|
|
|
21
25
|
'GlKeysetPagination.navigationLabel': 'Pagination',
|
|
22
26
|
'GlKeysetPagination.nextText': 'Next',
|
|
23
27
|
'GlKeysetPagination.prevText': 'Previous',
|
|
28
|
+
'GlModal.closeButtonTitle': 'Close',
|
|
24
29
|
'GlPagination.labelFirstPage': 'Go to first page',
|
|
25
30
|
'GlPagination.labelLastPage': 'Go to last page',
|
|
26
31
|
'GlPagination.labelNextPage': 'Go to next page',
|
|
@@ -32,4 +37,5 @@ export default {
|
|
|
32
37
|
'GlSearchBoxByType.input.placeholder': 'Search',
|
|
33
38
|
'GlSorting.sortAscending': 'Sort direction: ascending',
|
|
34
39
|
'GlSorting.sortDescending': 'Sort direction: descending',
|
|
40
|
+
'GlToken.closeButtonTitle': 'Remove',
|
|
35
41
|
};
|