mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-07 04:56:54 +00:00
fix(ui): data-insight layout and delete widget messaging (#20743)
* fix(ui): data-insight layout fix unwanted reserve-right-sidebar * fix entityType with startCase
This commit is contained in:
parent
018f8e823b
commit
81b09f768c
@ -32,7 +32,6 @@ import { LimitBanner } from '../common/LimitBanner/LimitBanner';
|
||||
import LeftSidebar from '../MyData/LeftSidebar/LeftSidebar.component';
|
||||
import NavBar from '../NavBar/NavBar';
|
||||
import applicationsClassBase from '../Settings/Applications/AppDetails/ApplicationsClassBase';
|
||||
import { useApplicationsProvider } from '../Settings/Applications/ApplicationsProvider/ApplicationsProvider';
|
||||
import './app-container.less';
|
||||
|
||||
const { Content } = Layout;
|
||||
@ -40,7 +39,6 @@ const { Content } = Layout;
|
||||
const AppContainer = () => {
|
||||
const { currentUser, setAppPreferences, appPreferences } =
|
||||
useApplicationStore();
|
||||
const { applications } = useApplicationsProvider();
|
||||
const AuthenticatedRouter = applicationRoutesClass.getRouteElements();
|
||||
const ApplicationExtras = applicationsClassBase.getApplicationExtension();
|
||||
const { isAuthenticated } = useApplicationStore();
|
||||
@ -65,23 +63,12 @@ const AppContainer = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const appendReserveRightSidebarClass = useCallback(() => {
|
||||
const element = document.getElementsByTagName('body');
|
||||
element[0].classList.add('reserve-right-sidebar');
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (currentUser?.id) {
|
||||
fetchAppConfigurations();
|
||||
}
|
||||
}, [currentUser?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (applicationsClassBase.isFloatingButtonPresent(applications)) {
|
||||
appendReserveRightSidebarClass();
|
||||
}
|
||||
}, [applications]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleDocumentVisibilityChange = () => {
|
||||
if (
|
||||
|
||||
@ -17,10 +17,11 @@
|
||||
@summary-card-bg-hover: #f0f1f3;
|
||||
|
||||
.data-insight-card {
|
||||
border-radius: 10px;
|
||||
border-radius: @border-radius-md;
|
||||
|
||||
.ant-card-head {
|
||||
border-bottom: none;
|
||||
padding: 8px 16px 0px;
|
||||
padding: @padding-sm @padding-md 0px;
|
||||
}
|
||||
.custom-data-insight-tooltip {
|
||||
.ant-card-head {
|
||||
@ -32,7 +33,7 @@
|
||||
}
|
||||
}
|
||||
.ant-card-body {
|
||||
padding: 16px 16px;
|
||||
padding: @padding-mlg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
import { FC } from 'react';
|
||||
import { App, AppType } from '../../../../generated/entity/applications/app';
|
||||
import { AppType } from '../../../../generated/entity/applications/app';
|
||||
import { getScheduleOptionsFromSchedules } from '../../../../utils/SchedularUtils';
|
||||
|
||||
class ApplicationsClassBase {
|
||||
@ -52,12 +52,6 @@ class ApplicationsClassBase {
|
||||
return [];
|
||||
}
|
||||
|
||||
public isFloatingButtonPresent(applications: App[]) {
|
||||
return applications.some((app) =>
|
||||
this.getFloatingApplicationEntityList().includes(app.name)
|
||||
);
|
||||
}
|
||||
|
||||
public importAppScreenshot(screenshotName: string) {
|
||||
return import(`../../../../assets/img/appScreenshots/${screenshotName}`);
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ import {
|
||||
} from 'antd';
|
||||
import Input, { InputRef } from 'antd/lib/input/Input';
|
||||
import { AxiosError } from 'axios';
|
||||
import { startCase } from 'lodash';
|
||||
import React, {
|
||||
ChangeEvent,
|
||||
useCallback,
|
||||
@ -77,21 +78,32 @@ const DeleteWidgetModal = ({
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const deleteTextInputRef = useRef<InputRef>(null);
|
||||
const entityTypeName = useMemo(() => {
|
||||
return startCase(entityType);
|
||||
}, [entityType]);
|
||||
|
||||
const DELETE_OPTION = useMemo(
|
||||
() => [
|
||||
{
|
||||
title: `${t('label.delete')} ${entityType} "${entityName}"`,
|
||||
description: `${deleteWidgetClassBase.getDeleteMessage(
|
||||
entityName,
|
||||
entityType,
|
||||
true
|
||||
)} ${softDeleteMessagePostFix}`,
|
||||
title: `${t('label.delete')} ${entityTypeName} "${entityName}"`,
|
||||
description: (
|
||||
<>
|
||||
$
|
||||
{deleteWidgetClassBase.getDeleteMessage(
|
||||
entityName,
|
||||
entityType,
|
||||
true
|
||||
)}
|
||||
${softDeleteMessagePostFix}
|
||||
</>
|
||||
),
|
||||
type: DeleteType.SOFT_DELETE,
|
||||
isAllowed: allowSoftDelete,
|
||||
},
|
||||
{
|
||||
title: `${t('label.permanently-delete')} ${entityType} "${entityName}"`,
|
||||
title: `${t(
|
||||
'label.permanently-delete'
|
||||
)} ${entityTypeName} "${entityName}"`,
|
||||
description: (
|
||||
<>
|
||||
{deleteMessage ??
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user