fix#11003: added show deleted switch for required pages (#12073)

* Added show deleted switch in the required pages

* fixed entity details page bug for soft deleted entities

* replaced tailwind styling and added data-testids

* fixed failing cypress tests
This commit is contained in:
Aniket Katkar 2023-06-22 11:22:39 +05:30 committed by GitHub
parent 10ba297961
commit 159b5f131f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 219 additions and 167 deletions

View File

@ -115,21 +115,16 @@ describe('Restore entity functionality should work properly', () => {
.contains(ENTITY_TABLE.schemaName)
.click();
cy.get('[data-testid="manage-button"]').should('exist').click();
cy.get('[data-testid="deleted-table-menu-item-label"]')
.should('exist')
.contains('Show Deleted Table');
interceptURL(
'GET',
'/api/v1/search/query?q=*&index=table_search_index&from=0&size=10&deleted=true&sort_field=name.keyword&sort_order=asc',
'queryDeletedTables'
);
cy.get('[data-testid="deleted-table-menu-item-switch')
.should('exist')
.click();
cy.get('[data-testid="show-deleted"]').should('exist').click();
verifyResponseStatusCode('@queryDeletedTables', 200);
cy.get('[data-testid="table"] [data-testid="count"]')
.should('exist')
.contains('1');

View File

@ -356,11 +356,7 @@ describe('Teams flow should work properly', () => {
// Check if soft deleted team is shown when 'Deleted Teams' switch is on
cy.get('table').should('not.contain', TEAM_DETAILS.name);
cy.get('[data-testid="header"] [data-testid="manage-button"]')
.should('exist')
.click();
cy.get('[data-testid="deleted-menu-item-switch"').should('exist').click();
cy.get('[data-testid="show-deleted"').should('exist').click();
interceptURL(
'GET',

View File

@ -11,7 +11,7 @@
* limitations under the License.
*/
import { Table } from 'antd';
import { Col, Table } from 'antd';
import { ColumnsType } from 'antd/lib/table';
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
import NextPrevious from 'components/common/next-previous/NextPrevious';
@ -74,7 +74,7 @@ const DataModelTable = ({
}
return (
<div data-testid="table-container">
<Col data-testid="table-container" span={24}>
<Table
bordered
className="mt-4 table-shadow"
@ -98,7 +98,7 @@ const DataModelTable = ({
totalCount={paging.total}
/>
)}
</div>
</Col>
);
};

View File

@ -30,7 +30,6 @@ import { ReactComponent as ExportIcon } from 'assets/svg/ic-export.svg';
import { ReactComponent as ImportIcon } from 'assets/svg/ic-import.svg';
import { ReactComponent as IconRestore } from 'assets/svg/ic-restore.svg';
import { ReactComponent as IconOpenLock } from 'assets/svg/open-lock.svg';
import { ReactComponent as IconShowPassword } from 'assets/svg/show-password.svg';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { ManageButtonItemLabel } from 'components/common/ManageButtonContentItem/ManageButtonContentItem.component';
@ -195,7 +194,7 @@ const TeamDetailsV1 = ({
}>(DELETE_USER_INITIAL_STATE);
const [searchTerm, setSearchTerm] = useState('');
const [table, setTable] = useState<Team[]>([]);
const [slashedDatabaseName, setSlashedDatabaseName] = useState<
const [slashedTeamName, setSlashedTeamName] = useState<
TitleBreadcrumbProps['titleLinks']
>([]);
const [addAttribute, setAddAttribute] = useState<AddAttribute>();
@ -612,7 +611,7 @@ const TeamDetailsV1 = ({
url: '',
},
];
setSlashedDatabaseName(breadcrumb);
setSlashedTeamName(breadcrumb);
setHeading(currentTeam.displayName || currentTeam.name);
}
}, [currentTeam, parentTeams, showDeletedTeam]);
@ -669,42 +668,6 @@ const TeamDetailsV1 = ({
});
}, []);
const DELETED_TOGGLE_MENU_ITEM = {
label: (
<ManageButtonItemLabel
description={t('message.view-deleted-entity', {
entity: t('label.team-plural'),
parent: t('label.team'),
})}
icon={<IconShowPassword {...DROPDOWN_ICON_SIZE_PROPS} />}
id="deleted-team-dropdown"
name={
<Row>
<Col span={21}>
<Typography.Text
className="font-medium"
data-testid="deleted-menu-item-label">
{t('label.show-deleted-entity', {
entity: t('label.team'),
})}
</Typography.Text>
</Col>
<Col span={3}>
<Switch
checked={showDeletedTeam}
data-testid="deleted-menu-item-switch"
size="small"
/>
</Col>
</Row>
}
/>
),
onClick: onShowDeletedTeamChange,
key: 'deleted-team-dropdown',
};
const IMPORT_EXPORT_MENU_ITEM = useMemo(() => {
const options = [
{
@ -795,9 +758,6 @@ const TeamDetailsV1 = ({
onClick: handleOpenToJoinToggle,
key: 'open-group-dropdown',
},
...(currentTeam.teamType === TeamType.BusinessUnit
? [DELETED_TOGGLE_MENU_ITEM]
: []),
],
[
entityPermissions,
@ -1024,10 +984,7 @@ const TeamDetailsV1 = ({
{!isEmpty(currentTeam) ? (
<Fragment>
{!isOrganization && (
<TitleBreadcrumb
className="p-b-xs"
titleLinks={slashedDatabaseName}
/>
<TitleBreadcrumb className="p-b-xs" titleLinks={slashedTeamName} />
)}
<div
className="d-flex tw-justify-between tw-items-center"
@ -1067,10 +1024,7 @@ const TeamDetailsV1 = ({
<ManageButton
canDelete={false}
entityName={currentTeam.fullyQualifiedName ?? currentTeam.name}
extraDropdownContent={[
...IMPORT_EXPORT_MENU_ITEM,
DELETED_TOGGLE_MENU_ITEM,
]}
extraDropdownContent={[...IMPORT_EXPORT_MENU_ITEM]}
/>
)}
</div>
@ -1149,6 +1103,16 @@ const TeamDetailsV1 = ({
</Col>
<Col>
<Space align="center">
<span>
<Switch
checked={showDeletedTeam}
data-testid="show-deleted"
onClick={onShowDeletedTeamChange}
/>
<Typography.Text className="m-l-xs">
{t('label.deleted')}
</Typography.Text>
</span>
<Button
data-testid="add-team"
disabled={!createTeamPermission}

View File

@ -185,14 +185,10 @@ const UserListV1: FC<UserListV1Props> = ({
<span>
<Switch
checked={showDeletedUser}
size="small"
data-testid="show-deleted"
onClick={onShowDeletedUserChange}
/>
<span className="tw-ml-2">
{t('label.deleted-entity', {
entity: t('label.user-plural'),
})}
</span>
<span className="m-l-xs">{t('label.deleted')}</span>
</span>
</Col>
<Col className="mt-24" span={24}>
@ -227,13 +223,10 @@ const UserListV1: FC<UserListV1Props> = ({
<span>
<Switch
checked={showDeletedUser}
data-testid="show-deleted"
onClick={onShowDeletedUserChange}
/>
<span className="tw-ml-2">
{t('label.deleted-entity', {
entity: t('label.user-plural'),
})}
</span>
<span className="m-l-xs">{t('label.deleted')}</span>
</span>
<Tooltip
placement="topLeft"

View File

@ -52,6 +52,7 @@ import { CreateThread, ThreadType } from 'generated/api/feed/createThread';
import { Container } from 'generated/entity/data/container';
import { EntityLineage } from 'generated/type/entityLineage';
import { EntityReference } from 'generated/type/entityReference';
import { Include } from 'generated/type/include';
import { LabelType, State, TagLabel, TagSource } from 'generated/type/tagLabel';
import { EntityFieldThreadCount } from 'interface/feed.interface';
import { isUndefined, omitBy, toString } from 'lodash';
@ -155,7 +156,8 @@ const ContainerPage = () => {
try {
const response = await getContainerByName(
containerFQN,
'parent,dataModel,owner,tags,followers,extension'
'parent,dataModel,owner,tags,followers,extension',
Include.All
);
setContainerData({
...response,

View File

@ -26,6 +26,7 @@ import { EntityType } from 'enums/entity.enum';
import { compare } from 'fast-json-patch';
import { CreateThread } from 'generated/api/feed/createThread';
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
import { Include } from 'generated/type/include';
import { LabelType, State, TagSource } from 'generated/type/tagLabel';
import { EntityFieldThreadCount } from 'interface/feed.interface';
import { isUndefined, omitBy } from 'lodash';
@ -148,7 +149,8 @@ const DataModelsPage = () => {
try {
const response = await getDataModelsByName(
dashboardDataModelFQN,
'owner,tags,followers'
'owner,tags,followers',
Include.All
);
setDataModelData(response);
} catch (error) {

View File

@ -20,7 +20,6 @@ import {
Tabs,
Typography,
} from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { ColumnsType } from 'antd/lib/table';
import { AxiosError } from 'axios';
import ActivityFeedProvider, {
@ -44,7 +43,6 @@ import {
ResourceEntity,
} from 'components/PermissionProvider/PermissionProvider.interface';
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
import { DROPDOWN_ICON_SIZE_PROPS } from 'constants/ManageButton.constants';
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
import { compare, Operation } from 'fast-json-patch';
import { TagLabel } from 'generated/type/tagLabel';
@ -69,7 +67,6 @@ import {
import { getFeedCount, postThread } from 'rest/feedsAPI';
import { searchQuery } from 'rest/searchAPI';
import { default as appState } from '../../AppState';
import { ReactComponent as IconShowPassword } from '../../assets/svg/show-password.svg';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import {
getDatabaseDetailsPath,
@ -560,53 +557,6 @@ const DatabaseSchemaPage: FunctionComponent = () => {
);
};
const extraDropdownContent: ItemType[] = useMemo(
() => [
{
label: (
<Row className="cursor-pointer" data-testid="deleted-table-menu-item">
<Col span={3}>
<IconShowPassword {...DROPDOWN_ICON_SIZE_PROPS} />
</Col>
<Col span={21}>
<Row>
<Col span={21}>
<Typography.Text
className="font-medium"
data-testid="deleted-table-menu-item-label">
{t('label.show-deleted-entity', {
entity: t('label.table'),
})}
</Typography.Text>
</Col>
<Col span={3}>
<Switch
checked={showDeletedTables}
data-testid="deleted-table-menu-item-switch"
size="small"
onChange={setShowDeletedTables}
/>
</Col>
<Col className="p-t-xss">
<Typography.Paragraph className="text-grey-muted text-xs m-b-0 line-height-16">
{t('message.view-deleted-entity', {
entity: t('label.table-plural'),
parent: t('label.schema'),
})}
</Typography.Paragraph>
</Col>
</Row>
</Col>
</Row>
),
key: 'deleted-team-dropdown',
},
],
[showDeletedTables]
);
const handleRestoreDatabaseSchema = useCallback(async () => {
try {
await restoreDatabaseSchema(databaseSchemaId);
@ -707,7 +657,6 @@ const DatabaseSchemaPage: FunctionComponent = () => {
entityId={databaseSchemaId}
entityName={databaseSchemaName}
entityType={EntityType.DATABASE_SCHEMA}
extraDropdownContent={extraDropdownContent}
extraInfo={extraInfo}
followersList={[]}
permission={databaseSchemaPermission}
@ -768,6 +717,20 @@ const DatabaseSchemaPage: FunctionComponent = () => {
onThreadLinkSelect={onThreadLinkSelect}
/>
</Col>
<Col span={24}>
<Row justify="end">
<Col>
<Switch
checked={showDeletedTables}
data-testid="show-deleted"
onClick={setShowDeletedTables}
/>
<Typography.Text className="m-l-xs">
{t('label.deleted')}
</Typography.Text>{' '}
</Col>
</Row>
</Col>
{getSchemaTableList()}
</Row>
)}

View File

@ -11,7 +11,16 @@
* limitations under the License.
*/
import { Col, Row, Skeleton, Space, Table, Tabs } from 'antd';
import {
Col,
Row,
Skeleton,
Space,
Switch,
Table,
Tabs,
Typography,
} from 'antd';
import { ColumnsType } from 'antd/lib/table';
import { AxiosError } from 'axios';
import ActivityFeedProvider, {
@ -40,6 +49,7 @@ import TagsContainer from 'components/Tag/TagsContainer/tags-container';
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
import { compare, Operation } from 'fast-json-patch';
import { LabelType } from 'generated/entity/data/table';
import { Include } from 'generated/type/include';
import { State } from 'generated/type/tagLabel';
import { isEmpty, isNil, isUndefined, startCase } from 'lodash';
import { observer } from 'mobx-react';
@ -111,6 +121,7 @@ const DatabaseDetails: FunctionComponent = () => {
const { databaseFQN, tab: activeTab = EntityTabs.SCHEMA } =
useParams<{ databaseFQN: string; tab: EntityTabs }>();
const [isLoading, setIsLoading] = useState(true);
const [showDeletedSchemas, setShowDeletedSchemas] = useState<boolean>(false);
const [database, setDatabase] = useState<Database>();
const [serviceType, setServiceType] = useState<string>();
const [schemaData, setSchemaData] = useState<DatabaseSchema[]>([]);
@ -221,7 +232,12 @@ const DatabaseDetails: FunctionComponent = () => {
const fetchDatabaseSchemas = (pagingObj?: string) => {
return new Promise<void>((resolve, reject) => {
setSchemaDataLoading(true);
getDatabaseSchemas(databaseFQN, pagingObj, ['owner', 'usageSummary'])
getDatabaseSchemas(
databaseFQN,
pagingObj,
['owner', 'usageSummary'],
showDeletedSchemas ? Include.Deleted : Include.NonDeleted
)
.then((res) => {
if (res.data) {
setSchemaData(res.data);
@ -677,6 +693,10 @@ const DatabaseDetails: FunctionComponent = () => {
databaseSchemaPagingHandler,
]);
useEffect(() => {
fetchDatabaseSchemas();
}, [showDeletedSchemas]);
if (isLoading) {
return <Loader />;
}
@ -851,7 +871,20 @@ const DatabaseDetails: FunctionComponent = () => {
onThreadLinkSelect={onThreadLinkSelect}
/>
</Col>
<Col span={24}>
<Row justify="end">
<Col>
<Switch
checked={showDeletedSchemas}
data-testid="show-deleted"
onClick={setShowDeletedSchemas}
/>
<Typography.Text className="m-l-xs">
{t('label.deleted')}
</Typography.Text>{' '}
</Col>
</Row>
</Col>
{databaseTable}
</Row>
</>

View File

@ -11,7 +11,16 @@
* limitations under the License.
*/
import { Button, Col, Row, Space, Tabs, Tooltip, Typography } from 'antd';
import {
Button,
Col,
Row,
Space,
Switch,
Tabs,
Tooltip,
Typography,
} from 'antd';
import Table, { ColumnsType } from 'antd/lib/table';
import { AxiosError } from 'axios';
import AirflowMessageBanner from 'components/common/AirflowMessageBanner/AirflowMessageBanner';
@ -41,6 +50,7 @@ import { EntityTabs, EntityType } from 'enums/entity.enum';
import { compare } from 'fast-json-patch';
import { Container } from 'generated/entity/data/container';
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
import { Include } from 'generated/type/include';
import { isEmpty, isNil, isUndefined, startCase, toLower } from 'lodash';
import {
ExtraInfo,
@ -136,10 +146,16 @@ const ServicePage: FunctionComponent = () => {
tab: string;
}>();
const activeTab = useMemo(
() => tab ?? getCountLabel(serviceCategory).toLowerCase(),
[tab, serviceCategory]
);
const activeTab = useMemo(() => {
if (tab) {
return tab;
}
if (serviceCategory === ServiceCategory.METADATA_SERVICES) {
return EntityTabs.INGESTIONS;
}
return getCountLabel(serviceCategory).toLowerCase();
}, [tab, serviceCategory]);
const entitySpecificTabName = useMemo(
() => getCountLabel(serviceCategory).toLowerCase(),
[serviceCategory]
@ -168,6 +184,7 @@ const ServicePage: FunctionComponent = () => {
const [ingestions, setIngestions] = useState<IngestionPipeline[]>([]);
const [serviceList] = useState<Array<DatabaseService>>([]);
const [ingestionPaging, setIngestionPaging] = useState<Paging>({} as Paging);
const [showDeleted, setShowDeleted] = useState<boolean>(false);
const [currentPage, setCurrentPage] = useState(1);
const [dataModelCurrentPage, setDataModelCurrentPage] = useState(1);
@ -432,13 +449,19 @@ const ServicePage: FunctionComponent = () => {
}).finally(() => setIsLoading(false));
};
const include = useMemo(
() => (showDeleted ? Include.Deleted : Include.NonDeleted),
[showDeleted]
);
const fetchDatabases = async (paging?: PagingWithoutTotal) => {
setIsServiceLoading(true);
try {
const { data, paging: resPaging } = await getDatabases(
serviceFQN,
'owner,usageSummary',
paging
paging,
include
);
setData(data);
@ -458,7 +481,8 @@ const ServicePage: FunctionComponent = () => {
const { data, paging: resPaging } = await getTopics(
serviceFQN,
'owner,tags',
paging
paging,
include
);
setData(data);
setPaging(resPaging);
@ -475,7 +499,8 @@ const ServicePage: FunctionComponent = () => {
const { data, paging: resPaging } = await getDashboards(
serviceFQN,
'owner,usageSummary,tags',
paging
paging,
include
);
setData(data);
setPaging(resPaging);
@ -492,7 +517,8 @@ const ServicePage: FunctionComponent = () => {
const { data, paging: resPaging } = await getDataModels(
serviceFQN,
'owner,tags,followers',
paging
paging,
include
);
setDataModel(data);
setDataModelPaging(resPaging);
@ -509,7 +535,8 @@ const ServicePage: FunctionComponent = () => {
const { data, paging: resPaging } = await getPipelines(
serviceFQN,
'owner,tags',
paging
paging,
include
);
setData(data);
setPaging(resPaging);
@ -526,7 +553,8 @@ const ServicePage: FunctionComponent = () => {
const { data, paging: resPaging } = await getMlModels(
serviceFQN,
'owner,tags',
paging
paging,
include
);
setData(data);
setPaging(resPaging);
@ -545,6 +573,7 @@ const ServicePage: FunctionComponent = () => {
fields: 'owner,tags',
paging,
root: true,
include,
});
setData(response.data);
@ -676,6 +705,10 @@ const ServicePage: FunctionComponent = () => {
}
};
useEffect(() => {
getOtherDetails(undefined, activeTab === EntityTabs.DATA_Model);
}, [activeTab, showDeleted]);
useEffect(() => {
if (servicePermission.ViewAll || servicePermission.ViewBasic) {
setIsLoading(true);
@ -887,13 +920,30 @@ const ServicePage: FunctionComponent = () => {
const dataModalTab = useMemo(
() => (
<DataModelTable
currentPage={dataModelCurrentPage}
data={dataModel}
isLoading={isServiceLoading}
paging={dataModelPaging}
pagingHandler={dataModelPagingHandler}
/>
<Row>
<Col span={24}>
<Row justify="end">
<Col>
<Switch
checked={showDeleted}
data-testid="show-deleted"
onClick={setShowDeleted}
/>
<Typography.Text className="m-l-xs">
{t('label.deleted')}
</Typography.Text>{' '}
</Col>
</Row>
</Col>
<DataModelTable
currentPage={dataModelCurrentPage}
data={dataModel}
isLoading={isServiceLoading}
paging={dataModelPaging}
pagingHandler={dataModelPagingHandler}
/>
</Row>
),
[dataModel, isServiceLoading, dataModelPagingHandler, dataModelCurrentPage]
);
@ -1059,7 +1109,7 @@ const ServicePage: FunctionComponent = () => {
return <Loader />;
} else if (!isEmpty(data) && !isServiceLoading) {
return (
<div data-testid="table-container">
<Col data-testid="table-container" span={24}>
<Table
bordered
className="mt-4"
@ -1080,7 +1130,7 @@ const ServicePage: FunctionComponent = () => {
totalCount={paging.total}
/>
)}
</div>
</Col>
);
} else {
return <ErrorPlaceHolder />;
@ -1202,7 +1252,25 @@ const ServicePage: FunctionComponent = () => {
onChange={activeTabHandler}
/>
<Col span={24}>
{activeTab === entitySpecificTabName && entityServiceTab}
{activeTab === entitySpecificTabName && (
<Row>
<Col span={24}>
<Row justify="end">
<Col>
<Switch
checked={showDeleted}
data-testid="show-deleted"
onClick={setShowDeleted}
/>
<Typography.Text className="m-l-xs">
{t('label.deleted')}
</Typography.Text>{' '}
</Col>
</Row>
</Col>
{entityServiceTab}
</Row>
)}
{activeTab === EntityTabs.DATA_Model && dataModalTab}
{activeTab === EntityTabs.INGESTIONS && ingestionTab}
{activeTab === EntityTabs.CONNECTION && testConnectionTab}

View File

@ -13,6 +13,7 @@
import { AxiosResponse } from 'axios';
import { Operation } from 'fast-json-patch';
import { Include } from 'generated/type/include';
import { PagingResponse, PagingWithoutTotal, RestoreRequestType } from 'Models';
import { ServicePageData } from 'pages/service';
import { Dashboard } from '../generated/entity/data/dashboard';
@ -40,7 +41,8 @@ export const getDashboardVersion = async (id: string, version: string) => {
export const getDashboards = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<{
data: ServicePageData[];
@ -50,6 +52,7 @@ export const getDashboards = async (
service,
fields,
...paging,
include,
},
});
@ -133,7 +136,8 @@ export const restoreDashboard = async (id: string) => {
export const getDataModels = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<PagingResponse<ServicePageData[]>>(
`/dashboard/datamodels`,
@ -142,6 +146,7 @@ export const getDataModels = async (
service,
fields,
...paging,
include,
},
}
);

View File

@ -15,6 +15,7 @@ import { Operation } from 'fast-json-patch';
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
import { EntityHistory } from 'generated/type/entityHistory';
import { EntityReference } from 'generated/type/entityReference';
import { Include } from 'generated/type/include';
import { getURLWithQueryFields } from 'utils/APIUtils';
import APIClient from './index';
@ -41,10 +42,16 @@ export const getDataModelDetails = async (
export const getDataModelsByName = async (
name: string,
fields: string | string[]
fields: string | string[],
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<DashboardDataModel>(
`${URL}/name/${name}?fields=${fields}`
`${URL}/name/${name}?fields=${fields}`,
{
params: {
include,
},
}
);
return response.data;

View File

@ -13,6 +13,7 @@
import { AxiosResponse } from 'axios';
import { Operation } from 'fast-json-patch';
import { Include } from 'generated/type/include';
import { PagingWithoutTotal, RestoreRequestType } from 'Models';
import { Database } from '../generated/entity/data/database';
import { DatabaseSchema } from '../generated/entity/data/databaseSchema';
@ -23,7 +24,8 @@ import APIClient from './index';
export const getDatabases = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<{
data: Database[];
@ -33,6 +35,7 @@ export const getDatabases = async (
service,
fields,
...paging,
include,
},
});
@ -96,7 +99,8 @@ export const patchDatabaseSchemaDetails = async (
export const getDatabaseSchemas = async (
databaseName: string,
paging?: string,
arrQueryFields?: string | string[]
arrQueryFields?: string | string[],
include: Include = Include.NonDeleted
) => {
const url = `${getURLWithQueryFields(
`/databaseSchemas`,
@ -106,7 +110,11 @@ export const getDatabaseSchemas = async (
const response = await APIClient.get<{
data: DatabaseSchema[];
paging: Paging;
}>(url);
}>(url, {
params: {
include,
},
});
return response.data;
};

View File

@ -58,7 +58,8 @@ export const getMlModelByFQN = async (
export const getMlModels = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<{
data: ServicePageData[];
@ -68,6 +69,7 @@ export const getMlModels = async (
service,
fields,
...paging,
include,
},
});

View File

@ -13,6 +13,7 @@
import { AxiosResponse } from 'axios';
import { Operation } from 'fast-json-patch';
import { Include } from 'generated/type/include';
import { PagingResponse, PagingWithoutTotal, RestoreRequestType } from 'Models';
import { ServicePageData } from 'pages/service';
import { Pipeline, PipelineStatus } from '../generated/entity/data/pipeline';
@ -41,7 +42,8 @@ export const getPipelineVersion = async (id: string, version: string) => {
export const getPipelines = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<{
data: ServicePageData[];
@ -51,6 +53,7 @@ export const getPipelines = async (
service,
fields,
...paging,
include,
},
});

View File

@ -15,6 +15,7 @@ import { Operation } from 'fast-json-patch';
import { Container } from 'generated/entity/data/container';
import { EntityHistory } from 'generated/type/entityHistory';
import { EntityReference } from 'generated/type/entityReference';
import { Include } from 'generated/type/include';
import { Paging } from 'generated/type/paging';
import { PagingWithoutTotal, RestoreRequestType } from 'Models';
import { ServicePageData } from 'pages/service';
@ -34,6 +35,7 @@ export const getContainers = async (args: {
fields: string;
paging?: PagingWithoutTotal;
root?: boolean;
include: Include;
}) => {
const { paging, ...rest } = args;
@ -52,10 +54,16 @@ export const getContainers = async (args: {
export const getContainerByName = async (
name: string,
fields: string | string[]
fields: string | string[],
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<Container>(
`containers/name/${name}?fields=${fields}`
`containers/name/${name}?fields=${fields}`,
{
params: {
include,
},
}
);
return response.data;

View File

@ -13,6 +13,7 @@
import { AxiosResponse } from 'axios';
import { Operation } from 'fast-json-patch';
import { Include } from 'generated/type/include';
import { PagingWithoutTotal, RestoreRequestType } from 'Models';
import { ServicePageData } from 'pages/service';
import { TabSpecificField } from '../enums/entity.enum';
@ -41,7 +42,8 @@ export const getTopicVersion = async (id: string, version: string) => {
export const getTopics = async (
service: string,
fields: string,
paging?: PagingWithoutTotal
paging?: PagingWithoutTotal,
include: Include = Include.NonDeleted
) => {
const response = await APIClient.get<{
data: ServicePageData[];
@ -51,6 +53,7 @@ export const getTopics = async (
service,
fields,
...paging,
include,
},
});