Skip to content
Snippets Groups Projects
Commit 02be21a9 authored by Miguel Rincon's avatar Miguel Rincon
Browse files

Deprecate DEFAULT_TH_CLASSES

parent f5e8e86a
No related merge requests found
import { s__, __ } from '~/locale';
// eslint-disable-next-line import/no-deprecated
import { DEFAULT_TH_CLASSES } from '~/lib/utils/constants';
/* Error constants */
......@@ -32,6 +33,7 @@ export const RUN_JOB_NOW_HEADER_TITLE = s__('DelayedJobs|Run the delayed job now
const defaultTableClasses = {
tdClass: 'gl-p-5!',
// eslint-disable-next-line import/no-deprecated
thClass: DEFAULT_TH_CLASSES,
};
// eslint-disable-next-line @gitlab/require-i18n-strings
......
......@@ -19,6 +19,9 @@ export const BV_HIDE_TOOLTIP = 'bv::hide::tooltip';
export const BV_DROPDOWN_SHOW = 'bv::dropdown::show';
export const BV_DROPDOWN_HIDE = 'bv::dropdown::hide';
/**
* @deprecated These classes no longer need to be applied. See https://gitlab.com/gitlab-org/gitlab/-/issues/362362
*/
export const DEFAULT_TH_CLASSES =
'gl-bg-transparent! gl-border-b-solid! gl-border-b-gray-100! gl-p-5! gl-border-b-1!';
......
import { convertToSnakeCase, convertToCamelCase } from '~/lib/utils/text_utility';
// eslint-disable-next-line import/no-deprecated
import { DEFAULT_TH_CLASSES } from './constants';
/**
......@@ -7,6 +8,7 @@ import { DEFAULT_TH_CLASSES } from './constants';
* @param {Number} width - The column width as a percentage.
* @returns {String} The classes to be used in GlTable fields object.
*/
// eslint-disable-next-line import/no-deprecated
export const thWidthClass = (width) => `gl-w-${width}p ${DEFAULT_TH_CLASSES}`;
/**
......
import { formatNumber } from '~/locale';
// eslint-disable-next-line import/no-deprecated
import { DEFAULT_TH_CLASSES } from '~/lib/utils/constants';
import { RUNNER_JOB_COUNT_LIMIT } from './constants';
......@@ -28,6 +29,7 @@ export const tableField = ({ key, label = '', thClasses = [], ...options }) => {
return {
key,
label,
// eslint-disable-next-line import/no-deprecated
thClass: [DEFAULT_TH_CLASSES, ...thClasses],
tdAttr: {
'data-testid': `td-${key}`,
......
<script>
import { GlTable } from '@gitlab/ui';
import { mapState } from 'vuex';
// eslint-disable-next-line import/no-deprecated
import { DEFAULT_TH_CLASSES } from '~/lib/utils/constants';
import { thWidthClass } from '~/lib/utils/table_utility';
import { __, s__ } from '~/locale';
......@@ -65,6 +66,7 @@ export default {
{
key: 'actions',
label: '',
// eslint-disable-next-line import/no-deprecated
thClass: DEFAULT_TH_CLASSES,
tdClass: 'gl-text-right',
},
......
// eslint-disable-next-line import/no-deprecated
import { DEFAULT_TH_CLASSES } from '~/lib/utils/constants';
import * as tableUtils from '~/lib/utils/table_utility';
......@@ -5,6 +6,7 @@ describe('table_utility', () => {
describe('thWidthClass', () => {
it('returns the width class including default table header classes', () => {
const width = 50;
// eslint-disable-next-line import/no-deprecated
expect(tableUtils.thWidthClass(width)).toBe(`gl-w-${width}p ${DEFAULT_TH_CLASSES}`);
});
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment