mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 16:08:13 +00:00
* Fix #4697: UI Create property URL dynamically * Addressing comments
This commit is contained in:
parent
1d6b7e8525
commit
bf1d738f55
@ -532,7 +532,9 @@ const DashboardDetails = ({
|
|||||||
to={{ pathname: chart.chartUrl }}>
|
to={{ pathname: chart.chartUrl }}>
|
||||||
<span className="tw-flex">
|
<span className="tw-flex">
|
||||||
<span className="tw-mr-1">
|
<span className="tw-mr-1">
|
||||||
{chart.displayName}
|
{getEntityName(
|
||||||
|
chart as unknown as EntityReference
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
<SVGIcons
|
<SVGIcons
|
||||||
alt="external-link"
|
alt="external-link"
|
||||||
|
@ -39,6 +39,7 @@ import {
|
|||||||
} from '../../axiosAPIs/feedsAPI';
|
} from '../../axiosAPIs/feedsAPI';
|
||||||
import { getLineageByFQN } from '../../axiosAPIs/lineageAPI';
|
import { getLineageByFQN } from '../../axiosAPIs/lineageAPI';
|
||||||
import { addLineage, deleteLineageEdge } from '../../axiosAPIs/miscAPI';
|
import { addLineage, deleteLineageEdge } from '../../axiosAPIs/miscAPI';
|
||||||
|
import { getServiceByFQN } from '../../axiosAPIs/serviceAPI';
|
||||||
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
||||||
import DashboardDetails from '../../components/DashboardDetails/DashboardDetails.component';
|
import DashboardDetails from '../../components/DashboardDetails/DashboardDetails.component';
|
||||||
@ -295,6 +296,27 @@ const DashboardDetailsPage = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const fetchServiceDetails = (type: string, fqn: string) => {
|
||||||
|
return new Promise<string>((resolve, reject) => {
|
||||||
|
getServiceByFQN(type + 's', fqn, ['owner'])
|
||||||
|
.then((resService: AxiosResponse) => {
|
||||||
|
if (resService?.data) {
|
||||||
|
const hostPort = resService.data.connection?.config?.hostPort || '';
|
||||||
|
resolve(hostPort);
|
||||||
|
} else {
|
||||||
|
throw null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err: AxiosError) => {
|
||||||
|
showErrorToast(
|
||||||
|
err,
|
||||||
|
jsonData['api-error-messages']['fetch-dashboard-details-error']
|
||||||
|
);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const fetchDashboardDetail = (dashboardFQN: string) => {
|
const fetchDashboardDetail = (dashboardFQN: string) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
getDashboardByFqn(dashboardFQN, defaultFields)
|
getDashboardByFqn(dashboardFQN, defaultFields)
|
||||||
@ -310,12 +332,13 @@ const DashboardDetailsPage = () => {
|
|||||||
tags,
|
tags,
|
||||||
owner,
|
owner,
|
||||||
displayName,
|
displayName,
|
||||||
|
name,
|
||||||
charts: ChartIds,
|
charts: ChartIds,
|
||||||
dashboardUrl,
|
dashboardUrl,
|
||||||
serviceType,
|
serviceType,
|
||||||
version,
|
version,
|
||||||
} = res.data;
|
} = res.data;
|
||||||
setDisplayName(displayName);
|
setDisplayName(displayName || name);
|
||||||
setDashboardDetails(res.data);
|
setDashboardDetails(res.data);
|
||||||
setCurrentVersion(version);
|
setCurrentVersion(version);
|
||||||
setDashboardId(id);
|
setDashboardId(id);
|
||||||
@ -352,14 +375,30 @@ const DashboardDetailsPage = () => {
|
|||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
setDashboardUrl(dashboardUrl);
|
fetchServiceDetails(service.type, service.name)
|
||||||
fetchCharts(ChartIds)
|
.then((hostPort: string) => {
|
||||||
.then((chart) => setCharts(chart))
|
setDashboardUrl(hostPort + dashboardUrl);
|
||||||
.catch((error: AxiosError) => {
|
fetchCharts(ChartIds)
|
||||||
showErrorToast(
|
.then((chart) => {
|
||||||
error,
|
const updatedCharts = (chart as ChartType[]).map(
|
||||||
jsonData['api-error-messages']['fetch-chart-error']
|
(chartItem) => ({
|
||||||
);
|
...chartItem,
|
||||||
|
chartUrl: hostPort + chartItem.chartUrl,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
setCharts(updatedCharts);
|
||||||
|
})
|
||||||
|
.catch((error: AxiosError) => {
|
||||||
|
showErrorToast(
|
||||||
|
error,
|
||||||
|
jsonData['api-error-messages']['fetch-chart-error']
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err: AxiosError) => {
|
||||||
|
throw err;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setIsError(true);
|
setIsError(true);
|
||||||
@ -376,8 +415,6 @@ const DashboardDetailsPage = () => {
|
|||||||
jsonData['api-error-messages']['fetch-dashboard-details-error']
|
jsonData['api-error-messages']['fetch-dashboard-details-error']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -39,6 +39,7 @@ import {
|
|||||||
patchPipelineDetails,
|
patchPipelineDetails,
|
||||||
removeFollower,
|
removeFollower,
|
||||||
} from '../../axiosAPIs/pipelineAPI';
|
} from '../../axiosAPIs/pipelineAPI';
|
||||||
|
import { getServiceByFQN } from '../../axiosAPIs/serviceAPI';
|
||||||
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
||||||
import {
|
import {
|
||||||
@ -248,6 +249,27 @@ const PipelineDetailsPage = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const fetchServiceDetails = (type: string, fqn: string) => {
|
||||||
|
return new Promise<string>((resolve, reject) => {
|
||||||
|
getServiceByFQN(type + 's', fqn, ['owner'])
|
||||||
|
.then((resService: AxiosResponse) => {
|
||||||
|
if (resService?.data) {
|
||||||
|
const hostPort = resService.data.connection?.config?.hostPort || '';
|
||||||
|
resolve(hostPort);
|
||||||
|
} else {
|
||||||
|
throw null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err: AxiosError) => {
|
||||||
|
showErrorToast(
|
||||||
|
err,
|
||||||
|
jsonData['api-error-messages']['fetch-pipeline-details-error']
|
||||||
|
);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const fetchPipelineDetail = (pipelineFQN: string) => {
|
const fetchPipelineDetail = (pipelineFQN: string) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
getPipelineByFqn(pipelineFQN, defaultFields)
|
getPipelineByFqn(pipelineFQN, defaultFields)
|
||||||
@ -264,11 +286,12 @@ const PipelineDetailsPage = () => {
|
|||||||
tags,
|
tags,
|
||||||
owner,
|
owner,
|
||||||
displayName,
|
displayName,
|
||||||
|
name,
|
||||||
tasks,
|
tasks,
|
||||||
pipelineUrl,
|
pipelineUrl,
|
||||||
version,
|
version,
|
||||||
} = res.data;
|
} = res.data;
|
||||||
setDisplayName(displayName);
|
setDisplayName(displayName || name);
|
||||||
setPipelineDetails(res.data);
|
setPipelineDetails(res.data);
|
||||||
setCurrentVersion(version);
|
setCurrentVersion(version);
|
||||||
setPipelineId(id);
|
setPipelineId(id);
|
||||||
@ -305,8 +328,19 @@ const PipelineDetailsPage = () => {
|
|||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
setPipelineUrl(pipelineUrl);
|
fetchServiceDetails(service.type, service.name)
|
||||||
setTasks(tasks);
|
.then((hostPort: string) => {
|
||||||
|
setPipelineUrl(hostPort + pipelineUrl);
|
||||||
|
const updatedTasks = (tasks as Task[]).map((task) => ({
|
||||||
|
...task,
|
||||||
|
taskUrl: hostPort + task.taskUrl,
|
||||||
|
}));
|
||||||
|
setTasks(updatedTasks);
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err: AxiosError) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setIsError(true);
|
setIsError(true);
|
||||||
|
|
||||||
@ -322,8 +356,8 @@ const PipelineDetailsPage = () => {
|
|||||||
jsonData['api-error-messages']['fetch-pipeline-details-error']
|
jsonData['api-error-messages']['fetch-pipeline-details-error']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
setLoading(false);
|
||||||
.finally(() => setLoading(false));
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchTabSpecificData = (tabField = '') => {
|
const fetchTabSpecificData = (tabField = '') => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user