mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 01:18:20 +00:00
fix(ui) Fix bug with date dropdown in deprecation modal (#12633)
This commit is contained in:
parent
7cfee8bc04
commit
eaa17a073d
@ -1,6 +1,7 @@
|
||||
import { MoreOutlined } from '@ant-design/icons';
|
||||
import React, { useContext } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { useAppConfig } from '@src/app/useAppConfig';
|
||||
import { useEntityData, useRefetch } from '../../../entity/shared/EntityContext';
|
||||
import ShareMenuAction from '../../../shared/share/v2/ShareMenuAction';
|
||||
import EntitySidebarContext from '../../../sharedV2/EntitySidebarContext';
|
||||
@ -63,6 +64,8 @@ function EntityMenuActions(props: Props) {
|
||||
|
||||
const refetch = useRefetch();
|
||||
|
||||
const { entityVersioningEnabled } = useAppConfig().config.featureFlags;
|
||||
|
||||
const hasVersioningActions = !!(menuItems.has(EntityMenuItems.LINK_VERSION) || entityData?.versionProperties);
|
||||
return (
|
||||
<>
|
||||
@ -76,7 +79,7 @@ function EntityMenuActions(props: Props) {
|
||||
<DeleteEntityMenuItem onDelete={onDelete} options={options} />
|
||||
)}
|
||||
{menuItems.has(EntityMenuItems.RAISE_INCIDENT) && <RaiseIncidentMenuAction />}
|
||||
{hasVersioningActions && (
|
||||
{entityVersioningEnabled && hasVersioningActions && (
|
||||
<MoreOptionsContainer>
|
||||
<MoreOptionsMenuAction
|
||||
menuItems={
|
||||
|
||||
@ -1,7 +1,23 @@
|
||||
// Dayjs is missing core functionality without this. It causes issues in setting default value of antd datepicker without.
|
||||
import dayjs from 'dayjs';
|
||||
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import localeData from 'dayjs/plugin/localeData';
|
||||
import weekday from 'dayjs/plugin/weekday';
|
||||
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
||||
import weekYear from 'dayjs/plugin/weekYear';
|
||||
|
||||
import * as Browse from './Browse';
|
||||
import * as Global from './Global';
|
||||
import * as Search from './Search';
|
||||
import * as Browse from './Browse';
|
||||
|
||||
dayjs.extend(customParseFormat);
|
||||
dayjs.extend(advancedFormat);
|
||||
dayjs.extend(weekday);
|
||||
dayjs.extend(localeData);
|
||||
dayjs.extend(weekOfYear);
|
||||
dayjs.extend(weekYear);
|
||||
|
||||
// TODO: A way to populate configs without code changes?
|
||||
// TOOD: Entity-oriented configurations?
|
||||
export { Global as GlobalCfg, Search as SearchCfg, Browse as BrowseCfg };
|
||||
export { Browse as BrowseCfg, Global as GlobalCfg, Search as SearchCfg };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user