mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-07 16:11:30 +00:00
chore(ui): ingestion workflow improvement (#12524)
This commit is contained in:
parent
abe58f486f
commit
2a03cb0c7c
@ -130,7 +130,9 @@ export const DataAssetsHeader = ({
|
||||
);
|
||||
const [copyTooltip, setCopyTooltip] = useState<string>();
|
||||
|
||||
const excludeEntityService = [
|
||||
const excludeEntityService = useMemo(
|
||||
() =>
|
||||
[
|
||||
EntityType.DATABASE,
|
||||
EntityType.DATABASE_SCHEMA,
|
||||
EntityType.DATABASE_SERVICE,
|
||||
@ -141,7 +143,9 @@ export const DataAssetsHeader = ({
|
||||
EntityType.METADATA_SERVICE,
|
||||
EntityType.STORAGE_SERVICE,
|
||||
...SERVICE_CATEGORIES,
|
||||
].includes(entityType);
|
||||
].includes(entityType),
|
||||
[entityType]
|
||||
);
|
||||
const hasFollowers = 'followers' in dataAsset;
|
||||
|
||||
const { entityName, tier, isFollowing, version, followers } = useMemo(
|
||||
@ -226,7 +230,7 @@ export const DataAssetsHeader = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (dataAsset.fullyQualifiedName && !isTourPage) {
|
||||
if (dataAsset.fullyQualifiedName && !isTourPage && !excludeEntityService) {
|
||||
fetchActiveAnnouncement();
|
||||
fetchTaskCount();
|
||||
}
|
||||
@ -234,7 +238,7 @@ export const DataAssetsHeader = ({
|
||||
const asset = dataAsset as Container;
|
||||
fetchContainerParent(asset.parent?.fullyQualifiedName ?? '');
|
||||
}
|
||||
}, [dataAsset]);
|
||||
}, [dataAsset, excludeEntityService, isTourPage]);
|
||||
|
||||
const { extraInfo, breadcrumbs }: DataAssetHeaderInfo = useMemo(
|
||||
() =>
|
||||
|
@ -80,10 +80,10 @@ const Ingestion: React.FC<IngestionProps> = ({
|
||||
|
||||
const [ingestionData, setIngestionData] =
|
||||
useState<Array<IngestionPipeline>>(ingestionList);
|
||||
const [servicePermission, setServicePermission] =
|
||||
const [ingestionPipelinesPermission, setIngestionPipelinesPermission] =
|
||||
useState<IngestionServicePermission>();
|
||||
|
||||
const fetchServicePermission = async () => {
|
||||
const fetchIngestionPipelinesPermission = async () => {
|
||||
try {
|
||||
const promises = ingestionList.map((item) =>
|
||||
getEntityPermissionByFqn(ResourceEntity.INGESTION_PIPELINE, item.name)
|
||||
@ -98,7 +98,7 @@ const Ingestion: React.FC<IngestionProps> = ({
|
||||
};
|
||||
}, {});
|
||||
|
||||
setServicePermission(permissionData);
|
||||
setIngestionPipelinesPermission(permissionData);
|
||||
} catch (error) {
|
||||
showErrorToast(error as AxiosError);
|
||||
}
|
||||
@ -154,8 +154,8 @@ const Ingestion: React.FC<IngestionProps> = ({
|
||||
}, [searchText, ingestionList]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchServicePermission();
|
||||
}, []);
|
||||
fetchIngestionPipelinesPermission();
|
||||
}, [ingestionList]);
|
||||
|
||||
const getIngestionTab = () => {
|
||||
return (
|
||||
@ -207,6 +207,7 @@ const Ingestion: React.FC<IngestionProps> = ({
|
||||
handleEnableDisableIngestion={handleEnableDisableIngestion}
|
||||
handleIsConfirmationModalOpen={handleIsConfirmationModalOpen}
|
||||
ingestionData={ingestionData}
|
||||
ingestionPipelinesPermission={ingestionPipelinesPermission}
|
||||
isRequiredDetailsAvailable={isRequiredDetailsAvailable}
|
||||
paging={paging}
|
||||
permissions={permissions}
|
||||
@ -214,7 +215,6 @@ const Ingestion: React.FC<IngestionProps> = ({
|
||||
pipelineType={pipelineType}
|
||||
serviceCategory={serviceCategory}
|
||||
serviceName={serviceName}
|
||||
servicePermission={servicePermission}
|
||||
triggerIngestion={triggerIngestion}
|
||||
onIngestionWorkflowsUpdate={onIngestionWorkflowsUpdate}
|
||||
/>
|
||||
|
@ -36,7 +36,7 @@ function IngestionListTable({
|
||||
paging,
|
||||
handleEnableDisableIngestion,
|
||||
onIngestionWorkflowsUpdate,
|
||||
servicePermission,
|
||||
ingestionPipelinesPermission,
|
||||
serviceCategory,
|
||||
serviceName,
|
||||
handleDeleteSelection,
|
||||
@ -112,11 +112,11 @@ function IngestionListTable({
|
||||
handleDeleteSelection={handleDeleteSelection}
|
||||
handleEnableDisableIngestion={handleEnableDisableIngestion}
|
||||
handleIsConfirmationModalOpen={handleIsConfirmationModalOpen}
|
||||
ingestionPipelinesPermission={ingestionPipelinesPermission}
|
||||
isRequiredDetailsAvailable={isRequiredDetailsAvailable}
|
||||
record={record}
|
||||
serviceCategory={serviceCategory}
|
||||
serviceName={serviceName}
|
||||
servicePermission={servicePermission}
|
||||
triggerIngestion={triggerIngestion}
|
||||
onIngestionWorkflowsUpdate={onIngestionWorkflowsUpdate}
|
||||
/>
|
||||
@ -166,7 +166,7 @@ function IngestionListTable({
|
||||
triggerIngestion,
|
||||
isRequiredDetailsAvailable,
|
||||
handleEnableDisableIngestion,
|
||||
servicePermission,
|
||||
ingestionPipelinesPermission,
|
||||
serviceName,
|
||||
deleteSelection,
|
||||
handleDeleteSelection,
|
||||
|
@ -32,7 +32,7 @@ export interface IngestionListTableProps {
|
||||
pipelineNameColWidth?: number;
|
||||
serviceCategory: ServiceCategory;
|
||||
serviceName: string;
|
||||
servicePermission?: IngestionServicePermission;
|
||||
ingestionPipelinesPermission?: IngestionServicePermission;
|
||||
deployIngestion: (id: string) => Promise<void>;
|
||||
handleDeleteSelection: (row: SelectedRowDetails) => void;
|
||||
handleEnableDisableIngestion: (id: string) => void;
|
||||
|
@ -26,7 +26,7 @@ import { PipelineActionsProps } from './PipelineActions.interface';
|
||||
|
||||
function PipelineActions({
|
||||
record,
|
||||
servicePermission,
|
||||
ingestionPipelinesPermission,
|
||||
triggerIngestion,
|
||||
deployIngestion,
|
||||
deleteSelection,
|
||||
@ -47,7 +47,7 @@ function PipelineActions({
|
||||
const [selectedPipeline, setSelectedPipeline] = useState<IngestionPipeline>();
|
||||
|
||||
const getEditPermission = (service: string): boolean =>
|
||||
!servicePermission?.[service]?.EditAll;
|
||||
!ingestionPipelinesPermission?.[service]?.EditAll;
|
||||
|
||||
const handleTriggerIngestion = async (id: string, displayName: string) => {
|
||||
try {
|
||||
@ -89,7 +89,7 @@ function PipelineActions({
|
||||
);
|
||||
};
|
||||
|
||||
const ConfirmDelete = (id: string, name: string) => {
|
||||
const handleConfirmDelete = (id: string, name: string) => {
|
||||
handleDeleteSelection({
|
||||
id,
|
||||
name,
|
||||
@ -192,9 +192,9 @@ function PipelineActions({
|
||||
<Button
|
||||
className="p-x-xss"
|
||||
data-testid="delete"
|
||||
disabled={!servicePermission?.[record.name]?.Delete}
|
||||
disabled={!ingestionPipelinesPermission?.[record.name]?.Delete}
|
||||
type="link"
|
||||
onClick={() => ConfirmDelete(record.id as string, record.name)}>
|
||||
onClick={() => handleConfirmDelete(record.id as string, record.name)}>
|
||||
{getDeleteButton()}
|
||||
</Button>
|
||||
<Divider className="border-gray" type="vertical" />
|
||||
|
@ -18,7 +18,7 @@ import { SelectedRowDetails } from './ingestion.interface';
|
||||
|
||||
export interface PipelineActionsProps {
|
||||
record: IngestionPipeline;
|
||||
servicePermission?: IngestionServicePermission;
|
||||
ingestionPipelinesPermission?: IngestionServicePermission;
|
||||
isRequiredDetailsAvailable: boolean;
|
||||
serviceCategory: ServiceCategory;
|
||||
serviceName: string;
|
||||
|
@ -119,14 +119,20 @@ const SuccessScreen = ({
|
||||
</Typography.Paragraph>
|
||||
</Space>
|
||||
</Card>
|
||||
<div className="m-t-sm">
|
||||
{isFetchingStatus ? (
|
||||
<Loader size="small" />
|
||||
) : (
|
||||
<>
|
||||
{!isAirflowAvailable && (
|
||||
<>
|
||||
<AirflowMessageBanner className="m-t-sm" />
|
||||
<Card className="m-t-sm">
|
||||
{isFetchingStatus ? <Loader /> : <>{messageElement}</>}
|
||||
</Card>
|
||||
<AirflowMessageBanner />
|
||||
<Card className="m-t-sm">{messageElement}</Card>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="mt-7 text-center">
|
||||
<Button
|
||||
|
@ -244,12 +244,9 @@ const ServiceDetailsPage: FunctionComponent = () => {
|
||||
// Error
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
if (!airflowEndpoint) {
|
||||
await getAirflowEndpoint();
|
||||
}
|
||||
}
|
||||
},
|
||||
[serviceFQN, paging, airflowEndpoint, getAirflowEndpoint]
|
||||
[serviceFQN, paging]
|
||||
);
|
||||
|
||||
const updateCurrentSelectedIngestion = useCallback(
|
||||
@ -342,6 +339,13 @@ const ServiceDetailsPage: FunctionComponent = () => {
|
||||
setIngestionPipelines((pipelines) =>
|
||||
pipelines.filter((ing) => ing.id !== id)
|
||||
);
|
||||
/**
|
||||
* update the paging total count to reflect on tab count
|
||||
*/
|
||||
setIngestionPaging((prevData) => ({
|
||||
...prevData,
|
||||
total: prevData.total > 0 ? prevData.total - 1 : 0,
|
||||
}));
|
||||
} catch (error) {
|
||||
showErrorToast(
|
||||
error as AxiosError,
|
||||
@ -875,6 +879,7 @@ const ServiceDetailsPage: FunctionComponent = () => {
|
||||
useEffect(() => {
|
||||
if (isAirflowAvailable && !isOpenMetadataService) {
|
||||
getAllIngestionWorkflows();
|
||||
getAirflowEndpoint();
|
||||
}
|
||||
}, [isAirflowAvailable]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user