@gitlab/ui 78.0.0 → 78.1.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [78.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.0.0...v78.1.0) (2024-03-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlDuoChat:** explicitly disable Experimental Badge ([d701cc9](https://gitlab.com/gitlab-org/gitlab-ui/commit/d701cc95e9af956ce17c3b4c75ea4d481cadde59))
7
+
1
8
  # [78.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v77.7.0...v78.0.0) (2024-03-05)
2
9
 
3
10
 
@@ -119,7 +119,7 @@ var script = {
119
119
  * The type of the badge. This is passed down to the `GlExperimentBadge` component. Refer that component for more information.
120
120
  */
121
121
  badgeType: {
122
- type: String,
122
+ type: String || null,
123
123
  required: false,
124
124
  default: badgeTypes[0],
125
125
  validator: badgeTypeValidator
@@ -343,7 +343,7 @@ var script = {
343
343
  const __vue_script__ = script;
344
344
 
345
345
  /* template */
346
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block gl-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0",attrs:{"data-testid":"chat-header"}},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_c('gl-experiment-badge',{attrs:{"help-page-url":_vm.badgeHelpPageUrl,"type":_vm.badgeType,"container-id":"chat-component"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e()],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-bg-gray-10",class:[
346
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block gl-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0",attrs:{"data-testid":"chat-header"}},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),(_vm.badgeType)?_c('gl-experiment-badge',{attrs:{"help-page-url":_vm.badgeHelpPageUrl,"type":_vm.badgeType,"container-id":"chat-component"}}):_vm._e(),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e()],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-bg-gray-10",class:[
347
347
  {
348
348
  'gl-h-full': !_vm.hasMessages,
349
349
  'force-scroll-bar': _vm.hasMessages,
@@ -1,4 +1,4 @@
1
- const badgeTypes = ['experiment', 'beta'];
1
+ const badgeTypes = ['experiment', 'beta', null];
2
2
  const badgeTypeValidator = value => badgeTypes.includes(value);
3
3
 
4
4
  export { badgeTypeValidator, badgeTypes };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 10:22:05 GMT
3
+ * Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 10:22:05 GMT
3
+ * Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 10:22:05 GMT
3
+ * Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 05 Mar 2024 10:22:05 GMT
3
+ * Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 05 Mar 2024 10:22:06 GMT
3
+ // Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
 
5
5
  $gl-text-tertiary: #737278 !default;
6
6
  $gl-text-secondary: #89888d !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 05 Mar 2024 10:22:05 GMT
3
+ // Generated on Tue, 05 Mar 2024 12:25:08 GMT
4
4
 
5
5
  $gl-text-tertiary: #89888d !default;
6
6
  $gl-text-secondary: #737278 !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "78.0.0",
3
+ "version": "78.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -126,6 +126,15 @@ describe('GlDuoChat', () => {
126
126
  expect(component().exists()).toBe(shouldRender);
127
127
  });
128
128
 
129
+ it('does not render the experimental label if it is explicitely disabled', () => {
130
+ createComponent({
131
+ propsData: {
132
+ badgeType: null,
133
+ },
134
+ });
135
+ expect(findBadge().exists()).toBe(false);
136
+ });
137
+
129
138
  describe('when messages exist', () => {
130
139
  it('scrolls to the bottom on load', async () => {
131
140
  const scrollIntoViewMock = jest.fn();
@@ -127,7 +127,7 @@ export default {
127
127
  * The type of the badge. This is passed down to the `GlExperimentBadge` component. Refer that component for more information.
128
128
  */
129
129
  badgeType: {
130
- type: String,
130
+ type: String || null,
131
131
  required: false,
132
132
  default: badgeTypes[0],
133
133
  validator: badgeTypeValidator,
@@ -369,6 +369,7 @@ export default {
369
369
  >
370
370
  <h3 class="gl-my-0 gl-font-size-h2">{{ title }}</h3>
371
371
  <gl-experiment-badge
372
+ v-if="badgeType"
372
373
  :help-page-url="badgeHelpPageUrl"
373
374
  :type="badgeType"
374
375
  container-id="chat-component"
@@ -1,2 +1,2 @@
1
- export const badgeTypes = ['experiment', 'beta'];
1
+ export const badgeTypes = ['experiment', 'beta', null];
2
2
  export const badgeTypeValidator = (value) => badgeTypes.includes(value);