From 1c6d2f26493875dceeba3be65bf5728c8c84d4f6 Mon Sep 17 00:00:00 2001
From: Aniket Katkar <51777795+aniketkatkar97@users.noreply.github.com>
Date: Fri, 26 Aug 2022 14:14:22 +0530
Subject: [PATCH] Fix #6893 : Ui improvements and bug fixes 2 (#6935)
* Fix #6893 : Ui improvements and bug fixes
* Fixed failing unit tests
* Fixed failing cypress tests
* glossary page left panel styling changes
---
.../cypress/integration/Pages/Teams.spec.js | 15 ++-
.../CreateUser/CreateUser.component.tsx | 25 ++---
.../src/components/Glossary/Glossary.test.tsx | 13 +++
.../Glossary/GlossaryV1.component.tsx | 97 ++++++++++---------
.../components/Glossary/GlossaryV1.style.less | 29 ++++++
.../components/TeamDetails/TeamDetailsV1.tsx | 87 ++++-------------
.../ui/src/components/TeamDetails/teams.less | 7 ++
.../ui/src/components/UserList/UserListV1.tsx | 6 +-
.../ui/src/components/UserList/usersList.less | 7 ++
.../EntitySummaryDetails.style.less | 5 +
.../EntitySummaryDetails.tsx | 7 +-
.../OwnerWidgetWrapper.component.tsx | 4 +-
.../OwnerWidget/OwnerWidgetWrapper.module.css | 3 -
.../OwnerWidget/OwnerWidgetWrapper.style.less | 4 +
.../ManageButton/ManageButton.tsx | 11 ++-
.../resources/ui/src/constants/constants.ts | 8 ++
16 files changed, 189 insertions(+), 139 deletions(-)
create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.style.less
delete mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/OwnerWidget/OwnerWidgetWrapper.module.css
create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/OwnerWidget/OwnerWidgetWrapper.style.less
diff --git a/openmetadata-ui/src/main/resources/ui/cypress/integration/Pages/Teams.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/integration/Pages/Teams.spec.js
index 1998fbb1363..c9c98496b5c 100644
--- a/openmetadata-ui/src/main/resources/ui/cypress/integration/Pages/Teams.spec.js
+++ b/openmetadata-ui/src/main/resources/ui/cypress/integration/Pages/Teams.spec.js
@@ -146,7 +146,10 @@ describe('Teams flow should work properly', () => {
cy.get('.ant-table-row').should('contain', TEAM_DETAILS.ownername);
//Removing the added user
- cy.get('.ant-btn').should('exist').should('be.visible').click();
+ cy.get('.ant-btn > [data-testid="image"]')
+ .should('exist')
+ .should('be.visible')
+ .click();
//Validating the user added
cy.get('[data-testid="body-text"]').should(
@@ -156,10 +159,10 @@ describe('Teams flow should work properly', () => {
//Click on confirm button
cy.get('[data-testid="save-button"]').should('be.visible').click();
-
+
// TODO: Remove cy.wait and wait for API to be completed before querying for new element
cy.wait(2000);
-
+
//
//Verify if user is removed
cy.get('[data-testid="searchbar"]')
@@ -311,6 +314,12 @@ describe('Teams flow should work properly', () => {
.should('be.visible')
.click();
+ cy.wait(1000);
+ cy.get('.ant-dropdown-menu-item')
+ .should('exist')
+ .should('be.visible')
+ .click();
+
cy.wait(1000);
//Click on permanent delete option
cy.get('[data-testid="hard-delete-option"]')
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/CreateUser/CreateUser.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/CreateUser/CreateUser.component.tsx
index 774a976d5e6..986426ae790 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/CreateUser/CreateUser.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/CreateUser/CreateUser.component.tsx
@@ -16,6 +16,7 @@ import classNames from 'classnames';
import { cloneDeep, isEmpty, isUndefined } from 'lodash';
import { EditorContentRef } from 'Models';
import React, { useRef, useState } from 'react';
+import { getBotsPagePath, getUsersPagePath } from '../../constants/constants';
import { validEmailRegEx } from '../../constants/regex.constants';
import { PageLayoutType } from '../../enums/layout.enum';
import { CreateUser as CreateUserSchema } from '../../generated/api/teams/createUser';
@@ -60,6 +61,18 @@ const CreateUser = ({
validEmail: false,
});
+ const slashedBreadcrumbList = [
+ {
+ name: forceBot ? 'Bots' : 'Users',
+ url: forceBot ? getBotsPagePath() : getUsersPagePath(),
+ },
+ {
+ name: `Create ${forceBot ? 'Bot' : 'User'}`,
+ url: '',
+ activeTitle: true,
+ },
+ ];
+
/**
* common function to update user input in to the state
* @param event change event for input/selection field
@@ -215,17 +228,7 @@ const CreateUser = ({
return (
- }
+ header={}
layout={PageLayoutType['2ColRTL']}>
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/Glossary.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/Glossary.test.tsx
index bfc151db0aa..e3eef57d975 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/Glossary.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/Glossary.test.tsx
@@ -59,6 +59,19 @@ jest.mock('antd', () => ({
.fn()
.mockImplementation(({ children }) =>
{children}
),
},
+ Dropdown: jest.fn().mockImplementation(({ children, overlay }) => (
+
+ {children}
+ {overlay}
+
+ )),
+ Menu: jest.fn().mockImplementation(({ items }) => (
+
+ {items.map((item: { key: string; label: JSX.Element }) => {
+
{item.label}
;
+ })}
+
+ )),
}));
const mockProps = {
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx
index 6da0cb5b2be..55ee013286c 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx
@@ -12,14 +12,13 @@
*/
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { Col, Input, Row, Space, Typography } from 'antd';
+import { Col, Dropdown, Input, Menu, Row, Space, Typography } from 'antd';
import classNames from 'classnames';
import { cloneDeep, isEmpty } from 'lodash';
import { GlossaryTermAssets, LoadingState } from 'Models';
import RcTree from 'rc-tree';
import { DataNode, EventDataNode } from 'rc-tree/lib/interface';
import React, { Fragment, useEffect, useRef, useState } from 'react';
-import { Tooltip } from 'react-tippy';
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { TITLE_FOR_NON_ADMIN_ACTION } from '../../constants/constants';
@@ -218,35 +217,43 @@ const GlossaryV1 = ({
const manageButtonContent = () => {
return (
-
+