mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-01 20:04:52 +00:00
Fix(UI): Incorrect Data model count (#22726)
* fixed data model tab count * moved types to interface file
This commit is contained in:
parent
98276fe8ad
commit
41e9a23e29
@ -33,3 +33,8 @@ export interface DataModelDetailsProps {
|
|||||||
) => Promise<void>;
|
) => Promise<void>;
|
||||||
handleToggleDelete: (version?: number) => void;
|
handleToggleDelete: (version?: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DataModelTableProps {
|
||||||
|
showDeleted: boolean;
|
||||||
|
handleShowDeleted: (checked: boolean) => void;
|
||||||
|
}
|
||||||
|
@ -50,12 +50,15 @@ import ErrorPlaceHolder from '../../../common/ErrorWithPlaceholder/ErrorPlaceHol
|
|||||||
import { NextPreviousProps } from '../../../common/NextPrevious/NextPrevious.interface';
|
import { NextPreviousProps } from '../../../common/NextPrevious/NextPrevious.interface';
|
||||||
import RichTextEditorPreviewerNew from '../../../common/RichTextEditor/RichTextEditorPreviewNew';
|
import RichTextEditorPreviewerNew from '../../../common/RichTextEditor/RichTextEditorPreviewNew';
|
||||||
import Table from '../../../common/Table/Table';
|
import Table from '../../../common/Table/Table';
|
||||||
|
import { DataModelTableProps } from './DataModelDetails.interface';
|
||||||
|
|
||||||
const DataModelTable = () => {
|
const DataModelTable = ({
|
||||||
|
showDeleted,
|
||||||
|
handleShowDeleted,
|
||||||
|
}: DataModelTableProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { fqn } = useFqn();
|
const { fqn } = useFqn();
|
||||||
const [dataModels, setDataModels] = useState<Array<ServicePageData>>();
|
const [dataModels, setDataModels] = useState<Array<ServicePageData>>();
|
||||||
const [showDeleted, setShowDeleted] = useState(false);
|
|
||||||
const {
|
const {
|
||||||
currentPage,
|
currentPage,
|
||||||
pageSize,
|
pageSize,
|
||||||
@ -157,7 +160,7 @@ const DataModelTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleShowDeletedChange = (checked: boolean) => {
|
const handleShowDeletedChange = (checked: boolean) => {
|
||||||
setShowDeleted(checked);
|
handleShowDeleted(checked);
|
||||||
handlePageChange(INITIAL_PAGING_VALUE);
|
handlePageChange(INITIAL_PAGING_VALUE);
|
||||||
handlePageSizeChange(PAGE_SIZE_BASE);
|
handlePageSizeChange(PAGE_SIZE_BASE);
|
||||||
};
|
};
|
||||||
|
@ -1162,7 +1162,7 @@ const ServiceDetailsPage: FunctionComponent = () => {
|
|||||||
if (serviceCategory === ServiceCategory.DASHBOARD_SERVICES) {
|
if (serviceCategory === ServiceCategory.DASHBOARD_SERVICES) {
|
||||||
fetchDashboardsDataModel({ limit: 0 });
|
fetchDashboardsDataModel({ limit: 0 });
|
||||||
}
|
}
|
||||||
}, []);
|
}, [showDeleted]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (servicePermission.ViewAll || servicePermission.ViewBasic) {
|
if (servicePermission.ViewAll || servicePermission.ViewBasic) {
|
||||||
@ -1419,7 +1419,12 @@ const ServiceDetailsPage: FunctionComponent = () => {
|
|||||||
name: t('label.data-model'),
|
name: t('label.data-model'),
|
||||||
key: EntityTabs.DATA_Model,
|
key: EntityTabs.DATA_Model,
|
||||||
count: dataModelPaging.total,
|
count: dataModelPaging.total,
|
||||||
children: <DataModelTable />,
|
children: (
|
||||||
|
<DataModelTable
|
||||||
|
handleShowDeleted={handleShowDeleted}
|
||||||
|
showDeleted={showDeleted}
|
||||||
|
/>
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user