Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from '../../../rest/testAPI';
import { getEntityName } from '../../../utils/EntityUtils';
import { getPopupContainer } from '../../../utils/formUtils';
import { getTestSuitePath } from '../../../utils/RouterUtils';
import observabilityRouterClassBase from '../../../utils/ObservabilityRouterClassBase';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
import { AddToBundleSuiteModalProps } from './AddToBundleSuiteModal.interface';

Expand Down Expand Up @@ -128,7 +128,7 @@ const AddToBundleSuiteModal: React.FC<AddToBundleSuiteModalProps> = ({
(opt) => opt.value === selectedSuiteId
);
if (selectedSuite?.suite.fullyQualifiedName) {
navigate(getTestSuitePath(selectedSuite.suite.fullyQualifiedName));
navigate(observabilityRouterClassBase.getTestSuitePath(selectedSuite.suite.fullyQualifiedName));
}

onAddedToExisting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
FAILED_CHART_COLOR_SCHEME,
SUCCESS_CHART_COLOR_SCHEME,
} from '../../../constants/Chart.constants';
import { PAGE_SIZE_BASE, ROUTES } from '../../../constants/constants';
import { PAGE_SIZE_BASE } from '../../../constants/constants';
import {
DATA_QUALITY_DASHBOARD_HEADER,
DQ_FILTER_KEYS,
Expand Down Expand Up @@ -861,7 +861,7 @@ const DataQualityDashboard = ({
incidentStatusType={TestCaseResolutionStatusTypes.New}
name="open-incident"
redirectPath={{
pathname: ROUTES.INCIDENT_MANAGER,
pathname: observabilityRouterClassBase.getIncidentManagerPath(),
search: QueryString.stringify({
testCaseResolutionStatusType:
TestCaseResolutionStatusTypes.New,
Expand All @@ -878,7 +878,7 @@ const DataQualityDashboard = ({
incidentStatusType={TestCaseResolutionStatusTypes.Resolved}
name="resolved-incident"
redirectPath={{
pathname: ROUTES.INCIDENT_MANAGER,
pathname: observabilityRouterClassBase.getIncidentManagerPath(),
search: QueryString.stringify({
testCaseResolutionStatusType:
TestCaseResolutionStatusTypes.Resolved,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import {
} from '../../../../rest/testAPI';
import { getEntityDeleteMessage } from '../../../../utils/CommonUtils';
import { getColumnNameFromEntityLink } from '../../../../utils/EntityUtils';
import observabilityRouterClassBase from '../../../../utils/ObservabilityRouterClassBase';
import { checkPermission } from '../../../../utils/PermissionsUtils';
import { getTestCaseDetailPagePath } from '../../../../utils/RouterUtils';
import { showErrorToast } from '../../../../utils/ToastUtils';
import Loader from '../../../common/Loader/Loader';
import { ManageButtonItemLabel } from '../../../common/ManageButtonContentItem/ManageButtonContentItem.component';
Expand Down Expand Up @@ -222,7 +222,7 @@ const FailedTestCaseSampleData = ({
<div className="d-flex gap-4">
{testCaseData?.inspectionQuery && !isVersionPage && (
<Link
to={getTestCaseDetailPagePath(
to={observabilityRouterClassBase.getTestCaseDetailPagePath(
testCaseData?.fullyQualifiedName ?? '',
TestCasePageTabs.SQL_QUERY
)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ import { getEntityName } from '../../../../utils/EntityUtils';
import { getPopupContainer } from '../../../../utils/formUtils';
import observabilityRouterClassBase from '../../../../utils/ObservabilityRouterClassBase';
import { getPrioritizedViewPermission } from '../../../../utils/PermissionsUtils';
import {
getEntityDetailsPath,
getTestSuitePath,
} from '../../../../utils/RouterUtils';
import { getEntityDetailsPath } from '../../../../utils/RouterUtils';
import { ownerTableObject } from '../../../../utils/TableColumn.util';
import { showErrorToast } from '../../../../utils/ToastUtils';
import ErrorPlaceHolder from '../../../common/ErrorWithPlaceholder/ErrorPlaceHolder';
Expand Down Expand Up @@ -171,7 +168,7 @@ export const TestSuites = () => {
) : (
<Link
data-testid={name}
to={getTestSuitePath(
to={observabilityRouterClassBase.getTestSuitePath(
record.fullyQualifiedName ?? record.name
)}>
{getEntityName(record)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ import {
} from '../../../../utils/EntityUtils';
import { getEntityFQN } from '../../../../utils/FeedUtils';
import { Transi18next } from '../../../../utils/i18next/LocalUtil';
import {
getEntityDetailsPath,
getTestCaseDetailPagePath,
getTestSuitePath,
} from '../../../../utils/RouterUtils';
import observabilityRouterClassBase from '../../../../utils/ObservabilityRouterClassBase';
import { getEntityDetailsPath } from '../../../../utils/RouterUtils';
import { replacePlus } from '../../../../utils/StringsUtils';
import { showErrorToast } from '../../../../utils/ToastUtils';
import DateTimeDisplay from '../../../common/DateTimeDisplay/DateTimeDisplay';
Expand Down Expand Up @@ -374,7 +371,7 @@ const DataQualityTab: React.FC<DataQualityTabProps> = ({
setBundleSuiteFormInitialCases([]);
setSelectedKeys(new Set<string>());
if (testSuite.fullyQualifiedName) {
navigate(getTestSuitePath(testSuite.fullyQualifiedName));
navigate(observabilityRouterClassBase.getTestSuitePath(testSuite.fullyQualifiedName));
}
};

Expand Down Expand Up @@ -508,7 +505,7 @@ const DataQualityTab: React.FC<DataQualityTabProps> = ({
}
)}>
<Link
to={getTestCaseDetailPagePath(
to={observabilityRouterClassBase.getTestCaseDetailPagePath(
record.fullyQualifiedName ?? '',
TestCasePageTabs.DIMENSIONALITY
)}>
Expand Down Expand Up @@ -583,7 +580,7 @@ const DataQualityTab: React.FC<DataQualityTabProps> = ({
className="break-word"
state={{ breadcrumbData }}
to={{
pathname: getTestCaseDetailPagePath(
pathname: observabilityRouterClassBase.getTestCaseDetailPagePath(
record.fullyQualifiedName ?? ''
),
}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
convertSecondsToHumanReadableFormat,
formatDateTime,
} from '../../../../utils/date-time/DateTimeUtils';
import { getTestCaseDetailPagePath } from '../../../../utils/RouterUtils';
import observabilityRouterClassBase from '../../../../utils/ObservabilityRouterClassBase';
import { getTaskDetailPath } from '../../../../utils/TasksUtils';
import { OwnerLabel } from '../../../common/OwnerLabel/OwnerLabel.component';
import './test-summary-custom-tooltip.less';
Expand Down Expand Up @@ -202,7 +202,7 @@ const TestSummaryCustomTooltip = (props: TestSummaryCustomTooltipProps) => {
{testCaseFqnProp ? (
<Link
className="tooltip-incident-link font-medium cursor-pointer"
to={getTestCaseDetailPagePath(
to={observabilityRouterClassBase.getTestCaseDetailPagePath(
testCaseFqnProp,
TestCasePageTabs.ISSUES
)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
} from '../../../../utils/date-time/DateTimeUtils';
import { getColumnNameFromEntityLink } from '../../../../utils/EntityUtils';
import { Transi18next } from '../../../../utils/i18next/LocalUtil';
import { getTestCaseDetailPagePath } from '../../../../utils/RouterUtils';
import observabilityRouterClassBase from '../../../../utils/ObservabilityRouterClassBase';
import { generateEntityLink } from '../../../../utils/TableUtils';
import { showErrorToast } from '../../../../utils/ToastUtils';
import DataQualitySection from '../../../common/DataQualitySection';
Expand Down Expand Up @@ -222,7 +222,7 @@ const TestCaseCard: React.FC<TestCaseCardProps> = ({ testCase, incident }) => {
<Link
className="test-case-name"
data-testid={`test-case-${testCaseName}`}
to={getTestCaseDetailPagePath(testCase.fullyQualifiedName ?? '')}>
to={observabilityRouterClassBase.getTestCaseDetailPagePath(testCase.fullyQualifiedName ?? '')}>
{testCaseName}
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ import {
getPartialNameFromTableFQN,
} from '../../utils/CommonUtils';
import { getEntityName } from '../../utils/EntityUtils';
import {
getEntityDetailsPath,
getTestCaseDetailPagePath,
} from '../../utils/RouterUtils';
import observabilityRouterClassBase from '../../utils/ObservabilityRouterClassBase';
import { getEntityDetailsPath } from '../../utils/RouterUtils';
import { showErrorToast } from '../../utils/ToastUtils';
import { AsyncSelect } from '../common/AsyncSelect/AsyncSelect';
import DateTimeDisplay from '../common/DateTimeDisplay/DateTimeDisplay';
Expand Down Expand Up @@ -607,7 +605,7 @@ const IncidentManager = ({
<Link
className="m-0 break-all text-primary"
data-testid={`test-case-${record.testCaseReference?.name}`}
to={getTestCaseDetailPagePath(
to={observabilityRouterClassBase.getTestCaseDetailPagePath(
record.testCaseReference?.fullyQualifiedName ?? ''
)}>
{getEntityName(record.testCaseReference)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import Loader from '../../components/common/Loader/Loader';
import ResizablePanels from '../../components/common/ResizablePanels/ResizablePanels';
import RichTextEditor from '../../components/common/RichTextEditor/RichTextEditor';
import TitleBreadcrumb from '../../components/common/TitleBreadcrumb/TitleBreadcrumb.component';
import {
PAGE_SIZE_LARGE,
ROUTES,
VALIDATION_MESSAGES,
} from '../../constants/constants';
import { PAGE_SIZE_LARGE, VALIDATION_MESSAGES } from '../../constants/constants';
import { NAME_FIELD_RULES } from '../../constants/Form.constants';
import { useLimitStore } from '../../context/LimitsProvider/useLimitsStore';
import { usePermissionProvider } from '../../context/PermissionProvider/PermissionProvider';
Expand Down Expand Up @@ -65,7 +61,7 @@ import {
DEFAULT_ENTITY_PERMISSION,
getPrioritizedViewPermission,
} from '../../utils/PermissionsUtils';
import { getObservabilityAlertDetailsPath } from '../../utils/RouterUtils';
import observabilityRouterClassBase from '../../utils/ObservabilityRouterClassBase';
import { showErrorToast } from '../../utils/ToastUtils';
import { AddAlertPageLoadingState } from '../AddNotificationPage/AddNotificationPage.interface';
import {
Expand Down Expand Up @@ -149,7 +145,7 @@ function AddObservabilityPage() {
},
{
name: t('label.alert-plural'),
url: ROUTES.OBSERVABILITY_ALERTS,
url: observabilityRouterClassBase.getObservabilityAlertsListPath(),
},
{
name: fqn
Expand All @@ -175,7 +171,9 @@ function AddObservabilityPage() {
updateAlertAPI: updateObservabilityAlert,
afterSaveAction: async (fqn: string) => {
!fqn && (await getResourceLimit('eventsubscription', true, true));
navigate(getObservabilityAlertDetailsPath(fqn));
navigate(
observabilityRouterClassBase.getObservabilityAlertDetailsPath(fqn)
);
},
setInlineAlertDetails,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function AlertDetailsPage({
},
{
name: t('label.alert-plural'),
url: ROUTES.OBSERVABILITY_ALERTS,
url: observabilityRouterClassBase.getObservabilityAlertsListPath(),
},
{
name: getEntityName(alertDetails),
Expand All @@ -207,7 +207,7 @@ function AlertDetailsPage({
const handleAlertDelete = useCallback(async () => {
isNotificationAlert
? navigate(ROUTES.NOTIFICATION_ALERT_LIST)
: navigate(ROUTES.OBSERVABILITY_ALERTS);
: navigate(observabilityRouterClassBase.getObservabilityAlertsListPath());
}, [navigate, isNotificationAlert]);

const handleAlertEdit = useCallback(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import { TestCase } from '../../generated/tests/testCase';
import { TestSuite } from '../../generated/tests/testSuite';
import { withPageLayout } from '../../hoc/withPageLayout';
import observabilityRouterClassBase from '../../utils/ObservabilityRouterClassBase';
import {
getTestCaseDetailPagePath,
getTestSuitePath,
} from '../../utils/RouterUtils';
import './data-quality-page.less';
import DataQualityClassBase from './DataQualityClassBase';
import { DataQualityPageTabs } from './DataQualityPage.interface';
Expand Down Expand Up @@ -66,7 +62,7 @@ const DataQualityPage = () => {

const handleBundleSuiteSuccess = (testSuite: TestSuite) => {
if (testSuite.fullyQualifiedName) {
navigate(getTestSuitePath(testSuite.fullyQualifiedName));
navigate(observabilityRouterClassBase.getTestSuitePath(testSuite.fullyQualifiedName));
}
};

Expand Down Expand Up @@ -123,7 +119,7 @@ const DataQualityPage = () => {

const handleFormSubmit = (testCase: TestCase) => {
if (testCase.fullyQualifiedName) {
navigate(getTestCaseDetailPagePath(testCase.fullyQualifiedName));
navigate(observabilityRouterClassBase.getTestCaseDetailPagePath(testCase.fullyQualifiedName));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import EntityHeaderTitle from '../../../components/Entity/EntityHeaderTitle/Enti
import EntityVersionTimeLine from '../../../components/Entity/EntityVersionTimeLine/EntityVersionTimeLine';
import { EntityName } from '../../../components/Modals/EntityNameModal/EntityNameModal.interface';
import PageLayoutV1 from '../../../components/PageLayoutV1/PageLayoutV1';
import { ROUTES } from '../../../constants/constants';
import { FEED_COUNT_INITIAL_DATA } from '../../../constants/entity.constants';
import { EntityField } from '../../../constants/Feeds.constants';
import { usePermissionProvider } from '../../../context/PermissionProvider/PermissionProvider';
Expand All @@ -61,11 +60,7 @@ import {
import { getFeedCounts } from '../../../utils/CommonUtils';
import { getEntityName } from '../../../utils/EntityUtils';
import { getEntityVersionByField } from '../../../utils/EntityVersionUtils';
import {
getTestCaseDetailPagePath,
getTestCaseDimensionsDetailPagePath,
getTestCaseVersionPath,
} from '../../../utils/RouterUtils';
import observabilityRouterClassBase from '../../../utils/ObservabilityRouterClassBase';
import { showErrorToast } from '../../../utils/ToastUtils';
import { useRequiredParams } from '../../../utils/useRequiredParams';
import { TestCasePageTabs } from '../IncidentManager.interface';
Expand Down Expand Up @@ -215,7 +210,7 @@ const IncidentManagerDetailPage = ({
: [
{
name: t('label.incident-manager'),
url: ROUTES.INCIDENT_MANAGER,
url: observabilityRouterClassBase.getIncidentManagerPath(),
},
];

Expand All @@ -224,7 +219,7 @@ const IncidentManagerDetailPage = ({
...data,
{
name: testCase?.name ?? '',
url: getTestCaseDetailPagePath(
url: observabilityRouterClassBase.getTestCaseDetailPagePath(
testCaseFQN,
activeTab as TestCasePageTabs
),
Expand All @@ -251,16 +246,19 @@ const IncidentManagerDetailPage = ({
const handleTabChange = (activeKey: string) => {
if (activeKey !== activeTab) {
const testCaseDetailsPath = isDimensionPage
? getTestCaseDimensionsDetailPagePath(
? observabilityRouterClassBase.getTestCaseDimensionsDetailPagePath(
testCaseFQN,
dimensionKey || '',
activeKey as TestCasePageTabs
)
: getTestCaseDetailPagePath(testCaseFQN, activeKey as TestCasePageTabs);
: observabilityRouterClassBase.getTestCaseDetailPagePath(
testCaseFQN,
activeKey as TestCasePageTabs
);

navigate(
isVersionPage
? getTestCaseVersionPath(
? observabilityRouterClassBase.getTestCaseVersionPath(
testCaseFQN,
version,
activeKey as TestCasePageTabs
Expand Down Expand Up @@ -325,8 +323,8 @@ const IncidentManagerDetailPage = ({
const onVersionClick = () => {
navigate(
isVersionPage
? getTestCaseDetailPagePath(testCaseFQN)
: getTestCaseVersionPath(
? observabilityRouterClassBase.getTestCaseDetailPagePath(testCaseFQN)
: observabilityRouterClassBase.getTestCaseVersionPath(
testCaseFQN,
toString(testCase?.version) ?? '',
activeTab
Expand All @@ -338,7 +336,11 @@ const IncidentManagerDetailPage = ({
const versionHandler = useCallback(
(newVersion = version) => {
navigate(
getTestCaseVersionPath(testCaseFQN, toString(newVersion), activeTab)
observabilityRouterClassBase.getTestCaseVersionPath(
testCaseFQN,
toString(newVersion),
activeTab
)
);
},
[testCaseFQN, activeTab]
Expand Down Expand Up @@ -482,7 +484,9 @@ const IncidentManagerDetailPage = ({
{!isVersionPage && (
<ManageButton
isRecursiveDelete
afterDeleteAction={() => navigate(ROUTES.INCIDENT_MANAGER)}
afterDeleteAction={() =>
navigate(observabilityRouterClassBase.getIncidentManagerPath())
}
allowSoftDelete={false}
canDelete={hasDeletePermission}
displayName={testCase.displayName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ import {
checkPermission,
DEFAULT_ENTITY_PERMISSION,
} from '../../utils/PermissionsUtils';
import { getTestSuitePath } from '../../utils/RouterUtils';
import { ExtraTestCaseDropdownOptions } from '../../utils/TestCaseUtils';
import { showErrorToast } from '../../utils/ToastUtils';
import './test-suite-details-page.less';
Expand Down Expand Up @@ -195,7 +194,9 @@ const TestSuiteDetailsPage = () => {
},
{
name: getEntityName(testSuite),
url: getTestSuitePath(testSuite?.fullyQualifiedName ?? ''),
url: observabilityRouterClassBase.getTestSuitePath(
testSuite?.fullyQualifiedName ?? ''
),
},
];
}, [testSuite]);
Expand Down
Loading
Loading