Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -19,7 +19,7 @@ import { GRAYED_OUT_COLOR } from '../../../../constants/constants';
import { EventSubscriptionDiagnosticInfo } from '../../../../generated/events/api/eventSubscriptionDiagnosticInfo';
import { useFqn } from '../../../../hooks/useFqn';
import { getDiagnosticInfo } from '../../../../rest/observabilityAPI';
import { getDiagnosticItems } from '../../../../utils/Alerts/AlertsUtil';
import { getDiagnosticItems } from '../../../../utils/Alerts/AlertsUtilPure';
import { showErrorToast } from '../../../../utils/ToastUtils';

function AlertDiagnosticInfoTab() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ import {
import { usePaging } from '../../../../hooks/paging/usePaging';
import { getAlertEventsFromId } from '../../../../rest/alertsAPI';
import {
getAlertEventsFilterLabels,
getAlertRecentEventsFilterOptions,
getAlertStatusIcon,
} from '../../../../utils/Alerts/AlertsUtil';
import {
getAlertEventsFilterLabels,
getChangeEventDataFromTypedEvent,
getLabelsForEventDetails,
} from '../../../../utils/Alerts/AlertsUtil';
} from '../../../../utils/Alerts/AlertsUtilPure';
import { formatDateTime } from '../../../../utils/date-time/DateTimeUtils';
import { getEntityName } from '../../../../utils/EntityNameUtils';
import { Transi18next } from '../../../../utils/i18next/LocalUtil';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ import { Destination } from '../../../generated/events/eventSubscription';
import { testAlertDestination } from '../../../rest/alertsAPI';
import {
getConnectionTimeoutField,
getFormattedDestinations,
getReadTimeoutField,
listLengthValidator,
} from '../../../utils/Alerts/AlertsUtil';
import {
getFormattedDestinations,
listLengthValidator,
} from '../../../utils/Alerts/AlertsUtilPure';
import { showErrorToast } from '../../../utils/ToastUtils';
import './destination-form-item.less';
import { DestinationFormItemProps } from './DestinationFormItem.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,23 @@ jest.mock('../../../utils/Alerts/AlertsUtil', () => ({
getDestinationConfigField: jest
.fn()
.mockReturnValue(<div data-testid="destination-field" />),
getSubscriptionTypeOptions: jest.fn().mockReturnValue([]),
listLengthValidator: jest.fn().mockImplementation(() => Promise.resolve()),
getFilteredDestinationOptions: jest
.fn()
.mockImplementation((key) => DESTINATION_SOURCE_ITEMS[key]),
getConnectionTimeoutField: jest
.fn()
.mockReturnValue(<div data-testid="connection-timeout" />),
getReadTimeoutField: jest
.fn()
.mockReturnValue(<div data-testid="read-timeout" />),
}));

jest.mock('../../../utils/Alerts/AlertsUtilPure', () => ({
listLengthValidator: jest.fn().mockImplementation(() => Promise.resolve()),
getFormattedDestinations: (...args: unknown[]) =>
mockGetFormattedDestinations(...args),
getSubscriptionTypeOptions: jest.fn().mockReturnValue([]),
getFilteredDestinationOptions: jest
.fn()
.mockImplementation((key) => DESTINATION_SOURCE_ITEMS[key]),
normalizeDestinationConfig: jest.fn().mockImplementation((config) => config),
}));

jest.mock('../../../utils/ObservabilityUtils', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ import { ModifiedDestination } from '../../../../pages/AddObservabilityPage/AddO
import {
getDestinationConfigField,
getDestinationStatusAlertData,
} from '../../../../utils/Alerts/AlertsUtil';
import {
getFilteredDestinationOptions,
getSubscriptionTypeOptions,
normalizeDestinationConfig,
} from '../../../../utils/Alerts/AlertsUtil';
} from '../../../../utils/Alerts/AlertsUtilPure';
import { Transi18next } from '../../../../utils/i18next/LocalUtil';
import { checkIfDestinationIsInternal } from '../../../../utils/ObservabilityUtils';
import { DestinationSelectItemProps } from './DestinationSelectItem.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import type { CustomTagProps } from 'rc-select/lib/BaseSelect';
import React, { useEffect, useState } from 'react';
import { SearchIndex } from '../../../enums/search.enum';
import { searchQuery } from '../../../rest/searchAPI';
import { getTermQuery } from '../../../utils/SearchUtils';
import { getTermQuery } from '../../../utils/SearchPureUtils';
import { AsyncSelect } from '../../common/AsyncSelect/AsyncSelect';
import { AsyncSelectListProps } from '../../common/AsyncSelect/AsyncSelectList.interface';

interface FQNListSelectProps
extends SelectProps,
Pick<AsyncSelectListProps, 'api'> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ import {
} from '../../utils/AuditLogUtils';
import { getEntityName } from '../../utils/EntityNameUtils';
import { translateWithNestedKeys } from '../../utils/i18next/LocalUtil';
import { getTermQuery } from '../../utils/SearchUtils';
import { getTermQuery } from '../../utils/SearchPureUtils';
import DatePickerMenu from '../common/DatePickerMenu/DatePickerMenu.component';
import SearchDropdown from '../SearchDropdown/SearchDropdown';
import { SearchDropdownOption } from '../SearchDropdown/SearchDropdown.interface';
import {
AuditLogFiltersProps,
FilterOption,
} from './AuditLogFilters.interface';

const ENTITY_TYPE_OPTIONS: FilterOption[] = [
// Data Assets
{ label: 'Table', value: 'table' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { useFqn } from '../../../hooks/useFqn';
import { useLineageStore } from '../../../hooks/useLineageStore';
import { QueryFieldInterface } from '../../../pages/ExplorePage/ExplorePage.interface';
import { exportLineageByEntityCountAsync } from '../../../rest/lineageAPI';
import { getQuickFilterQuery } from '../../../utils/ExploreUtils';
import { getQuickFilterQuery } from '../../../utils/ExplorePureUtils';
import { getSearchNameEsQuery } from '../../../utils/Lineage/LineageUtils';
import { useRequiredParams } from '../../../utils/useRequiredParams';
import Searchbar from '../../common/SearchBarComponent/SearchBar.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { SearchIndex } from '../../../enums/search.enum';
import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation';
import { TabsInfoData } from '../../../pages/ExplorePage/ExplorePage.interface';
import { getAllCustomProperties } from '../../../rest/metadataTypeAPI';
import { getEmptyJsonTree } from '../../../utils/AdvancedSearchPureUtils';
import {
getEmptyJsonTree,
getTreeConfig,
processEntityTypeFields,
} from '../../../utils/AdvancedSearchUtils';
Expand All @@ -49,7 +49,6 @@ import {
AdvanceSearchProviderProps,
SearchOutputType,
} from './AdvanceSearchProvider.interface';

const AdvancedSearchContext = createContext<AdvanceSearchContext>(
{} as AdvanceSearchContext
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jest.mock('../../../common/ErrorWithPlaceholder/ErrorPlaceHolderNew', () => ({
}));

// Mock utility functions
jest.mock('../../../../utils/EntityBreadcrumbUtils', () => ({
jest.mock('../../../../utils/EntityLinkUtils', () => ({
getEntityLinkFromType: jest.fn().mockReturnValue('/test-entity-link'),
}));
jest.mock('../../../../utils/EntityNameUtils', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { EntityType } from '../../../../enums/entity.enum';
import { DataProduct } from '../../../../generated/entity/domains/dataProduct';
import { getSortedTagsWithHighlight } from '../../../../utils/EntitySummaryPanelUtils';
import { getSortedTagsWithHighlight } from '../../../../utils/EntitySummaryPanelPureUtils';
import { DomainLabel } from '../../../common/DomainLabel/DomainLabel.component';
import { OwnerLabel } from '../../../common/OwnerLabel/OwnerLabel.component';
import SummaryPanelSkeleton from '../../../common/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { get } from 'lodash';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Domain } from '../../../../generated/entity/domains/domain';
import { getSortedTagsWithHighlight } from '../../../../utils/EntitySummaryPanelUtils';
import { getSortedTagsWithHighlight } from '../../../../utils/EntitySummaryPanelPureUtils';
import { OwnerLabel } from '../../../common/OwnerLabel/OwnerLabel.component';
import SummaryPanelSkeleton from '../../../common/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import SummaryTagsDescription from '../../../common/SummaryTagsDescription/SummaryTagsDescription.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import AppBadge from '../../../../common/Badge/Badge.component';
import RichTextEditorPreviewerV1 from '../../../../common/RichTextEditor/RichTextEditorPreviewerV1';
import TagsViewer from '../../../../Tag/TagsViewer/TagsViewer';
import { SummaryListItemProps } from './SummaryListItems.interface';

const { Text, Paragraph } = Typography;

function SummaryListItem({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { SearchIndex } from '../../../../enums/search.enum';
import { searchQuery } from '../../../../rest/searchAPI';
import { getTermQuery } from '../../../../utils/SearchUtils';
import { getTermQuery } from '../../../../utils/SearchPureUtils';
import SummaryPanelSkeleton from '../../../common/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import TableDataCardV2 from '../../../common/TableDataCardV2/TableDataCardV2';
import { SourceType } from '../../../SearchedData/SearchedData.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SearchIndex } from '../../enums/search.enum';
import useCustomLocation from '../../hooks/useCustomLocation/useCustomLocation';
import { useSearchStore } from '../../hooks/useSearchStore';
import { QueryFilterInterface } from '../../pages/ExplorePage/ExplorePage.interface';
import { getOptionsFromAggregationBucket } from '../../utils/AdvancedSearchUtils';
import { getOptionsFromAggregationBucket } from '../../utils/AdvancedSearchPureUtils';
import {
getCombinedQueryFilterObject,
getQuickFilterWithDeletedFlag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
getSubLevelHierarchyKey,
updateTreeData,
updateTreeDataWithCounts,
} from '../../../utils/ExploreUtils';
} from '../../../utils/ExplorePureUtils';
import { Transi18next } from '../../../utils/i18next/LocalUtil';
import searchClassBase from '../../../utils/SearchClassBase';
import serviceUtilClassBase from '../../../utils/ServiceUtilClassBase';
Expand All @@ -53,7 +53,6 @@ import {
ExploreTreeProps,
TreeNodeData,
} from './ExploreTree.interface';

const ExploreTreeTitle = ({ node }: { node: ExploreTreeNode }) => {
const tooltipText = node.tooltip ?? node.title;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { getCombinedQueryFilterObject } from '../../utils/ExplorePage/ExplorePag
import {
getExploreQueryFilterMust,
getSelectedValuesFromQuickFilter,
} from '../../utils/ExploreUtils';
} from '../../utils/ExplorePureUtils';
import searchClassBase from '../../utils/SearchClassBase';
import withSuspenseFallback from '../AppRouter/withSuspenseFallback';
import FilterErrorPlaceHolder from '../common/ErrorWithPlaceholder/FilterErrorPlaceHolder';
Expand All @@ -76,7 +76,6 @@ import { ReactComponent as IconAscending } from './../../assets/svg/ic-ascending
import { ReactComponent as IconDescending } from './../../assets/svg/ic-descending.svg';
import './exploreV1.less';
import { IndexNotFoundBanner } from './IndexNotFoundBanner';

const EntitySummaryPanel = withSuspenseFallback(
lazy(
() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import {
import { getEntityLinkFromType } from '../../utils/EntityLinkUtils';
import { getEntityName } from '../../utils/EntityNameUtils';
import { highlightSearchText } from '../../utils/EntitySearchUtils';
import { getQuickFilterQuery } from '../../utils/ExploreUtils';
import { getQuickFilterQuery } from '../../utils/ExplorePureUtils';
import Fqn from '../../utils/Fqn';
import { Transi18next } from '../../utils/i18next/LocalUtil';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ThreadType } from '../../generated/api/feed/createThread';
import { Post, Thread } from '../../generated/entity/feed/thread';
import { useApplicationStore } from '../../hooks/useApplicationStore';
import { getFeedsWithFilter } from '../../rest/feedsAPI';
import { getEntityFQN, getEntityType } from '../../utils/FeedUtils';
import { getEntityFQN, getEntityType } from '../../utils/FeedUtilsPure';
import { getUserPath } from '../../utils/RouterUtils';
import { showErrorToast } from '../../utils/ToastUtils';
import Loader from '../common/Loader/Loader';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { ActivityFeedTabs } from '../ActivityFeed/ActivityFeedTab/ActivityFeedTa
import ProfilePicture from '../common/ProfilePicture/ProfilePicture';
import { SourceType } from '../SearchedData/SearchedData.interface';
import { NotificationFeedProp } from './NotificationFeedCard.interface';

const NotificationFeedCard: FC<NotificationFeedProp> = ({
createdBy,
entityFQN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import NotificationFeedCard from './NotificationFeedCard.component';
jest.mock('../../utils/date-time/DateTimeUtils', () => ({
formatDateTime: jest.fn().mockImplementation((date) => date),
getRelativeTime: jest.fn().mockImplementation((date) => date),
getEpochMillisForPastDays: jest.fn().mockImplementation((days) => days),
getStartOfDayInMillis: jest.fn().mockImplementation((val) => val),
getEndOfDayInMillis: jest.fn().mockImplementation((val) => val),
getCurrentMillis: jest.fn().mockReturnValue(0),
}));

const mockPrepareFeedLink = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import {
import { useTranslation } from 'react-i18next';
import { ReactComponent as DropDown } from '../../assets/svg/drop-down.svg';
import { NULL_OPTION_KEY } from '../../constants/AdvancedSearch.constants';
import { getSelectedOptionLabelString } from '../../utils/AdvancedSearchPureUtils';
import {
generateSearchDropdownLabel,
getSearchDropdownLabels,
getSelectedOptionLabelString,
} from '../../utils/AdvancedSearchUtils';
import searchClassBase from '../../utils/SearchClassBase';
import Loader from '../common/Loader/Loader';
Expand All @@ -52,7 +52,6 @@ import {
SearchDropdownOption,
SearchDropdownProps,
} from './SearchDropdown.interface';

const SearchDropdown: FC<SearchDropdownProps> = ({
dropdownClassName,
isSuggestionsLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ import {
Effect,
EventSubscription,
} from '../../../../generated/events/eventSubscription';
import { EDIT_LINK_PATH } from '../../../../utils/Alerts/AlertsUtil';
import {
EDIT_LINK_PATH,
getDisplayNameForEntities,
getFunctionDisplayName,
} from '../../../../utils/Alerts/AlertsUtil';
} from '../../../../utils/Alerts/AlertsUtilPure';
import TitleBreadcrumb from '../../../common/TitleBreadcrumb/TitleBreadcrumb.component';
import { TitleBreadcrumbProps } from '../../../common/TitleBreadcrumb/TitleBreadcrumb.interface';
import PageHeader from '../../../PageHeader/PageHeader.component';
import { HeaderProps } from '../../../PageHeader/PageHeader.interface';

interface AlertDetailsComponentProps {
alerts: EventSubscription;
onDelete: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { AlertDetailsComponent } from './AlertDetails.component';

jest.mock('../../../../utils/Alerts/AlertsUtil', () => ({
EDIT_LINK_PATH: 'Edit Alert Link',
}));

jest.mock('../../../../utils/Alerts/AlertsUtilPure', () => ({
getDisplayNameForEntities: jest.fn().mockImplementation((entity) => entity),
getFunctionDisplayName: jest
.fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { ReactComponent as CopyLeft } from '../../../../../assets/svg/copy-left.
import { useClipboard } from '../../../../../hooks/useClipBoard';
import { splitCSV } from '../../../../../utils/CSV/CSVPureUtils';
import './workflow-array-field-template.less';

const WorkflowArrayFieldTemplate = (props: FieldProps) => {
const { t } = useTranslation();
const isFilterPatternField = (id: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { searchQuery } from '../../../../../../rest/searchAPI';
import {
getEmptyJsonTree,
getEmptyJsonTreeForQueryBuilder,
} from '../../../../../../utils/AdvancedSearchUtils';
} from '../../../../../../utils/AdvancedSearchPureUtils';
import { elasticSearchFormat } from '../../../../../../utils/QueryBuilderElasticsearchFormatUtils';
import {
addEntityTypeFilter,
Expand All @@ -50,14 +50,13 @@ import {
getJsonTreeFromQueryFilter,
migrateJsonLogic,
READONLY_SETTINGS,
} from '../../../../../../utils/QueryBuilderUtils';
} from '../../../../../../utils/QueryBuilderPureUtils';
import { getExplorePath } from '../../../../../../utils/RouterUtils';
import searchClassBase from '../../../../../../utils/SearchClassBase';
import { withAdvanceSearch } from '../../../../../AppRouter/withAdvanceSearch';
import { useAdvanceSearch } from '../../../../../Explore/AdvanceSearchProvider/AdvanceSearchProvider.component';
import { SearchOutputType } from '../../../../../Explore/AdvanceSearchProvider/AdvanceSearchProvider.interface';
import './query-builder-widget.less';

const QueryBuilderWidget: FC<
WidgetProps & {
fields?: Config['fields'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { FC } from 'react';
import { filterSelectOptions } from '../../../../../utils/FilterQueryUtils';
import { getPopupContainer } from '../../../../../utils/formPureUtils';
import TreeSelectWidget from './TreeSelectWidget';

const getDisplayLabel = (
label: string | number | boolean | null,
shouldCapitalize: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { EntityType } from '../../../enums/entity.enum';
import { searchQuery } from '../../../rest/searchAPI';
import { getTreeConfig } from '../../../utils/AdvancedSearchUtils';
import * as QueryBuilderElasticsearchFormatUtils from '../../../utils/QueryBuilderElasticsearchFormatUtils';
import * as QueryBuilderUtils from '../../../utils/QueryBuilderUtils';
import * as QueryBuilderUtils from '../../../utils/QueryBuilderPureUtils';
import searchClassBase from '../../../utils/SearchClassBase';
import { SearchOutputType } from '../../Explore/AdvanceSearchProvider/AdvanceSearchProvider.interface';
import QueryBuilderWidgetV1 from './QueryBuilderWidgetV1';
Expand All @@ -48,6 +48,7 @@ jest.mock('../../../utils/AdvancedSearchUtils', () => ({
}));

jest.mock('../../../utils/QueryBuilderUtils');
jest.mock('../../../utils/QueryBuilderPureUtils');
jest.mock('../../../utils/QueryBuilderElasticsearchFormatUtils');
jest.mock('../../../utils/RouterUtils', () => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,19 @@ import { EntityType } from '../../../enums/entity.enum';
import { SearchIndex } from '../../../enums/search.enum';
import { QueryFilterInterface } from '../../../pages/ExplorePage/ExplorePage.interface';
import { searchQuery } from '../../../rest/searchAPI';
import {
getEmptyJsonTreeForQueryBuilder,
getTreeConfig,
} from '../../../utils/AdvancedSearchUtils';
import { getEmptyJsonTreeForQueryBuilder } from '../../../utils/AdvancedSearchPureUtils';
import { getTreeConfig } from '../../../utils/AdvancedSearchUtils';
import { elasticSearchFormat } from '../../../utils/QueryBuilderElasticsearchFormatUtils';
import {
addEntityTypeFilter,
getEntityTypeAggregationFilter,
getJsonTreeFromQueryFilter,
READONLY_SETTINGS,
} from '../../../utils/QueryBuilderUtils';
} from '../../../utils/QueryBuilderPureUtils';
import { getExplorePath } from '../../../utils/RouterUtils';
import searchClassBase from '../../../utils/SearchClassBase';
import { SearchOutputType } from '../../Explore/AdvanceSearchProvider/AdvanceSearchProvider.interface';
import './query-builder-widget-v1.less';

const QueryBuilderWidgetV1: FC<{
fields?: Config['fields'];
onChange?: (value: string, tree?: JsonTree) => void;
Expand Down
Loading
Loading