From accc05a49479d87cdfc2037f2050cc1c67accfbb Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 6 Aug 2025 20:52:58 +0530 Subject: [PATCH] Update data contract details fields (#22746) * update data contract details fields * fix the select option chip not properly displaying the data * supported new form field for UserTeamSelectInput Selector * remove component changes that we not needed * fix the selected owner chip design * supported the userPopoverList width as per screen size with max and min limitation * fix the tab inside userTeamSelect list not proper as the content and some oprimiztion on component side * fix the playwright because of owner changes * fix the description box overflow and owner selcect box overlapping on select input * enum label fix * remove the comment code and fix the localization and sematic status changing issue are contract validation run --- .../e2e/Pages/DataContracts.spec.ts | 6 +- .../DataAssetsHeader/data-asset-header.less | 9 +- .../ContractDetailFormTab.tsx | 58 ++---- .../contract-detail-form-tab.less | 19 ++ .../ContractDetailTab/ContractDetail.tsx | 1 - .../ContractQualityFormTab.tsx | 4 +- .../common/UserTag/UserTag.component.tsx | 12 +- .../common/UserTag/UserTag.test.tsx | 4 +- .../UserTeamSelect/user-team-select.less | 13 -- .../UserTeamSelectableList.component.tsx | 7 +- .../UserTeamSelectableList.interface.ts | 1 + ...eamSelectableListSearchInput.component.tsx | 172 ++++++++++++++++++ ...ser-team-selectable-list-search-input.less | 56 ++++++ .../ui/src/interface/FormUtils.interface.ts | 1 + .../ui/src/utils/QueryBuilderUtils.tsx | 2 +- .../main/resources/ui/src/utils/formUtils.tsx | 12 ++ 16 files changed, 306 insertions(+), 71 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/contract-detail-form-tab.less create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableListSearchInput/UserTeamSelectableListSearchInput.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableListSearchInput/user-team-selectable-list-search-input.less diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts index 3b74dfeb9cd..491a4f1f576 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts @@ -100,7 +100,7 @@ test.describe('Data Contracts', () => { DATA_CONTRACT_DETAILS.description ); - await page.getByTestId('add-owner').click(); + await page.getByTestId('select-owners').click(); await page.getByRole('tab', { name: 'Users' }).click(); await page .getByTestId('owner-select-users-search-bar') @@ -114,9 +114,7 @@ test.describe('Data Contracts', () => { await page.getByTestId('selectable-list-update-btn').click(); await expect( - page - .getByTestId('owner-link') - .getByTestId(user.responseData.displayName) + page.getByTestId('user-tag').getByText(user.responseData.name) ).toBeVisible(); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetsHeader/data-asset-header.less b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetsHeader/data-asset-header.less index 254c6a0d09c..d0e2a928778 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetsHeader/data-asset-header.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetsHeader/data-asset-header.less @@ -130,10 +130,10 @@ } .ant-btn-group.spaced { - .ant-btn.data-contract-latest-result-button { + .ant-btn.ant-btn-default.data-contract-latest-result-button { font-size: 14px; padding: 6px 12px; - border-radius: 12px !important; + border-radius: 12px; font-weight: 600; box-shadow: 0px 2px 2px -1px @grey-35, 0px 4px 6px -2px @grey-35, 0px 12px 16px -4px @grey-35; @@ -153,11 +153,6 @@ color: @orange-7; border: 1px solid @orange-200; background-color: @orange-50; - - &:hover { - border: 1px solid @red-19; - background-color: @red-2; - } } &.running { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx index 38e9e25efaf..c2a4faa66bd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx @@ -10,20 +10,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Icon, { PlusOutlined } from '@ant-design/icons'; +import Icon from '@ant-design/icons'; import { Button, Card, Form, Typography } from 'antd'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { ReactComponent as RightIcon } from '../../../assets/svg/right-arrow.svg'; import { DataContract } from '../../../generated/entity/data/dataContract'; -import { EntityReference } from '../../../generated/type/entityReference'; -import { - FieldProp, - FieldTypes, - FormItemLayout, -} from '../../../interface/FormUtils.interface'; +import { FieldProp, FieldTypes } from '../../../interface/FormUtils.interface'; import { generateFormFields } from '../../../utils/formUtils'; -import { OwnerLabel } from '../../common/OwnerLabel/OwnerLabel.component'; +import './contract-detail-form-tab.less'; export const ContractDetailFormTab: React.FC<{ initialValues?: Partial; @@ -34,8 +29,6 @@ export const ContractDetailFormTab: React.FC<{ const { t } = useTranslation(); const [form] = Form.useForm(); - const owners = Form.useWatch('owners', form); - const fields: FieldProp[] = [ { label: t('label.contract-title'), @@ -47,6 +40,22 @@ export const ContractDetailFormTab: React.FC<{ 'data-testid': 'contract-name', }, }, + { + label: t('label.owner-plural'), + name: 'owners', + id: 'root/owner', + type: FieldTypes.USER_TEAM_SELECT_INPUT, + required: false, + props: { + owner: initialValues?.owners, + hasPermission: true, + multiple: { user: true, team: false }, + }, + formItemProps: { + valuePropName: 'owners', + trigger: 'onUpdate', + }, + }, { label: t('label.description'), id: 'description', @@ -58,31 +67,6 @@ export const ContractDetailFormTab: React.FC<{ initialValue: initialValues?.description ?? '', }, }, - { - label: t('label.owner-plural'), - id: 'owners', - name: 'owners', - type: FieldTypes.USER_TEAM_SELECT, - required: false, - props: { - owner: initialValues?.owners, - hasPermission: true, - children: ( -