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:
Chirag Madlani 2025-04-10 18:13:20 +05:30 committed by GitHub
parent 018f8e823b
commit 81b09f768c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 30 deletions

View File

@ -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 (

View File

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

View File

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

View File

@ -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 ??