Skip to content

Commit eaa17a0

Browse files
fix(ui) Fix bug with date dropdown in deprecation modal (#12633)
1 parent 7cfee8b commit eaa17a0

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

datahub-web-react/src/app/entityV2/shared/EntityDropdown/EntityMenuActions.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MoreOutlined } from '@ant-design/icons';
22
import React, { useContext } from 'react';
33
import styled from 'styled-components';
4+
import { useAppConfig } from '@src/app/useAppConfig';
45
import { useEntityData, useRefetch } from '../../../entity/shared/EntityContext';
56
import ShareMenuAction from '../../../shared/share/v2/ShareMenuAction';
67
import EntitySidebarContext from '../../../sharedV2/EntitySidebarContext';
@@ -63,6 +64,8 @@ function EntityMenuActions(props: Props) {
6364

6465
const refetch = useRefetch();
6566

67+
const { entityVersioningEnabled } = useAppConfig().config.featureFlags;
68+
6669
const hasVersioningActions = !!(menuItems.has(EntityMenuItems.LINK_VERSION) || entityData?.versionProperties);
6770
return (
6871
<>
@@ -76,7 +79,7 @@ function EntityMenuActions(props: Props) {
7679
<DeleteEntityMenuItem onDelete={onDelete} options={options} />
7780
)}
7881
{menuItems.has(EntityMenuItems.RAISE_INCIDENT) && <RaiseIncidentMenuAction />}
79-
{hasVersioningActions && (
82+
{entityVersioningEnabled && hasVersioningActions && (
8083
<MoreOptionsContainer>
8184
<MoreOptionsMenuAction
8285
menuItems={

datahub-web-react/src/conf/index.ts

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
// Dayjs is missing core functionality without this. It causes issues in setting default value of antd datepicker without.
2+
import dayjs from 'dayjs';
3+
import advancedFormat from 'dayjs/plugin/advancedFormat';
4+
import customParseFormat from 'dayjs/plugin/customParseFormat';
5+
import localeData from 'dayjs/plugin/localeData';
6+
import weekday from 'dayjs/plugin/weekday';
7+
import weekOfYear from 'dayjs/plugin/weekOfYear';
8+
import weekYear from 'dayjs/plugin/weekYear';
9+
10+
import * as Browse from './Browse';
111
import * as Global from './Global';
212
import * as Search from './Search';
3-
import * as Browse from './Browse';
13+
14+
dayjs.extend(customParseFormat);
15+
dayjs.extend(advancedFormat);
16+
dayjs.extend(weekday);
17+
dayjs.extend(localeData);
18+
dayjs.extend(weekOfYear);
19+
dayjs.extend(weekYear);
420

521
// TODO: A way to populate configs without code changes?
622
// TOOD: Entity-oriented configurations?
7-
export { Global as GlobalCfg, Search as SearchCfg, Browse as BrowseCfg };
23+
export { Browse as BrowseCfg, Global as GlobalCfg, Search as SearchCfg };

0 commit comments

Comments
 (0)