fix(ui) Fix bug with date dropdown in deprecation modal (#12633)

This commit is contained in:
Chris Collins 2025-02-26 09:53:33 -05:00 committed by GitHub
parent 7cfee8bc04
commit eaa17a073d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View File

@ -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={

View File

@ -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 };