Fix(UI): Incorrect Data model count (#22726)

* fixed data model tab count

* moved types to interface file
This commit is contained in:
Dhruv Parmar 2025-08-05 10:15:59 +05:30 committed by GitHub
parent 98276fe8ad
commit 41e9a23e29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 5 deletions

View File

@ -33,3 +33,8 @@ export interface DataModelDetailsProps {
) => Promise<void>;
handleToggleDelete: (version?: number) => void;
}
export interface DataModelTableProps {
showDeleted: boolean;
handleShowDeleted: (checked: boolean) => void;
}

View File

@ -50,12 +50,15 @@ import ErrorPlaceHolder from '../../../common/ErrorWithPlaceholder/ErrorPlaceHol
import { NextPreviousProps } from '../../../common/NextPrevious/NextPrevious.interface';
import RichTextEditorPreviewerNew from '../../../common/RichTextEditor/RichTextEditorPreviewNew';
import Table from '../../../common/Table/Table';
import { DataModelTableProps } from './DataModelDetails.interface';
const DataModelTable = () => {
const DataModelTable = ({
showDeleted,
handleShowDeleted,
}: DataModelTableProps) => {
const { t } = useTranslation();
const { fqn } = useFqn();
const [dataModels, setDataModels] = useState<Array<ServicePageData>>();
const [showDeleted, setShowDeleted] = useState(false);
const {
currentPage,
pageSize,
@ -157,7 +160,7 @@ const DataModelTable = () => {
};
const handleShowDeletedChange = (checked: boolean) => {
setShowDeleted(checked);
handleShowDeleted(checked);
handlePageChange(INITIAL_PAGING_VALUE);
handlePageSizeChange(PAGE_SIZE_BASE);
};

View File

@ -1162,7 +1162,7 @@ const ServiceDetailsPage: FunctionComponent = () => {
if (serviceCategory === ServiceCategory.DASHBOARD_SERVICES) {
fetchDashboardsDataModel({ limit: 0 });
}
}, []);
}, [showDeleted]);
useEffect(() => {
if (servicePermission.ViewAll || servicePermission.ViewBasic) {
@ -1419,7 +1419,12 @@ const ServiceDetailsPage: FunctionComponent = () => {
name: t('label.data-model'),
key: EntityTabs.DATA_Model,
count: dataModelPaging.total,
children: <DataModelTable />,
children: (
<DataModelTable
handleShowDeleted={handleShowDeleted}
showDeleted={showDeleted}
/>
),
});
}