@gitlab/ui 104.2.0 → 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.
Files changed (82) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/dist/index.js +0 -5
  5. package/dist/tailwind.css +1 -1
  6. package/dist/tailwind.css.map +1 -1
  7. package/package.json +1 -3
  8. package/src/index.js +0 -5
  9. package/src/scss/components.scss +0 -3
  10. package/translations.js +0 -57
  11. package/dist/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
  12. 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
  13. package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +0 -273
  14. 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
  15. 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
  16. 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
  17. 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
  18. package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.js +0 -137
  19. package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.js +0 -163
  20. package/dist/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -308
  21. package/dist/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -140
  22. package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +0 -109
  23. package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +0 -111
  24. package/dist/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -33
  25. package/dist/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -14
  26. package/dist/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
  27. package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +0 -300
  28. package/dist/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -56
  29. package/dist/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -17
  30. package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +0 -115
  31. package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +0 -72
  32. package/dist/components/experimental/duo/chat/constants.js +0 -35
  33. package/dist/components/experimental/duo/chat/duo_chat.js +0 -553
  34. package/dist/components/experimental/duo/chat/markdown_renderer.js +0 -25
  35. package/dist/components/experimental/duo/chat/mock_data.js +0 -170
  36. package/dist/components/experimental/duo/user_feedback/user_feedback.js +0 -106
  37. package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +0 -154
  38. package/dist/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.js +0 -106
  39. package/dist/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.js +0 -246
  40. package/src/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
  41. 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
  42. package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.md +0 -44
  43. package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +0 -288
  44. 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
  45. 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
  46. 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
  47. 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
  48. package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +0 -170
  49. package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +0 -196
  50. package/src/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -362
  51. package/src/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -169
  52. package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +0 -27
  53. package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +0 -99
  54. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.md +0 -10
  55. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +0 -44
  56. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +0 -112
  57. package/src/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -39
  58. package/src/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -12
  59. package/src/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
  60. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.md +0 -69
  61. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +0 -105
  62. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +0 -363
  63. package/src/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -51
  64. package/src/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -18
  65. package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.md +0 -10
  66. package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +0 -91
  67. package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.md +0 -10
  68. package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +0 -45
  69. package/src/components/experimental/duo/chat/constants.js +0 -37
  70. package/src/components/experimental/duo/chat/duo_chat.md +0 -202
  71. package/src/components/experimental/duo/chat/duo_chat.scss +0 -413
  72. package/src/components/experimental/duo/chat/duo_chat.vue +0 -751
  73. package/src/components/experimental/duo/chat/markdown_renderer.js +0 -29
  74. package/src/components/experimental/duo/chat/mock_data.js +0 -187
  75. package/src/components/experimental/duo/chat/variables.scss +0 -9
  76. package/src/components/experimental/duo/user_feedback/user_feedback.md +0 -90
  77. package/src/components/experimental/duo/user_feedback/user_feedback.vue +0 -95
  78. package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +0 -167
  79. package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +0 -42
  80. package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +0 -96
  81. package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +0 -46
  82. package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +0 -270
@@ -1,137 +0,0 @@
1
- import GlAlert from '../../../../../../base/alert/alert';
2
- import GlIcon from '../../../../../../base/icon/icon';
3
- import GlPopover from '../../../../../../base/popover/popover';
4
- import GlTruncate from '../../../../../../utilities/truncate/truncate';
5
- import { translate } from '../../../../../../../utils/i18n';
6
- import { CONTEXT_ITEM_CATEGORY_ISSUE, CONTEXT_ITEM_CATEGORY_MERGE_REQUEST, CONTEXT_ITEM_CATEGORY_FILE } from '../constants';
7
- import { formatMergeRequestId, formatIssueId, getContextItemIcon, getContextItemTypeLabel, getContextItemSecondaryText, getContextItemSource } from '../utils';
8
- import GlBadge from '../../../../../../base/badge/badge';
9
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
10
-
11
- /**
12
- * This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
13
- *
14
- * Please use the corresponding component in Duo-UI going forward.
15
- * All future development and maintenance for Duo components should take place in Duo-UI.
16
- *
17
- * 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.
18
- */
19
- var script = {
20
- name: 'DuoChatContextItemPopover',
21
- components: {
22
- GlBadge,
23
- GlTruncate,
24
- GlAlert,
25
- GlIcon,
26
- GlPopover
27
- },
28
- props: {
29
- /**
30
- * The context contextItem to display in the popover.
31
- */
32
- contextItem: {
33
- type: Object,
34
- required: true
35
- },
36
- /**
37
- * The target element ID for the popover.
38
- */
39
- target: {
40
- type: String,
41
- required: true
42
- },
43
- /**
44
- * The placement of the popover relative to the target.
45
- */
46
- placement: {
47
- type: String,
48
- default: 'bottom',
49
- required: false
50
- }
51
- },
52
- computed: {
53
- id() {
54
- const isIssuable = this.contextItem.category === CONTEXT_ITEM_CATEGORY_ISSUE || this.contextItem.category === CONTEXT_ITEM_CATEGORY_MERGE_REQUEST;
55
- return isIssuable ? this.contextItem.metadata.iid : null;
56
- },
57
- formattedId() {
58
- switch (this.contextItem.category) {
59
- case CONTEXT_ITEM_CATEGORY_ISSUE:
60
- return formatIssueId(this.id);
61
- case CONTEXT_ITEM_CATEGORY_MERGE_REQUEST:
62
- return formatMergeRequestId(this.id);
63
- default:
64
- return '';
65
- }
66
- },
67
- title() {
68
- return this.contextItem.metadata.title || '';
69
- },
70
- filePath() {
71
- return this.contextItem.category === CONTEXT_ITEM_CATEGORY_FILE ? this.contextItem.metadata.relativePath || '' : null;
72
- },
73
- filePathArray() {
74
- var _this$filePath;
75
- return (_this$filePath = this.filePath) === null || _this$filePath === void 0 ? void 0 : _this$filePath.split('/');
76
- },
77
- isEnabled() {
78
- return this.contextItem.metadata.enabled !== false;
79
- },
80
- disabledMessage() {
81
- return Array.isArray(this.contextItem.metadata.disabledReasons) && this.contextItem.metadata.disabledReasons.length > 0 ? this.contextItem.metadata.disabledReasons.join(', ') : translate('DuoChatContextItemPopover.DisabledReason', 'This item is disabled');
82
- },
83
- iconName() {
84
- return getContextItemIcon(this.contextItem);
85
- },
86
- itemTypeLabel() {
87
- return getContextItemTypeLabel(this.contextItem);
88
- },
89
- secondaryText() {
90
- return getContextItemSecondaryText(this.contextItem);
91
- },
92
- itemSource() {
93
- return getContextItemSource(this.contextItem);
94
- }
95
- },
96
- methods: {
97
- translate
98
- }
99
- };
100
-
101
- /* script */
102
- const __vue_script__ = script;
103
-
104
- /* template */
105
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-popover',{attrs:{"target":_vm.target,"triggers":"hover focus","placement":_vm.placement,"title":_vm.title,"custom-class":"gl-duo-chat-item-popover"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_c('div',{staticClass:"gl-heading-3 gl-mb-1 gl-mt-2 gl-leading-1",attrs:{"data-testid":"chat-context-popover-title"}},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),(_vm.itemTypeLabel)?_c('div',{staticClass:"gl-flex gl-items-center gl-font-normal gl-text-subtle"},[_c('gl-truncate',{staticClass:"gl-min-w-0",attrs:{"text":_vm.itemTypeLabel}})],1):_vm._e()])]},proxy:true}])},[_vm._v(" "),_c('div',[(_vm.secondaryText)?_c('div',{staticClass:"gl-flex gl-items-center"},[_c('gl-icon',{staticClass:"gl-mr-1 gl-shrink-0",attrs:{"name":_vm.iconName,"size":12,"variant":"subtle"}}),_vm._v(" "),(_vm.itemSource)?_c('gl-badge',{staticClass:"gl-mr-1"},[_vm._v(_vm._s(_vm.itemSource))]):_vm._e(),_vm._v(" "),_c('gl-truncate',{staticClass:"gl-min-w-0",attrs:{"text":_vm.secondaryText}})],1):(_vm.filePath)?_c('div',[_c('gl-icon',{attrs:{"name":"document","size":12,"variant":"subtle"}}),_vm._v(" "),_c('span',{staticClass:"gl-break-all"},[_vm._v(_vm._s(_vm.contextItem.metadata.project))]),_vm._v(" "),_vm._l((_vm.filePathArray),function(pathPart,index){return _c('span',{key:pathPart,staticClass:"gl-break-all"},[_vm._v(_vm._s(pathPart)+_vm._s(index + 1 < _vm.filePathArray.length ? '/' : ''))])})],2):_c('div',[(_vm.iconName)?_c('gl-icon',{attrs:{"name":_vm.iconName,"size":12,"variant":"subtle"}}):_vm._e(),_vm._v(" "),_c('span',{staticClass:"gl-break-all"},[_vm._v(_vm._s(_vm.contextItem.metadata.project))]),_vm._v(" "),(_vm.id)?_c('span',{staticClass:"gl-break-all"},[_vm._v(_vm._s(_vm.formattedId))]):_vm._e()],1),_vm._v(" "),(!_vm.isEnabled)?_c('gl-alert',{staticClass:"gl-mb-1 gl-mt-3 gl-p-4 gl-text-sm",attrs:{"variant":"danger","data-testid":"chat-context-popover-disabled","dismissible":false,"show-icon":false}},[_vm._v("\n "+_vm._s(_vm.disabledMessage)+"\n ")]):_vm._e()],1)])};
106
- var __vue_staticRenderFns__ = [];
107
-
108
- /* style */
109
- const __vue_inject_styles__ = undefined;
110
- /* scoped */
111
- const __vue_scope_id__ = undefined;
112
- /* module identifier */
113
- const __vue_module_identifier__ = undefined;
114
- /* functional template */
115
- const __vue_is_functional_template__ = false;
116
- /* style inject */
117
-
118
- /* style inject SSR */
119
-
120
- /* style inject shadow dom */
121
-
122
-
123
-
124
- const __vue_component__ = __vue_normalize__(
125
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
126
- __vue_inject_styles__,
127
- __vue_script__,
128
- __vue_scope_id__,
129
- __vue_is_functional_template__,
130
- __vue_module_identifier__,
131
- false,
132
- undefined,
133
- undefined,
134
- undefined
135
- );
136
-
137
- export default __vue_component__;
@@ -1,163 +0,0 @@
1
- import uniqueId from 'lodash/uniqueId';
2
- import GlIcon from '../../../../../../base/icon/icon';
3
- import GlToken from '../../../../../../base/token/token';
4
- import GlTruncate from '../../../../../../utilities/truncate/truncate';
5
- import GlDuoChatContextItemPopover from '../duo_chat_context_item_popover/duo_chat_context_item_popover';
6
- import { CONTEXT_ITEM_CATEGORY_LOCAL_GIT, CONTEXT_ITEM_CATEGORY_FILE, CONTEXT_ITEM_CATEGORY_DEPENDENCY } from '../constants';
7
- import GlDuoChatContextItemDetailsModal from '../duo_chat_context_item_details_modal/duo_chat_context_item_details_modal';
8
- import { contextItemsValidator, getContextItemIcon } from '../utils';
9
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
10
-
11
- /**
12
- * This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
13
- *
14
- * Please use the corresponding component in Duo-UI going forward.
15
- * All future development and maintenance for Duo components should take place in Duo-UI.
16
- *
17
- * 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.
18
- */
19
- var script = {
20
- name: 'GlDuoChatContextItemSelections',
21
- components: {
22
- GlTruncate,
23
- GlDuoChatContextItemDetailsModal,
24
- GlIcon,
25
- GlDuoChatContextItemPopover,
26
- GlToken
27
- },
28
- props: {
29
- /**
30
- * Array of selected context items.
31
- */
32
- selections: {
33
- type: Array,
34
- required: true,
35
- validator: contextItemsValidator
36
- },
37
- /**
38
- * The title to display for the selections.
39
- */
40
- title: {
41
- type: String,
42
- required: true
43
- },
44
- /**
45
- * Whether the selections should be collapsed by default.
46
- */
47
- defaultCollapsed: {
48
- type: Boolean,
49
- required: true
50
- },
51
- /**
52
- * Whether the selections can be removed.
53
- */
54
- removable: {
55
- type: Boolean,
56
- required: false,
57
- default: false
58
- },
59
- variant: {
60
- type: String,
61
- required: false,
62
- default: 'assistant'
63
- }
64
- },
65
- data() {
66
- return {
67
- isCollapsed: this.defaultCollapsed,
68
- selectionsId: uniqueId(),
69
- previewContextItemId: null
70
- };
71
- },
72
- computed: {
73
- collapseIconName() {
74
- return this.isCollapsed ? 'chevron-right' : 'chevron-down';
75
- },
76
- variantClasses() {
77
- if (this.variant === 'user') {
78
- return 'gl-mb-0 gl-mt-2 gl-text-blue-700';
79
- }
80
- return 'gl-mb-2 gl-text-gray-500';
81
- },
82
- tokenVariantClasses() {
83
- if (this.variant === 'user') {
84
- return 'gl-bg-blue-50 gl-text-blue-600';
85
- }
86
- return '';
87
- },
88
- contextItemPreview() {
89
- return this.selections.find(item => item.id === this.previewContextItemId);
90
- }
91
- },
92
- methods: {
93
- getContextItemIcon,
94
- toggleCollapse() {
95
- this.isCollapsed = !this.isCollapsed;
96
- },
97
- onRemoveItem(contextItem) {
98
- /**
99
- * Emitted when a context contextItem should be removed.
100
- * @property {Object} item - The context contextItem to be removed
101
- */
102
- this.$emit('remove', contextItem);
103
- },
104
- onOpenItem(event, contextItem) {
105
- const isKeypressOnCloseButton = event.type === 'keydown' && event.target !== event.currentTarget;
106
- if (isKeypressOnCloseButton) {
107
- // don't respond to events triggered by the gl-token children (e.g. the close button)
108
- return;
109
- }
110
- if (!this.canOpen(contextItem)) {
111
- return;
112
- }
113
- if (!contextItem.content) {
114
- this.$emit('get-content', contextItem);
115
- }
116
- this.previewContextItemId = contextItem.id;
117
- },
118
- canOpen(contextItem) {
119
- return [CONTEXT_ITEM_CATEGORY_LOCAL_GIT, CONTEXT_ITEM_CATEGORY_FILE, CONTEXT_ITEM_CATEGORY_DEPENDENCY].includes(contextItem.category);
120
- },
121
- onClosePreview() {
122
- this.previewContextItemId = null;
123
- }
124
- }
125
- };
126
-
127
- /* script */
128
- const __vue_script__ = script;
129
-
130
- /* template */
131
- 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",class:_vm.variantClasses},[_c('button',{staticClass:"gl-flex gl-w-full gl-items-center gl-border-0 gl-bg-transparent gl-p-0 gl-text-left gl-text-xs gl-lowercase gl-text-inherit",attrs:{"data-testid":"chat-context-selections-title","type":"button"},on:{"click":_vm.toggleCollapse}},[_c('gl-icon',{attrs:{"name":_vm.collapseIconName,"data-testid":"chat-context-collapse-icon"}}),_vm._v(" "+_vm._s(_vm.title)+"\n ")],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.isCollapsed),expression:"!isCollapsed"}],staticClass:"gl-mt-1 gl-flex gl-grow gl-flex-wrap",attrs:{"data-testid":"chat-context-tokens-wrapper"}},_vm._l((_vm.selections),function(item){return _c('gl-token',{key:item.id,staticClass:"gl-mb-2 gl-mr-2 gl-max-w-full",class:_vm.tokenVariantClasses,attrs:{"id":("context-item-" + (item.id) + "-" + _vm.selectionsId + "-token"),"view-only":!_vm.removable,"variant":"default","tabindex":_vm.canOpen(item) ? 0 : -1,"role":_vm.canOpen(item) ? 'button' : undefined},on:{"click":function($event){return _vm.onOpenItem($event, item)},"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onOpenItem($event, item)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }$event.preventDefault();return _vm.onOpenItem($event, item)}],"close":function($event){return _vm.onRemoveItem(item)}}},[_c('div',{staticClass:"gl-flex gl-min-w-0 gl-items-center",attrs:{"id":("context-item-" + (item.id) + "-" + _vm.selectionsId)}},[(_vm.getContextItemIcon(item))?_c('gl-icon',{staticClass:"gl-mr-1",attrs:{"name":_vm.getContextItemIcon(item),"size":12}}):_vm._e(),_vm._v(" "),_c('gl-truncate',{attrs:{"text":item.metadata.title,"position":"middle"}})],1),_vm._v(" "),_c('gl-duo-chat-context-item-popover',{attrs:{"context-item":item,"target":("context-item-" + (item.id) + "-" + _vm.selectionsId + "-token"),"placement":"bottom"},on:{"show-git-diff":function($event){return _vm.onOpenItem(item)}}})],1)}),1),_vm._v(" "),(_vm.contextItemPreview)?_c('gl-duo-chat-context-item-details-modal',{attrs:{"context-item":_vm.contextItemPreview},on:{"close":_vm.onClosePreview}}):_vm._e()],1)};
132
- var __vue_staticRenderFns__ = [];
133
-
134
- /* style */
135
- const __vue_inject_styles__ = undefined;
136
- /* scoped */
137
- const __vue_scope_id__ = undefined;
138
- /* module identifier */
139
- const __vue_module_identifier__ = undefined;
140
- /* functional template */
141
- const __vue_is_functional_template__ = false;
142
- /* style inject */
143
-
144
- /* style inject SSR */
145
-
146
- /* style inject shadow dom */
147
-
148
-
149
-
150
- const __vue_component__ = __vue_normalize__(
151
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
152
- __vue_inject_styles__,
153
- __vue_script__,
154
- __vue_scope_id__,
155
- __vue_is_functional_template__,
156
- __vue_module_identifier__,
157
- false,
158
- undefined,
159
- undefined,
160
- undefined
161
- );
162
-
163
- export default __vue_component__;
@@ -1,308 +0,0 @@
1
- import { CONTEXT_ITEM_CATEGORY_DEPENDENCY, CONTEXT_ITEM_CATEGORY_FILE, CONTEXT_ITEM_CATEGORY_LOCAL_GIT, CONTEXT_ITEM_CATEGORY_ISSUE, CONTEXT_ITEM_CATEGORY_MERGE_REQUEST } from './constants';
2
-
3
- /**
4
- * This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
5
- *
6
- * Please use the corresponding component in Duo-UI going forward.
7
- * All future development and maintenance for Duo components should take place in Duo-UI.
8
- *
9
- * 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.
10
- */
11
- const MOCK_CATEGORIES = [{
12
- label: 'Files',
13
- value: CONTEXT_ITEM_CATEGORY_FILE,
14
- icon: 'document'
15
- }, {
16
- label: 'Local Git',
17
- value: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
18
- icon: 'git'
19
- }, {
20
- label: 'Issues',
21
- value: CONTEXT_ITEM_CATEGORY_ISSUE,
22
- icon: 'issues'
23
- }, {
24
- label: 'Merge Requests',
25
- value: CONTEXT_ITEM_CATEGORY_MERGE_REQUEST,
26
- icon: 'merge-request'
27
- }, {
28
- label: 'Dependencies',
29
- value: CONTEXT_ITEM_CATEGORY_DEPENDENCY,
30
- icon: 'package'
31
- }];
32
- function getMockCategory(categoryValue) {
33
- return MOCK_CATEGORIES.find(cat => cat.value === categoryValue);
34
- }
35
- const MOCK_CONTEXT_FILE_CONTENT = `export function waterPlants() {
36
- console.log('sprinkle');
37
- }`;
38
- const MOCK_CONTEXT_FILE_DIFF_CONTENT = `diff --git a/src/plants/strawberry.ts b/src/plants/strawberry.ts
39
- index 1234567..8901234 100644
40
- --- a/src/plants/strawberry.ts
41
- +++ b/src/plants/strawberry.ts
42
- @@ -1,4 +1,4 @@
43
- export const strawberry = {
44
- name: 'Strawberry',
45
- - waterNeeds: 'moderate',
46
- + waterNeeds: 'high',
47
- };`;
48
- const MOCK_CONTEXT_ITEM_FILE = {
49
- id: '123e4567-e89b-12d3-a456-426614174000',
50
- category: CONTEXT_ITEM_CATEGORY_FILE,
51
- metadata: {
52
- enabled: true,
53
- title: 'strawberry.ts',
54
- secondaryText: 'src/plants/strawberry.ts',
55
- subTypeLabel: 'Project file',
56
- icon: 'document',
57
- project: 'example/garden',
58
- relativePath: 'src/plants/strawberry.ts'
59
- }
60
- };
61
- const MOCK_CONTEXT_ITEM_FILE_DISABLED = {
62
- id: '323e4567-e89b-12d3-a456-426614174002',
63
- category: CONTEXT_ITEM_CATEGORY_FILE,
64
- metadata: {
65
- enabled: false,
66
- title: 'motorbike.cs',
67
- secondaryText: '/src/VehicleFoo/motorbike.cs',
68
- subTypeLabel: 'Project file',
69
- icon: 'document',
70
- project: 'example/vehicles',
71
- relativePath: '/src/VehicleFoo/motorbike.cs'
72
- }
73
- };
74
- const mockFiles = [MOCK_CONTEXT_ITEM_FILE, {
75
- id: '223e4567-e89b-12d3-a456-426614174001',
76
- category: CONTEXT_ITEM_CATEGORY_FILE,
77
- metadata: {
78
- enabled: true,
79
- title: 'potato.ts',
80
- secondaryText: '/src/plants/potato.ts',
81
- subTypeLabel: 'Project file',
82
- icon: 'document',
83
- project: 'example/garden',
84
- relativePath: '/src/plants/potato.ts'
85
- }
86
- }, MOCK_CONTEXT_ITEM_FILE_DISABLED];
87
- const MOCK_CONTEXT_ITEM_ISSUE = {
88
- id: '423e4567-e89b-12d3-a456-426614174003',
89
- category: CONTEXT_ITEM_CATEGORY_ISSUE,
90
- metadata: {
91
- enabled: true,
92
- title: 'Implement watering schedule',
93
- secondaryText: 'example/garden#1234',
94
- subTypeLabel: 'Issue',
95
- icon: 'issues',
96
- iid: 1234
97
- }
98
- };
99
- const MOCK_CONTEXT_ITEM_ISSUE_DISABLED = {
100
- id: 'c463fb31-2a4c-4f8e-a609-97230ac48ae5',
101
- category: CONTEXT_ITEM_CATEGORY_ISSUE,
102
- metadata: {
103
- enabled: false,
104
- disabledReasons: ['This foo is not available to bar', 'Lorem something something wow?'],
105
- title: `Fix vehicle colours and make them look real nice and colourful won't that be wonderful wow this issue title is really long I sure hope it's gonna wrap OK`,
106
- secondaryText: 'example/vehicle#91011',
107
- subTypeLabel: 'Issue',
108
- icon: 'issues',
109
- iid: 91011
110
- }
111
- };
112
- const mockIssues = [MOCK_CONTEXT_ITEM_ISSUE, {
113
- id: '523e4567-e89b-12d3-a456-426614174004',
114
- category: CONTEXT_ITEM_CATEGORY_ISSUE,
115
- metadata: {
116
- enabled: true,
117
- title: 'Refactor plant growth rates',
118
- secondaryText: 'example/garden#5678',
119
- subTypeLabel: 'Issue',
120
- icon: 'issues',
121
- iid: 5678
122
- }
123
- }, MOCK_CONTEXT_ITEM_ISSUE_DISABLED];
124
- const MOCK_CONTEXT_ITEM_MERGE_REQUEST = {
125
- id: '623e4567-e89b-12d3-a456-426614174005',
126
- category: CONTEXT_ITEM_CATEGORY_MERGE_REQUEST,
127
- metadata: {
128
- enabled: true,
129
- title: 'Improve database performance',
130
- secondaryText: 'example/garden!1122',
131
- subTypeLabel: 'Merge request',
132
- icon: 'merge-request',
133
- iid: 1122
134
- }
135
- };
136
- const MOCK_CONTEXT_ITEM_MERGE_REQUEST_DISABLED = {
137
- id: '4eb665fc-e5e1-49b0-9789-2a16964e461a',
138
- category: CONTEXT_ITEM_CATEGORY_MERGE_REQUEST,
139
- metadata: {
140
- enabled: false,
141
- disabledReasons: ['This foo is not available to bar', 'Lorem something something wow?'],
142
- title: 'Fix broken layout at small viewports',
143
- secondaryText: 'example/vehicle!5566',
144
- subTypeLabel: 'Merge request',
145
- icon: 'merge-request',
146
- iid: 5566
147
- }
148
- };
149
- const mockMergeRequests = [MOCK_CONTEXT_ITEM_MERGE_REQUEST, {
150
- id: '723e4567-e89b-12d3-a456-426614174006',
151
- category: CONTEXT_ITEM_CATEGORY_MERGE_REQUEST,
152
- metadata: {
153
- enabled: false,
154
- disabledReasons: ['This foo is not available to bar', 'Lorem something something wow?'],
155
- title: 'Add vehicle registration details',
156
- secondaryText: 'example/vehicle!3344',
157
- subTypeLabel: 'Merge request',
158
- icon: 'merge-request',
159
- iid: 3344
160
- }
161
- }, MOCK_CONTEXT_ITEM_MERGE_REQUEST_DISABLED];
162
- const MOCK_CONTEXT_ITEM_GIT_DIFF = {
163
- id: '6d88b466-0c38-48d6-b271-deda47f97cee',
164
- category: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
165
- metadata: {
166
- enabled: true,
167
- title: 'Current working changes',
168
- secondaryText: 'main',
169
- subType: 'local_git',
170
- subTypeLabel: 'Local Git repository diff',
171
- icon: 'comparison',
172
- commitId: 'main',
173
- repositoryName: 'example/garden',
174
- gitType: 'diff'
175
- }
176
- };
177
- const MOCK_CONTEXT_ITEM_GIT_COMMIT = {
178
- id: '20f8caf94cb8f5e5f9dbd1a9ac32702321de201b',
179
- category: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
180
- metadata: {
181
- enabled: true,
182
- title: 'fix: some bug fix commit',
183
- secondaryText: '20f8caf94cb8f5e5f9dbd1a9ac32702321de201b',
184
- subType: 'local_git',
185
- subTypeLabel: 'Local Git repository commit',
186
- icon: 'commit',
187
- commitId: '20f8caf94cb8f5e5f9dbd1a9ac32702321de201b',
188
- repositoryName: 'example/garden',
189
- gitType: 'commit'
190
- }
191
- };
192
- const mockGitItems = [MOCK_CONTEXT_ITEM_GIT_DIFF, {
193
- id: 'diff-example/garden',
194
- category: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
195
- metadata: {
196
- enabled: true,
197
- title: 'Diff from default branch',
198
- secondaryText: 'main',
199
- subTypeLabel: 'Local Git repository diff',
200
- icon: 'comparison',
201
- commitId: 'main',
202
- repositoryName: 'example/garden',
203
- gitType: 'diff'
204
- }
205
- }, MOCK_CONTEXT_ITEM_GIT_COMMIT, {
206
- id: '32b9b56b6de75b32909986755fbc470f20fb6fc0',
207
- category: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
208
- metadata: {
209
- enabled: true,
210
- title: 'feat: add cool new feature',
211
- secondaryText: '32b9b56b6de75b32909986755fbc470f20fb6fc0',
212
- subTypeLabel: 'Local Git repository commit',
213
- icon: 'commit',
214
- commitId: '32b9b56b6de75b32909986755fbc470f20fb6fc0',
215
- repositoryName: 'example/garden',
216
- gitType: 'commit'
217
- }
218
- }, {
219
- id: '775d7efdce25c1af48c55abcadbefd1f181b92ce',
220
- category: CONTEXT_ITEM_CATEGORY_LOCAL_GIT,
221
- metadata: {
222
- enabled: true,
223
- title: 'fix: stop foo from bar when baz because customers ding',
224
- secondaryText: '775d7efdce25c1af48c55abcadbefd1f181b92ce',
225
- subTypeLabel: 'Local Git repository commit',
226
- icon: 'commit',
227
- commitId: '775d7efdce25c1af48c55abcadbefd1f181b92ce',
228
- repositoryName: 'example/garden',
229
- gitType: 'commit'
230
- }
231
- }];
232
- const MOCK_CONTEXT_ITEM_DEPENDENCY = {
233
- id: '823e4567-e89b-12d3-a456-426614174007',
234
- category: CONTEXT_ITEM_CATEGORY_DEPENDENCY,
235
- content: JSON.stringify([{
236
- javascript: ['@types/node@16.11.7', '@vue/compiler-sfc@3.2.37', 'typescript@4.5.5', 'vue@3.2.37']
237
- }]),
238
- metadata: {
239
- enabled: true,
240
- title: 'example/garden',
241
- secondaryText: 'package.json',
242
- icon: 'package',
243
- subType: 'dependency',
244
- subTypeLabel: 'Project dependencies',
245
- project: 'example/garden'
246
- }
247
- };
248
- const MOCK_CONTEXT_ITEM_DEPENDENCY_DISABLED = {
249
- id: '923e4567-e89b-12d3-a456-426614174008',
250
- category: CONTEXT_ITEM_CATEGORY_DEPENDENCY,
251
- content: JSON.stringify([{
252
- javascript: ['@types/node@16.11.7', '@vue/compiler-sfc@3.2.37', 'typescript@4.5.5', 'vue@3.2.37'],
253
- csharp: ['newtonsoft.json@13.0.1', 'microsoft.net.test.sdk@16.11.0']
254
- }]),
255
- metadata: {
256
- enabled: false,
257
- disabledReasons: ['Dependencies are not available for this project', 'Access restricted'],
258
- title: 'example/vehicle',
259
- secondaryText: 'package.json, vehicle.csproj',
260
- icon: 'package',
261
- subType: 'dependency',
262
- subTypeLabel: 'Project dependencies',
263
- project: 'example/vehicle'
264
- }
265
- };
266
- const mockDependencies = [MOCK_CONTEXT_ITEM_DEPENDENCY, MOCK_CONTEXT_ITEM_DEPENDENCY_DISABLED, {
267
- id: 'b23e4567-e89b-12d3-a456-426614174010',
268
- category: CONTEXT_ITEM_CATEGORY_DEPENDENCY,
269
- content: JSON.stringify([{
270
- python: ['django@3.2.9', 'djangorestframework@3.12.4', 'psycopg2@2.9.2', 'celery@5.2.1'],
271
- csharp: ['newtonsoft.json@13.0.1', 'microsoft.net.test.sdk@16.11.0']
272
- }]),
273
- metadata: {
274
- enabled: true,
275
- title: 'example/backend',
276
- secondaryText: 'requirements.txt, some.backend.csproj',
277
- icon: 'package',
278
- subType: 'dependency',
279
- subTypeLabel: 'Project dependencies',
280
- project: 'example/backend'
281
- }
282
- }, {
283
- id: 'c23e4567-e89b-12d3-a456-426614174011',
284
- category: CONTEXT_ITEM_CATEGORY_DEPENDENCY,
285
- content: JSON.stringify([{
286
- javascript: ['jquery@3.5.1', 'backbone@1.4.0', 'underscore@1.13.1', 'moment@2.29.1']
287
- }]),
288
- metadata: {
289
- enabled: false,
290
- disabledReasons: ['Project is archived'],
291
- title: 'example/legacy',
292
- secondaryText: 'bower.json',
293
- icon: 'package',
294
- subType: 'dependency',
295
- subTypeLabel: 'Project dependencies',
296
- project: 'example/legacy'
297
- }
298
- }];
299
- const getMockContextItems = () => {
300
- const allItems = [...mockFiles, ...mockGitItems, ...mockIssues, ...mockMergeRequests, ...mockDependencies];
301
-
302
- // put disabled items in the back
303
- const disabledItems = allItems.filter(item => !item.metadata.enabled);
304
- const enabledItems = allItems.filter(item => item.metadata.enabled);
305
- return [...enabledItems, ...disabledItems];
306
- };
307
-
308
- export { MOCK_CATEGORIES, MOCK_CONTEXT_FILE_CONTENT, MOCK_CONTEXT_FILE_DIFF_CONTENT, MOCK_CONTEXT_ITEM_DEPENDENCY, MOCK_CONTEXT_ITEM_DEPENDENCY_DISABLED, MOCK_CONTEXT_ITEM_FILE, MOCK_CONTEXT_ITEM_FILE_DISABLED, MOCK_CONTEXT_ITEM_GIT_COMMIT, MOCK_CONTEXT_ITEM_GIT_DIFF, MOCK_CONTEXT_ITEM_ISSUE, MOCK_CONTEXT_ITEM_ISSUE_DISABLED, MOCK_CONTEXT_ITEM_MERGE_REQUEST, MOCK_CONTEXT_ITEM_MERGE_REQUEST_DISABLED, getMockCategory, getMockContextItems };