Skip to content

Commit

Permalink
Merge branch 'main' into fix-es-config-form
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-madlani authored Jun 23, 2023
2 parents b6752cd + 9c2d21d commit b7804be
Show file tree
Hide file tree
Showing 64 changed files with 442 additions and 388 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
cy.get('[data-testid="add-user"]').should('be.visible').click();

// Enter team name
cy.get('#create-user-bot-form .ant-select-selector')
cy.get('[data-testid="team-select"] .ant-select-selector')
.should('exist')
.scrollIntoView()
.should('be.visible')
Expand All @@ -94,7 +94,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
});

teamNames.forEach((teamName) => {
cy.get('#create-user-bot-form .ant-select-selector')
cy.get('[data-testid="team-select"] .ant-select-selector')
.should('exist')
.scrollIntoView()
.should('be.visible')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ describe('Test Add role and assign it to the user', () => {
.click();
verifyResponseStatusCode('@generatePassword', 200);

cy.get(`[id="menu-button-Roles"]`)
.should('exist')
.should('be.visible')
.click();

cy.get(`[data-testid="${roleName}"]`)
cy.get(`[data-testid="roles-dropdown"]`)
.scrollIntoView()
.should('be.visible')
.click();
.should('be.visible');

cy.get(`[data-testid="roles-dropdown"]`).click();

cy.get(`[title="${roleName}"]`).scrollIntoView().should('be.visible');

cy.get(`[title="${roleName}"]`).click();

cy.get('[data-testid="roles-dropdown"]').click();
cy.get('[data-testid="save-user"]').scrollIntoView().click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,7 @@ const updateTags = (inTerm) => {
.scrollIntoView()
.should('be.visible')
.type('personal');
cy.get('.ant-select-item-option-content')
.contains('Personal')
.should('be.visible')
.click();
cy.get('[role="tree"] [title="Personal"]').click();
// to close popup
cy.clickOutside();

Expand Down Expand Up @@ -492,7 +489,7 @@ describe('Glossary page should work properly', () => {

it('Verify and Remove Tags from Glossary', () => {
// Verify Tags which is added at the time of creating glossary
cy.get('[data-testid="tag-container"]')
cy.get('[data-testid="tags-container"]')
.contains('Personal')
.should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ describe('Tags page should work', () => {
cy.get('@count')
.invoke('text')
.then((text) => {
expect(text).to.equal('2');
expect(text).to.equal('1');
});

interceptURL(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ActivityFeedTab = ({
description,
columns,
entityType,
onUpdateEntityDetails,
}: ActivityFeedTabProps) => {
const history = useHistory();
const { t } = useTranslation();
Expand Down Expand Up @@ -395,6 +396,7 @@ export const ActivityFeedTab = ({
owner={owner}
tags={tags}
task={selectedThread}
onUpdateEntityDetails={onUpdateEntityDetails}
/>
) : (
<TaskTab
Expand All @@ -403,6 +405,7 @@ export const ActivityFeedTab = ({
owner={owner}
tags={tags}
task={selectedThread}
onUpdateEntityDetails={onUpdateEntityDetails}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum ActivityFeedTabs {
export interface ActivityFeedTabBasicProps {
fqn: string;
onFeedUpdate: () => void;
onUpdateEntityDetails?: () => void;
owner?: EntityReference;
tags?: TagLabel[];
description?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export interface TestCaseFormProps {
export interface TestSuiteIngestionProps {
testSuite: TestSuite;
ingestionPipeline?: IngestionPipeline;
table?: Table;
onCancel: () => void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import { Col, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import ResizablePanels from 'components/common/ResizablePanels/ResizablePanels';
import { TableProfilerTab } from 'components/ProfilerDashboard/profilerDashboard.interface';
import SingleColumnProfile from 'components/TableProfiler/Component/SingleColumnProfile';
import TableProfilerChart from 'components/TableProfiler/Component/TableProfilerChart';
import { HTTP_STATUS_CODE } from 'constants/auth.constants';
Expand All @@ -25,6 +26,7 @@ import {
default as React,
Fragment,
useCallback,
useEffect,
useMemo,
useState,
} from 'react';
Expand All @@ -37,7 +39,7 @@ import {
DEFAULT_RANGE_DATA,
STEPS_FOR_ADD_TEST_CASE,
} from '../../constants/profiler.constant';
import { EntityType } from '../../enums/entity.enum';
import { EntityTabs, EntityType } from '../../enums/entity.enum';
import { FormSubmitType } from '../../enums/form.enum';
import { ProfilerDashboardType } from '../../enums/table.enum';
import { OwnerType } from '../../enums/user.enum';
Expand Down Expand Up @@ -96,42 +98,43 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({
);

const handleRedirection = () => {
history.goBack();
history.push({
pathname: getTableTabPath(
table.fullyQualifiedName ?? '',
EntityTabs.PROFILER
),
search: Qs.stringify({ activeTab: TableProfilerTab.DATA_QUALITY }),
});
};

const getTestSuiteFqn = async () => {
try {
if (isUndefined(table.testSuite)) {
const testSuite = {
name: `${table.fullyQualifiedName}.testSuite`,
executableEntityReference: table.fullyQualifiedName,
owner,
};
const response = await createExecutableTestSuite(testSuite);
setTestSuiteData(response);

return `${table.fullyQualifiedName}.testSuite`;
}
setTestSuiteData(table.testSuite);
const createTestSuite = async () => {
const testSuite = {
name: `${table.fullyQualifiedName}.testSuite`,
executableEntityReference: table.fullyQualifiedName,
owner,
};
const response = await createExecutableTestSuite(testSuite);
setTestSuiteData(response);

return table.testSuite?.fullyQualifiedName ?? '';
} catch (error) {
showErrorToast(error as AxiosError);
}

return '';
return response;
};

useEffect(() => {
setTestSuiteData(table.testSuite);
}, [table.testSuite]);

const handleFormSubmit = async (data: CreateTestCase) => {
setTestCaseData(data);

try {
const testSuite = await getTestSuiteFqn();
const testSuite = isUndefined(testSuiteData)
? await createTestSuite()
: table.testSuite;

const testCasePayload: CreateTestCase = {
...data,
owner,
testSuite,
testSuite: testSuite?.fullyQualifiedName ?? '',
};

const testCaseResponse = await createTestCase(testCasePayload);
Expand Down Expand Up @@ -197,7 +200,7 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({
onSubmit={handleFormSubmit}
/>
);
}, [activeServiceStep, testCaseRes]);
}, [activeServiceStep, testCaseData, testCaseRes, handleFormSubmit, table]);

const { activeColumnFqn } = useMemo(() => {
const param = location.search;
Expand Down Expand Up @@ -290,6 +293,7 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({
children: secondPanel,
className: 'p-md service-doc-panel',
minWidth: 60,
flex: 0.4,
overlay: {
displayThreshold: 200,
header: t('label.setup-guide'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { Col, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import { isEmpty } from 'lodash';
import { camelCase, isEmpty } from 'lodash';
import React, { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom';
Expand Down Expand Up @@ -47,7 +47,6 @@ import TestSuiteScheduler from './components/TestSuiteScheduler';

const TestSuiteIngestion: React.FC<TestSuiteIngestionProps> = ({
ingestionPipeline,
table,
testSuite,
onCancel,
}) => {
Expand Down Expand Up @@ -125,8 +124,8 @@ const TestSuiteIngestion: React.FC<TestSuiteIngestionProps> = ({
name: `${updatedName}_${PipelineType.TestSuite}`,
pipelineType: PipelineType.TestSuite,
service: {
id: table?.service?.id ?? '',
type: table?.service?.type ?? '',
id: testSuite.id || '',
type: camelCase(PipelineType.TestSuite),
},
sourceConfig: {
config: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
import { getDashboardDetailsPath } from 'constants/constants';
import { compare } from 'fast-json-patch';
import { TagSource } from 'generated/type/schema';
import { EntityFieldThreadCount } from 'interface/feed.interface';
import { isEmpty, isUndefined, map } from 'lodash';
import { EntityTags, TagOption } from 'Models';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
Expand All @@ -52,7 +53,11 @@ import { EntityTabs, EntityType } from '../../enums/entity.enum';
import { Dashboard } from '../../generated/entity/data/dashboard';
import { ThreadType } from '../../generated/entity/feed/thread';
import { LabelType, State, TagLabel } from '../../generated/type/tagLabel';
import { getCurrentUserId, refreshPage } from '../../utils/CommonUtils';
import {
getCurrentUserId,
getFeedCounts,
refreshPage,
} from '../../utils/CommonUtils';
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
Expand All @@ -79,10 +84,7 @@ const DashboardDetails = ({
chartDescriptionUpdateHandler,
chartTagUpdateHandler,
versionHandler,
feedCount,
entityFieldThreadCount,
createThread,
entityFieldTaskCount,
onDashboardUpdate,
}: DashboardDetailsProps) => {
const { t } = useTranslation();
Expand All @@ -96,6 +98,13 @@ const DashboardDetails = ({
chart: ChartType;
index: number;
}>();
const [feedCount, setFeedCount] = useState<number>(0);
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
EntityFieldThreadCount[]
>([]);
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
EntityFieldThreadCount[]
>([]);

const [tagFetchFailed, setTagFetchFailed] = useState<boolean>(false);
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
Expand Down Expand Up @@ -182,6 +191,20 @@ const DashboardDetails = ({
}
}, []);

const getEntityFeedCount = () => {
getFeedCounts(
EntityType.DASHBOARD,
dashboardFQN,
setEntityFieldThreadCount,
setEntityFieldTaskCount,
setFeedCount
);
};

useEffect(() => {
getEntityFeedCount();
}, [dashboardFQN]);

const getAllChartsPermissions = useCallback(
async (charts: ChartType[]) => {
const permissionsArray: Array<ChartsPermissions> = [];
Expand Down Expand Up @@ -690,7 +713,7 @@ const DashboardDetails = ({
<ActivityFeedTab
entityType={EntityType.DASHBOARD}
fqn={dashboardDetails?.fullyQualifiedName ?? ''}
onFeedUpdate={() => Promise.resolve()}
onFeedUpdate={getEntityFeedCount}
/>
</ActivityFeedProvider>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Operation } from 'fast-json-patch';
import { CreateThread } from '../../generated/api/feed/createThread';
import { Chart } from '../../generated/entity/data/chart';
import { Dashboard } from '../../generated/entity/data/dashboard';
import { EntityFieldThreadCount } from '../../interface/feed.interface';

export interface ChartType extends Chart {
displayName: string;
Expand All @@ -29,9 +28,6 @@ export interface ChartsPermissions {
export interface DashboardDetailsProps {
charts: Array<ChartType>;
dashboardDetails: Dashboard;
feedCount: number;
entityFieldThreadCount: EntityFieldThreadCount[];
entityFieldTaskCount: EntityFieldThreadCount[];
createThread: (data: CreateThread) => void;
followDashboardHandler: () => Promise<void>;
unFollowDashboardHandler: () => Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ const dashboardDetailsProps: DashboardDetailsProps = {
chartTagUpdateHandler: jest.fn(),
onDashboardUpdate: jest.fn(),
versionHandler: jest.fn(),
feedCount: 0,
entityFieldThreadCount: [],
entityFieldTaskCount: [],
createThread: jest.fn(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export const DataAssetsHeader = ({
entityFQN={dataAsset.fullyQualifiedName}
entityId={dataAsset.id}
entityName={entityName}
entityType={EntityType.TABLE}
entityType={entityType}
onAnnouncementClick={
permissions?.EditAll
? () => setIsAnnouncementDrawer(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
* limitations under the License.
*/

import { Card, Col, Row, Typography } from 'antd';
import { Card, Col, Row } from 'antd';
import { AxiosError } from 'axios';
import PageHeader from 'components/header/PageHeader.component';
import React, { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
Expand Down Expand Up @@ -95,14 +96,12 @@ const DailyActiveUsersChart: FC<Props> = ({ chartFilter, selectedDays }) => {
id={DataInsightChartType.DailyActiveUsers}
loading={isLoading}
title={
<>
<Typography.Title level={5}>
{t('label.daily-active-users-on-the-platform')}
</Typography.Title>
<Typography.Text className="data-insight-label-text">
{t('message.active-users')}
</Typography.Text>
</>
<PageHeader
data={{
header: t('label.daily-active-users-on-the-platform'),
subHeader: t('message.active-users'),
}}
/>
}>
{dailyActiveUsers.length ? (
<Row gutter={DI_STRUCTURE.rowContainerGutter}>
Expand Down
Loading

0 comments on commit b7804be

Please sign in to comment.