diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index 166b3d93a08..428cacd0923 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -220,7 +220,7 @@ export const testServiceCreationAndIngestion = ({ // validation should work cy.get('[data-testid="next-button"]').should('exist').click(); - cy.get('#name_help').should('be.visible').contains('name is required'); + cy.get('#name_help').should('be.visible').contains('Name is required'); // invalid name validation should work cy.get('[data-testid="service-name"]').should('exist').type('!@#$%^&*()'); @@ -725,10 +725,10 @@ export const addCustomPropertiesForEntity = ( // validation should work cy.get('[data-testid="create-button"]').scrollIntoView().click(); - cy.get('#name_help').should('contain', 'name is required'); - cy.get('#propertyType_help').should('contain', 'propertyType is required'); + cy.get('#name_help').should('contain', 'Name is required'); + cy.get('#propertyType_help').should('contain', 'Property Type is required'); - cy.get('#description_help').should('contain', 'description is required'); + cy.get('#description_help').should('contain', 'Description is required'); // capital case validation cy.get('[data-testid="name"]') diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js index 1f2b0a6a016..94472ba5f9f 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js @@ -76,10 +76,10 @@ const validateForm = () => { cy.get('#name_help') .scrollIntoView() .should('be.visible') - .contains('name is required'); + .contains('Name is required'); cy.get('#description_help') .should('be.visible') - .contains('description is required'); + .contains('Description is required'); // max length validation cy.get('[data-testid="name"]') diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js index 883656da654..eb3746c42cd 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Tags.spec.js @@ -60,10 +60,10 @@ const validateForm = () => { submitForm(); // error messages - cy.get('#tags_name_help').should('be.visible').contains('name is required'); + cy.get('#tags_name_help').should('be.visible').contains('Name is required'); cy.get('#tags_description_help') .should('be.visible') - .contains('description is required'); + .contains('Description is required'); // validation should work for invalid names diff --git a/openmetadata-ui/src/main/resources/ui/src/components/SchemaTable/SchemaTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/SchemaTable/SchemaTable.component.tsx index 83148e9cce4..bec881624b8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/SchemaTable/SchemaTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/SchemaTable/SchemaTable.component.tsx @@ -13,6 +13,7 @@ import { Popover, Space, Table, Typography } from 'antd'; import { ColumnsType } from 'antd/lib/table'; +import { ExpandableConfig } from 'antd/lib/table/interface'; import FilterTablePlaceHolder from 'components/common/error-with-placeholder/FilterTablePlaceHolder'; import TableDescription from 'components/TableDescription/TableDescription.component'; import TableTags from 'components/TableTags/TableTags.component'; @@ -63,6 +64,7 @@ const SchemaTable = ({ const { t } = useTranslation(); const [searchedColumns, setSearchedColumns] = useState([]); + const [expandedRowKeys, setExpandedRowKeys] = useState([]); const sortByOrdinalPosition = useMemo( () => sortBy(tableColumns, 'ordinalPosition'), @@ -373,6 +375,21 @@ const SchemaTable = ({ onThreadLinkSelect, ] ); + const expandableConfig: ExpandableConfig = useMemo( + () => ({ + ...getTableExpandableConfig(), + rowExpandable: (record) => !isEmpty(record.children), + expandedRowKeys, + onExpand: (expanded, record) => { + setExpandedRowKeys( + expanded + ? [...expandedRowKeys, record.fullyQualifiedName ?? ''] + : expandedRowKeys.filter((key) => key !== record.fullyQualifiedName) + ); + }, + }), + [expandedRowKeys] + ); useEffect(() => { if (!searchText) { @@ -391,15 +408,12 @@ const SchemaTable = ({ columns={columns} data-testid="entity-table" dataSource={data} - expandable={{ - ...getTableExpandableConfig(), - rowExpandable: (record) => !isEmpty(record.children), - }} + expandable={expandableConfig} locale={{ emptyText: , }} pagination={false} - rowKey="id" + rowKey="fullyQualifiedName" scroll={TABLE_SCROLL_VALUE} size="middle" /> diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx index 28909bfcc16..6fcd3182218 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx @@ -64,7 +64,10 @@ export const getField = (field: FieldProp) => { if (required) { fieldRules = [ ...fieldRules, - { required, message: i18n.t('label.field-required', { field: name }) }, + { + required, + message: i18n.t('label.field-required', { field: startCase(name) }), + }, ]; }