@gitlab/ui 40.2.1 → 40.2.2

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 (110) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/base/alert/alert.js +1 -0
  3. package/dist/components/base/avatar/avatar.js +1 -0
  4. package/dist/components/base/badge/badge.js +1 -0
  5. package/dist/components/base/breadcrumb/breadcrumb.js +1 -0
  6. package/dist/components/base/button/button.js +1 -0
  7. package/dist/components/base/card/card.js +1 -0
  8. package/dist/components/base/carousel/carousel.js +1 -0
  9. package/dist/components/base/collapse/collapse.js +1 -0
  10. package/dist/components/base/drawer/drawer.js +1 -0
  11. package/dist/components/base/dropdown/dropdown.js +2 -0
  12. package/dist/components/base/form/form.js +1 -0
  13. package/dist/components/base/icon/icon.js +2 -0
  14. package/dist/components/base/label/label.js +1 -0
  15. package/dist/components/base/link/link.js +1 -0
  16. package/dist/components/base/markdown/markdown.js +1 -0
  17. package/dist/components/base/modal/modal.js +2 -0
  18. package/dist/components/base/pagination/pagination.js +2 -0
  19. package/dist/components/base/popover/popover.js +1 -0
  20. package/dist/components/base/table/table.js +2 -0
  21. package/dist/components/base/tabs/tabs/tabs.js +2 -0
  22. package/dist/components/base/token/token.js +1 -0
  23. package/dist/components/base/tooltip/tooltip.js +1 -0
  24. package/dist/components/charts/area/area.js +1 -15
  25. package/dist/components/charts/bar/bar.js +1 -0
  26. package/dist/components/charts/chart/chart.js +1 -0
  27. package/dist/components/charts/column/column.js +1 -0
  28. package/dist/components/charts/heatmap/heatmap.js +1 -0
  29. package/dist/components/charts/legend/legend.js +1 -0
  30. package/dist/components/charts/line/line.js +1 -17
  31. package/dist/components/charts/sparkline/sparkline.js +2 -0
  32. package/dist/components/charts/tooltip/tooltip.js +1 -0
  33. package/dist/components/utilities/intersperse/intersperse.js +2 -0
  34. package/dist/components/utilities/truncate/truncate.js +1 -0
  35. package/dist/index.css +1 -1
  36. package/dist/index.css.map +1 -1
  37. package/dist/utils/test_utils.js +3 -1
  38. package/package.json +2 -2
  39. package/src/components/base/alert/alert.vue +1 -0
  40. package/src/components/base/avatar/avatar.vue +1 -0
  41. package/src/components/base/badge/badge.vue +1 -0
  42. package/src/components/base/breadcrumb/breadcrumb.spec.js +1 -1
  43. package/src/components/base/breadcrumb/breadcrumb.vue +1 -0
  44. package/src/components/base/button/button.vue +1 -0
  45. package/src/components/base/card/card.vue +1 -0
  46. package/src/components/base/carousel/carousel.vue +1 -0
  47. package/src/components/base/collapse/collapse.vue +1 -0
  48. package/src/components/base/datepicker/datepicker.vue +1 -0
  49. package/src/components/base/drawer/drawer.vue +1 -0
  50. package/src/components/base/dropdown/dropdown.vue +1 -0
  51. package/src/components/base/form/form.vue +1 -0
  52. package/src/components/base/form/form_group/form_group.scss +4 -1
  53. package/src/components/base/form/form_group/form_group.stories.js +1 -1
  54. package/src/components/base/icon/icon.spec.js +1 -1
  55. package/src/components/base/icon/icon.vue +1 -0
  56. package/src/components/base/keyset_pagination/keyset_pagination.spec.js +1 -1
  57. package/src/components/base/label/label.vue +1 -0
  58. package/src/components/base/link/link.vue +1 -0
  59. package/src/components/base/markdown/markdown.vue +1 -0
  60. package/src/components/base/modal/modal.spec.js +1 -1
  61. package/src/components/base/modal/modal.vue +1 -0
  62. package/src/components/base/new_dropdowns/listbox/listbox.vue +1 -0
  63. package/src/components/base/paginated_list/paginated_list.vue +1 -1
  64. package/src/components/base/pagination/pagination.spec.js +1 -1
  65. package/src/components/base/pagination/pagination.vue +1 -0
  66. package/src/components/base/path/path.vue +1 -0
  67. package/src/components/base/popover/popover.vue +1 -0
  68. package/src/components/base/search_box_by_click/search_box_by_click.spec.js +1 -1
  69. package/src/components/base/search_box_by_click/search_box_by_click.vue +2 -2
  70. package/src/components/base/search_box_by_type/search_box_by_type.spec.js +1 -1
  71. package/src/components/base/table/table.vue +1 -0
  72. package/src/components/base/tabs/tab/tab.vue +1 -0
  73. package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +1 -1
  74. package/src/components/base/tabs/tabs/tabs.vue +1 -0
  75. package/src/components/base/toggle/toggle.vue +1 -0
  76. package/src/components/base/token/token.vue +1 -0
  77. package/src/components/base/token_selector/token_container.spec.js +1 -1
  78. package/src/components/base/tooltip/tooltip.vue +1 -0
  79. package/src/components/charts/area/area.spec.js +2 -3
  80. package/src/components/charts/area/area.vue +1 -0
  81. package/src/components/charts/bar/bar.spec.js +2 -2
  82. package/src/components/charts/bar/bar.vue +1 -0
  83. package/src/components/charts/chart/chart.spec.js +1 -1
  84. package/src/components/charts/chart/chart.vue +1 -0
  85. package/src/components/charts/column/column.vue +1 -0
  86. package/src/components/charts/column/column_chart.spec.js +2 -2
  87. package/src/components/charts/gauge/gauge.spec.js +1 -1
  88. package/src/components/charts/gauge/gauge.vue +1 -0
  89. package/src/components/charts/heatmap/heatmap.spec.js +2 -2
  90. package/src/components/charts/heatmap/heatmap.vue +1 -0
  91. package/src/components/charts/legend/legend.spec.js +1 -1
  92. package/src/components/charts/legend/legend.vue +1 -0
  93. package/src/components/charts/line/line.spec.js +2 -4
  94. package/src/components/charts/line/line.vue +1 -0
  95. package/src/components/charts/sparkline/sparkline.spec.js +2 -2
  96. package/src/components/charts/sparkline/sparkline.vue +1 -0
  97. package/src/components/charts/stacked_column/stacked_column.spec.js +3 -4
  98. package/src/components/charts/tooltip/tooltip.spec.js +1 -1
  99. package/src/components/charts/tooltip/tooltip.vue +1 -0
  100. package/src/components/regions/empty_state/empty_state.spec.js +1 -1
  101. package/src/components/utilities/animated_number/animated_number.spec.js +1 -1
  102. package/src/components/utilities/intersection_observer/intersection_observer.spec.js +1 -1
  103. package/src/components/utilities/intersperse/intersperse.vue +1 -0
  104. package/src/components/utilities/sprintf/sprintf.vue +1 -0
  105. package/src/components/utilities/truncate/truncate.spec.js +1 -1
  106. package/src/components/utilities/truncate/truncate.vue +1 -0
  107. package/src/directives/hover_load/hover_load.spec.js +3 -1
  108. package/src/directives/outside/outside.spec.js +4 -1
  109. package/src/directives/resize_observer/resize_observer.spec.js +1 -1
  110. package/src/utils/test_utils.js +4 -1
@@ -7,7 +7,9 @@ function setStoryTimeout(fn, timeout) {
7
7
  } // adopted this method from Bootstraps utils
8
8
  // https://github.com/bootstrap-vue/bootstrap-vue/blob/2fd03f0b1d0cc41f9930078ba8b1c16b10e4ac2f/tests/utils.js#L6
9
9
 
10
- const waitForAnimationFrame = () => new Promise(resolve => requestAnimationFrame(resolve));
10
+ const waitForAnimationFrame = () => new Promise(resolve => {
11
+ requestAnimationFrame(resolve);
12
+ });
11
13
  const getResetAnimationsCSS = () => `
12
14
  *, *::after, *::before {
13
15
  -webkit-transition: none !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "40.2.1",
3
+ "version": "40.2.2",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -81,7 +81,7 @@
81
81
  "@arkweid/lefthook": "0.7.7",
82
82
  "@babel/core": "^7.10.2",
83
83
  "@babel/preset-env": "^7.10.2",
84
- "@gitlab/eslint-plugin": "12.0.1",
84
+ "@gitlab/eslint-plugin": "12.2.0",
85
85
  "@gitlab/stylelint-config": "4.0.0",
86
86
  "@gitlab/svgs": "2.14.0",
87
87
  "@rollup/plugin-commonjs": "^11.1.0",
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import {
3
4
  alertVariantOptions,
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { avatarShapeOptions, avatarSizeOptions } from '../../../utils/constants';
3
4
  import { getAvatarChar } from '../../../utils/string_utils';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BBadge } from 'bootstrap-vue';
3
4
  import { badgeSizeOptions, badgeVariantOptions } from '../../../utils/constants';
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
  import { nextTick } from 'vue';
3
+ import { createMockDirective } from '~helpers/vue_mock_directive';
3
4
  import Breadcrumb, { COLLAPSE_AT_SIZE } from './breadcrumb.vue';
4
5
  import GlBreadcrumbItem from './breadcrumb_item.vue';
5
- import { createMockDirective } from '~helpers/vue_mock_directive';
6
6
 
7
7
  describe('Breadcrumb component', () => {
8
8
  let wrapper;
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BBreadcrumb } from 'bootstrap-vue';
3
4
  import GlIcon from '../icon/icon.vue';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BButton } from 'bootstrap-vue';
3
4
  import {
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  export default {
3
4
  props: {
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BCarousel } from 'bootstrap-vue';
3
4
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BCollapse } from 'bootstrap-vue';
3
4
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { isString } from 'lodash';
3
4
  import Pikaday from 'pikaday';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import isEmpty from 'lodash/isEmpty';
3
4
  import { maxZIndex, drawerVariants } from '../../../utils/constants';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BDropdown } from 'bootstrap-vue';
3
4
  import { isVisible, selectAll } from 'bootstrap-vue/src/utils/dom';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BForm } from 'bootstrap-vue/src/components/form';
3
4
 
@@ -25,7 +25,10 @@
25
25
 
26
26
  .form-control {
27
27
  + .invalid-feedback,
28
- + .text-gl-muted {
28
+ + .text-gl-muted,
29
+ &.is-valid + .invalid-feedback + .text-gl-muted {
30
+ // See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2806
31
+ // for the reasoning behind the "valid+invalid" selector above
29
32
  @include gl-mt-3;
30
33
  }
31
34
  }
@@ -81,7 +81,7 @@ export const WithValidations = (_args, { argTypes }) => ({
81
81
  invalidFeedback() {
82
82
  let feedbackText = 'This field is required.';
83
83
 
84
- if (this.name.length > 4) {
84
+ if (this.name.length >= 4) {
85
85
  feedbackText = '';
86
86
  } else if (this.name.length > 0) {
87
87
  feedbackText = 'Enter at least 4 characters.';
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import Icon from './icon.vue';
3
2
  import { iconSizeOptions } from '~/utils/constants';
3
+ import Icon from './icon.vue';
4
4
 
5
5
  const ICONS_PATH = '/path/to/icons.svg';
6
6
  const TEST_SIZE = 8;
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import iconsPath from '@gitlab/svgs/dist/icons.svg';
3
4
  import { iconSizeOptions } from '../../../utils/constants';
@@ -10,7 +10,7 @@ describe('GlKeysetPagination', () => {
10
10
  const buttonTagName = 'BUTTON';
11
11
  const linkTagName = 'A';
12
12
 
13
- const createComponent = (props = {}, scopedSlots) => {
13
+ const createComponent = (props = {}, scopedSlots = {}) => {
14
14
  wrapper = mount(GlKeysetPagination, {
15
15
  propsData: props,
16
16
  scopedSlots,
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { labelColorOptions } from '../../../utils/constants';
3
4
  import { colorFromBackground } from '../../../utils/utils';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BLink } from 'bootstrap-vue';
3
4
  import { SafeLinkMixin } from '../../mixins/safe_link_mixin';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  export default {
3
4
  props: {
@@ -1,11 +1,11 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
  import { BModal } from 'bootstrap-vue';
3
3
  import { merge } from 'lodash';
4
+ import { modalButtonDefaults } from '~/utils/constants';
4
5
  import CloseButton from '../../shared_components/close_button/close_button.vue';
5
6
  import Button from '../button/button.vue';
6
7
  import { logWarning } from '../../../utils/utils';
7
8
  import Modal from './modal.vue';
8
- import { modalButtonDefaults } from '~/utils/constants';
9
9
 
10
10
  const BModalStub = merge({}, BModal.options, {
11
11
  methods: {
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BModal } from 'bootstrap-vue';
3
4
  import {
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { clamp, uniqueId } from 'lodash';
3
4
  import { stopEvent } from '../../../../utils/utils';
@@ -150,7 +150,7 @@ export default {
150
150
 
151
151
  <ul class="list-group list-group-flush list-unstyled">
152
152
  <li v-for="listItem in paginatedList" :key="listItem[itemKey]" class="list-group-item">
153
- <slot :listItem="listItem" :query="queryStr">{{ listItem.id }}</slot>
153
+ <slot :list-item="listItem" :query="queryStr">{{ listItem.id }}</slot>
154
154
  </li>
155
155
  </ul>
156
156
 
@@ -1,7 +1,7 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import debounce from 'lodash/debounce';
3
- import Pagination from './pagination.vue';
4
3
  import { breakpoints } from '~/utils/breakpoints';
4
+ import Pagination from './pagination.vue';
5
5
 
6
6
  jest.mock('lodash/debounce', () => jest.fn((fn) => fn));
7
7
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import debounce from 'lodash/debounce';
3
4
  import isFunction from 'lodash/isFunction';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
3
4
  import { uniqueId, findLast } from 'lodash';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BPopover } from 'bootstrap-vue';
3
4
  import tooltipMixin from '../../mixins/tooltip_mixin';
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import ClearIcon from '~/components/shared_components/clear_icon_button/clear_icon_button.vue';
2
3
  import GlDropdownItem from '../dropdown/dropdown_item.vue';
3
4
  import GlFormInput from '../form/form_input/form_input.vue';
4
5
  import SearchBoxByClick from './search_box_by_click.vue';
5
- import ClearIcon from '~/components/shared_components/clear_icon_button/clear_icon_button.vue';
6
6
 
7
7
  const GlFormInputGroupStub = {
8
8
  template: `
@@ -237,7 +237,7 @@ export default {
237
237
  @click="selectHistoryItem(item)"
238
238
  >
239
239
  <!-- @slot Slot to customize history item in history dropdown. Used only with history-items prop -->
240
- <slot name="history-item" :historyItem="item">{{ item }}</slot>
240
+ <slot name="history-item" :history-item="item">{{ item }}</slot>
241
241
  </gl-dropdown-item>
242
242
  <gl-dropdown-divider />
243
243
  <gl-dropdown-item ref="clearHistory" @click="emitClearHistory">{{
@@ -269,7 +269,7 @@ export default {
269
269
  data-testid="filtered-search-clear-button"
270
270
  @click="clearInput"
271
271
  />
272
- <template #append class="gl-search-box-by-click-input-group-control">
272
+ <template #append>
273
273
  <gl-button
274
274
  v-bind="searchButtonAttributes"
275
275
  ref="searchButton"
@@ -1,7 +1,7 @@
1
1
  import { mount, shallowMount } from '@vue/test-utils';
2
+ import ClearIcon from '~/components/shared_components/clear_icon_button/clear_icon_button.vue';
2
3
  import LoadingIcon from '../loading_icon/loading_icon.vue';
3
4
  import SearchBoxByType from './search_box_by_type.vue';
4
- import ClearIcon from '~/components/shared_components/clear_icon_button/clear_icon_button.vue';
5
5
 
6
6
  const modelEvent = SearchBoxByType.model.event;
7
7
  const newValue = 'new value';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BTable } from 'bootstrap-vue';
3
4
  import { logWarning, isDev } from '../../../utils/utils';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BTab } from 'bootstrap-vue';
3
4
  import { isArray, isPlainObject } from 'lodash';
@@ -1,9 +1,9 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import { range, mapValues } from 'lodash';
3
+ import { useMockResizeObserver } from '~helpers/mock_dom_observer';
3
4
  import GlTab from '../tab/tab.vue';
4
5
  import GlScrollableTabs from './scrollable_tabs.vue';
5
6
  import GlTabs from './tabs.vue';
6
- import { useMockResizeObserver } from '~helpers/mock_dom_observer';
7
7
 
8
8
  const { NAV_CLASS } = GlScrollableTabs;
9
9
  const TEST_WIDTH = 600;
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BTabs } from 'bootstrap-vue';
3
4
  import { tabsButtonDefaults } from '../../../../utils/constants';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { uniqueId } from 'lodash';
3
4
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { tokenVariants } from '../../../utils/constants';
3
4
  import CloseButton from '../../shared_components/close_button/close_button.vue';
@@ -1,8 +1,8 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
 
3
+ import { keyboard } from '~/utils/constants';
3
4
  import GlToken from '../token/token.vue';
4
5
  import GlTokenContainer from './token_container.vue';
5
- import { keyboard } from '~/utils/constants';
6
6
 
7
7
  describe('GlTokenContainer', () => {
8
8
  const tokens = [
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { BTooltip } from 'bootstrap-vue';
3
4
  import { tooltipDelay } from '../../../utils/constants';
@@ -1,12 +1,11 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
+ import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
4
+ import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
3
5
  import Chart from '../chart/chart.vue';
4
6
  import ChartLegend from '../legend/legend.vue';
5
7
  import AreaChart from './area.vue';
6
8
 
7
- import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
8
- import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
9
-
10
9
  let mockChartInstance;
11
10
 
12
11
  jest.mock('echarts', () => ({
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  /**
3
4
  * Area charts as of %12.10 support annotations.
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import Chart from '../chart/chart.vue';
3
- import BarChart from './bar.vue';
4
2
  import TooltipDefaultFormat from '~/components/shared_components/charts/tooltip_default_format.vue';
5
3
  import { createMockChartInstance } from '~helpers/chart_stubs';
4
+ import Chart from '../chart/chart.vue';
5
+ import BarChart from './bar.vue';
6
6
 
7
7
  let mockChartInstance;
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import merge from 'lodash/merge';
3
4
  import truncate from 'lodash/truncate';
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
  import * as echarts from 'echarts';
3
- import Chart from './chart.vue';
4
3
  import createTheme from '~/utils/charts/theme';
5
4
  import { useMockResizeObserver } from '~helpers/mock_dom_observer';
5
+ import Chart from './chart.vue';
6
6
 
7
7
  const defaultHeight = 400;
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import * as echarts from 'echarts';
3
4
  import { defaultHeight, defaultWidth, validRenderers } from '../../../utils/charts/config';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import merge from 'lodash/merge';
3
4
  import defaultChartOptions, {
@@ -1,4 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
2
3
  import {
3
4
  mockDefaultLineData,
4
5
  mockDefaultBarData,
@@ -6,7 +7,6 @@ import {
6
7
  } from '../../../utils/charts/mock_data';
7
8
  import Chart from '../chart/chart.vue';
8
9
  import ColumnChart from './column.vue';
9
- import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
10
10
 
11
11
  let mockChartInstance;
12
12
 
@@ -28,7 +28,7 @@ describe('column chart component', () => {
28
28
  const findTooltip = () => wrapper.findComponent(ChartTooltipStub);
29
29
  const getChartOptions = () => findChart().props('options');
30
30
 
31
- const factory = (props = defaultChartProps, slots) => {
31
+ const factory = (props = defaultChartProps, slots = {}) => {
32
32
  wrapper = shallowMount(ColumnChart, {
33
33
  propsData: { ...props },
34
34
  stubs: {
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { createMockChartInstance } from '~helpers/chart_stubs';
2
3
  import { gaugeSafeHues, gaugeWarningHue } from '../../../utils/charts/theme';
3
4
  import Chart from '../chart/chart.vue';
4
5
  import GlGauge from './gauge.vue';
5
- import { createMockChartInstance } from '~helpers/chart_stubs';
6
6
 
7
7
  const placeholder = '--';
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import { merge, isFinite, uniq, sortBy } from 'lodash';
3
4
  import { gaugeNeutralHues, gaugeSafeHues, gaugeWarningHue } from '../../../utils/charts/theme';
@@ -1,10 +1,10 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
+ import { TOOLTIP_LEFT_OFFSET } from '~/utils/charts/constants';
4
+ import { createMockChartInstance } from '~helpers/chart_stubs';
3
5
  import Chart from '../chart/chart.vue';
4
6
  import ChartTooltip from '../tooltip/tooltip.vue';
5
7
  import HeatMapChart from './heatmap.vue';
6
- import { TOOLTIP_LEFT_OFFSET } from '~/utils/charts/constants';
7
- import { createMockChartInstance } from '~helpers/chart_stubs';
8
8
 
9
9
  let mockChartInstance;
10
10
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import merge from 'lodash/merge';
3
4
  import { white, gray100 } from '../../../../scss_to_js/scss_variables';
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { createMockChartInstance } from '~helpers/chart_stubs';
2
3
  import Chart from '../chart/chart.vue';
3
4
  import GlChartSeriesLabel from '../series_label/series_label.vue';
4
5
  import Legend from './legend.vue';
5
- import { createMockChartInstance } from '~helpers/chart_stubs';
6
6
 
7
7
  let mockChartInstance;
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import * as echarts from 'echarts';
3
4
  import { gray200 } from '../../../../scss_to_js/scss_variables'; // eslint-disable-line import/no-unresolved
@@ -1,13 +1,11 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
+ import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
4
+ import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
3
5
  import Chart from '../chart/chart.vue';
4
6
  import ChartLegend from '../legend/legend.vue';
5
7
  import LineChart from './line.vue';
6
8
 
7
- import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
8
-
9
- import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
10
-
11
9
  let mockChartInstance;
12
10
 
13
11
  jest.mock('echarts', () => ({
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  /**
3
4
  * Line charts as of %12.10 support annotations.
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import Chart from '../chart/chart.vue';
3
- import SparklineChart from './sparkline.vue';
4
2
  import { waitForAnimationFrame } from '~/utils/test_utils';
5
3
  import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
4
+ import Chart from '../chart/chart.vue';
5
+ import SparklineChart from './sparkline.vue';
6
6
 
7
7
  let mockChartInstance;
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import merge from 'lodash/merge';
3
4
  import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
@@ -1,5 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
+ import TooltipDefaultFormat from '~/components/shared_components/charts/tooltip_default_format.vue';
4
+ import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
5
+ import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
3
6
  import {
4
7
  mockDefaultStackedLineData,
5
8
  mockDefaultStackedBarData,
@@ -9,10 +12,6 @@ import Chart from '../chart/chart.vue';
9
12
  import ChartLegend from '../legend/legend.vue';
10
13
  import * as themeUtils from '../../../utils/charts/theme';
11
14
  import StackedColumnChart from './stacked_column.vue';
12
- import TooltipDefaultFormat from '~/components/shared_components/charts/tooltip_default_format.vue';
13
-
14
- import { createMockChartInstance, ChartTooltipStub } from '~helpers/chart_stubs';
15
- import { LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE } from '~/utils/charts/constants';
16
15
 
17
16
  let mockChartInstance;
18
17
 
@@ -1,8 +1,8 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { createMockChartInstance } from '~helpers/chart_stubs';
2
3
  import GlPopover from '../../base/popover/popover.vue';
3
4
  import { popoverPlacements } from '../../../utils/constants';
4
5
  import ChartTooltip from './tooltip.vue';
5
- import { createMockChartInstance } from '~helpers/chart_stubs';
6
6
 
7
7
  let mockChartInstance;
8
8
 
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import * as echarts from 'echarts';
3
4
  import { uid } from '../../../utils/utils';
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import EmptyState from './empty_state.vue';
3
2
  import Button from '~/components/base/button/button.vue';
3
+ import EmptyState from './empty_state.vue';
4
4
 
5
5
  describe('empty state component', () => {
6
6
  let component;
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import GlAnimatedNumber from './animated_number.vue';
3
2
  import { waitForAnimationFrame } from '~/utils/test_utils';
3
+ import GlAnimatedNumber from './animated_number.vue';
4
4
 
5
5
  const duration = 2000;
6
6
  const ACTION_ANIMATED = 'animated';
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import GlIntersectionObserver from './intersection_observer.vue';
3
2
  import useMockIntersectionObserver from '~/utils/use_mock_intersection_observer';
3
+ import GlIntersectionObserver from './intersection_observer.vue';
4
4
 
5
5
  const TEST_SLOT = '<p>Hello world! Lorem ipsum.</p>';
6
6
  const ENTRY_INTERSECTING = { ratio: 0.75, isIntersecting: true };
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  import compose from 'lodash/fp/compose';
3
4
  import fill from 'lodash/fp/fill';
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <script>
2
3
  /* eslint-disable no-continue */
3
4
  import { has, isString } from 'lodash';
@@ -1,7 +1,7 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
+ import { createMockDirective, getBinding } from '~helpers/vue_mock_directive';
2
3
  import { POSITION } from './constants';
3
4
  import Truncate from './truncate.vue';
4
- import { createMockDirective, getBinding } from '~helpers/vue_mock_directive';
5
5
 
6
6
  const removeSpecialChar = (text) => {
7
7
  return text.replace(/&lrm;|\u200E/gi, '');