Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Jan 3, 2024
2 parents 08e5731 + ff78e3c commit 3738195
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 202 deletions.
6 changes: 5 additions & 1 deletion datahub-web-react/src/app/identity/user/SelectRole.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { UserOutlined } from '@ant-design/icons';
import { Select } from 'antd';
import { useApolloClient } from '@apollo/client';
Expand Down Expand Up @@ -49,6 +49,10 @@ export default function SelectRole({ user, userRoleUrn, selectRoleOptions, refet
const [currentRoleUrn, setCurrentRoleUrn] = useState<string>(defaultRoleUrn);
const [isViewingAssignRole, setIsViewingAssignRole] = useState(false);

useEffect(() => {
setCurrentRoleUrn(defaultRoleUrn);
}, [defaultRoleUrn]);

const onSelectRole = (roleUrn: string) => {
setCurrentRoleUrn(roleUrn);
setIsViewingAssignRole(true);
Expand Down
9 changes: 6 additions & 3 deletions datahub-web-react/src/app/identity/user/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const UserList = () => {
const params = QueryString.parse(location.search, { arrayFormat: 'comma' });
const paramsQuery = (params?.query as string) || undefined;
const [query, setQuery] = useState<undefined | string>(undefined);
const [usersList, setUsersList] = useState<Array<any>>([]);
useEffect(() => setQuery(paramsQuery), [paramsQuery]);

const [page, setPage] = useState(1);
Expand Down Expand Up @@ -81,8 +82,9 @@ export const UserList = () => {
});

const totalUsers = usersData?.listUsers?.total || 0;
const users = usersData?.listUsers?.users || [];

useEffect(()=> {
setUsersList(usersData?.listUsers?.users || []);
}, [usersData]);
const onChangePage = (newPage: number) => {
scrollToTop();
setPage(newPage);
Expand Down Expand Up @@ -145,6 +147,7 @@ export const UserList = () => {
onQueryChange={(q) => {
setPage(1);
setQuery(q);
setUsersList([]);
}}
entityRegistry={entityRegistry}
hideRecommendations
Expand All @@ -155,7 +158,7 @@ export const UserList = () => {
locale={{
emptyText: <Empty description="No Users!" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
}}
dataSource={users}
dataSource={usersList}
renderItem={(item: any) => (
<UserListItem
onDelete={() => handleDelete(item.urn as string)}
Expand Down
1 change: 1 addition & 0 deletions docs-website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ module.exports = {
},
{
"Managed DataHub Release History": [
"docs/managed-datahub/release-notes/v_0_2_14",
"docs/managed-datahub/release-notes/v_0_2_13",
"docs/managed-datahub/release-notes/v_0_2_12",
"docs/managed-datahub/release-notes/v_0_2_11",
Expand Down
17 changes: 17 additions & 0 deletions docs/managed-datahub/release-notes/v_0_2_14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# v0.2.14.1
---

Release Availability Date
---
02-Jan-2023

Recommended CLI/SDK
---
- `v0.12.1.3` with release notes at https://github.com/acryldata/datahub/releases/tag/v0.12.1.3

If you are using an older CLI/SDK version then please upgrade it. This applies for all CLI/SDK usages, if you are using it through your terminal, github actions, airflow, in python SDK somewhere, Java SKD etc. This is a strong recommendation to upgrade as we keep on pushing fixes in the CLI and it helps us support you better.

## Release Changelog
---
- Since `v0.2.13` these changes from OSS DataHub https://github.com/datahub-project/datahub/compare/d9de854d276c118afc55264ecc9e2712b91b4ab2...31f9c796763677a4d452066d9b49b4088e65da19 have been pulled in.

156 changes: 102 additions & 54 deletions smoke-test/tests/cypress/cypress/e2e/search/query_and_filter_search.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,105 @@
const datasetNames = {
dashboardsType: "Baz Dashboard",
pipelinesType: "Users",
MlmoduleType: "cypress-model",
glossaryTermsType: "CypressColumnInfoType",
tags: "some-cypress-feature-1",
hivePlatform: "cypress_logging_events",
airflowPlatform: "User Creations",
awsPlatform: "project/root/events/logging_events_bckp",
hdfsPlatform: "SampleHdfsDataset"
};

const searchToExecute = (value) => {
cy.get("input[data-testid=search-input]").eq(0).type(`${value}{enter}`);
cy.waitTextPresent("Type");
};

const selectFilteredEntity = (textToClick, entity, url) => {
cy.get(`[data-testid=filter-dropdown-${textToClick}]`).click({ force: true });
cy.get(`[data-testid="filter-option-${entity}"]`).click({ force: true });
cy.get("[data-testid=update-filters]").click({ force: true });
cy.url().should("include", `${url}`);
cy.get("[data-testid=update-filters]").should("not.be.visible");
cy.get('.ant-pagination-next').scrollIntoView().should('be.visible');
};

const verifyFilteredEntity = (text) => {
cy.get('.ant-typography').contains(text).should('be.visible');
};

describe("auto-complete dropdown, filter plus query search test", () => {

beforeEach(() => {
cy.loginWithCredentials();
cy.visit('/');
});

it.skip("Verify the 'filter by type' section + query", () => {

//Dashboard
searchToExecute("*");
selectFilteredEntity("Type", "Dashboards", "filter__entityType");
cy.clickOptionWithText(datasetNames.dashboardsType);
verifyFilteredEntity('Dashboard');

//Ml Models
searchToExecute("*");
selectFilteredEntity("Type", "ML Models", "filter__entityType");
cy.clickOptionWithText(datasetNames.MlmoduleType);
verifyFilteredEntity('ML Model');

//Piplines
searchToExecute("*");
selectFilteredEntity("Type", "Pipelines", "filter__entityType");
cy.clickOptionWithText(datasetNames.pipelinesType);
verifyFilteredEntity('Pipeline');

});

it("Verify the 'filter by Glossary term' section + query", () => {

//Glossary Term
searchToExecute("*");
selectFilteredEntity("Type", "Glossary Terms", "filter__entityType");
cy.clickOptionWithText(datasetNames.glossaryTermsType);
verifyFilteredEntity('Glossary Term');
});

it("Verify the 'filter by platform' section + query", () => {

//Hive
searchToExecute("*");
selectFilteredEntity("Platform", "Hive", "filter_platform");
cy.clickOptionWithText(datasetNames.hivePlatform);
verifyFilteredEntity('Hive');

//AWS S3
searchToExecute("*");
selectFilteredEntity("Platform", "AWS S3", "filter_platform");
cy.clickOptionWithText(datasetNames.awsPlatform);
verifyFilteredEntity('AWS S3');

//HDFS
searchToExecute("*");
selectFilteredEntity("Platform", "HDFS", "filter_platform");
cy.clickOptionWithText(datasetNames.hdfsPlatform);
verifyFilteredEntity('HDFS');

//Airflow
searchToExecute("*");
selectFilteredEntity("Platform", "Airflow", "filter_platform");
cy.clickOptionWithText(datasetNames.airflowPlatform);
verifyFilteredEntity('Airflow');
});

const platformQuerySearch = (query,test_id,active_filter) => {
cy.visit("/");
cy.get("input[data-testid=search-input]").type(query);
cy.get(`[data-testid="quick-filter-urn:li:dataPlatform:${test_id}"]`).click();
cy.focused().type("{enter}").wait(3000);
cy.url().should(
"include",
`?filter_platform___false___EQUAL___0=urn%3Ali%3AdataPlatform%3A${test_id}`
);
cy.get('[data-testid="search-input"]').should("have.value", query);
cy.get(`[data-testid="active-filter-${active_filter}"]`).should("be.visible");
cy.contains("of 0 results").should("not.exist");
cy.contains(/of [0-9]+ results/);
}

const entityQuerySearch = (query,test_id,active_filter) => {
cy.visit("/");
cy.get("input[data-testid=search-input]").type(query);
cy.get(`[data-testid="quick-filter-${test_id}"]`).click();
cy.focused().type("{enter}").wait(3000);
cy.url().should(
"include",
`?filter__entityType___false___EQUAL___0=${test_id}`
);
cy.get('[data-testid="search-input"]').should("have.value", query);
cy.get(`[data-testid="active-filter-${active_filter}"]`).should("be.visible");
cy.contains("of 0 results").should("not.exist");
cy.contains(/of [0-9]+ results/);
}

it("verify the 'filter by' section + query (result in search page with query applied + filter applied)", () => {
// Platform query plus filter test
cy.loginWithCredentials();
// Airflow
platformQuerySearch ("cypress","airflow","Airflow");
// BigQuery
platformQuerySearch ("cypress","bigquery","BigQuery");
// dbt
platformQuerySearch ("cypress","dbt","dbt");
// Hive
platformQuerySearch ("cypress","hive","Hive");

// Entity type query plus filter test
// Datasets
entityQuerySearch ("cypress","DATASET","Datasets");
// Dashboards
entityQuerySearch ("cypress","DASHBOARD","Dashboards");
// Pipelines
entityQuerySearch ("cypress","DATA_FLOW","Pipelines");
// Domains
entityQuerySearch ("Marketing","DOMAIN","Domains");
// Glossary Terms
entityQuerySearch ("cypress","GLOSSARY_TERM","Glossary Terms");
it("Verify the 'filter by tag' section + query", () => {

//CypressFeatureTag
searchToExecute("*");
selectFilteredEntity("Tag", "CypressFeatureTag", "filter_tags");
cy.clickOptionWithText(datasetNames.tags);
cy.mouseover('[data-testid="tag-CypressFeatureTag"]');
verifyFilteredEntity('Feature');
});
});
});
Loading

0 comments on commit 3738195

Please sign in to comment.