mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 03:29:03 +00:00
fix re-render of tags component (#16270)
* fix re-render of tags component * fix cypress data issue * fix code smell
This commit is contained in:
parent
755a643f6f
commit
448f286ee3
@ -888,8 +888,8 @@ export const DOMAIN_3 = {
|
||||
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
|
||||
},
|
||||
{
|
||||
name: 'eta_predictions',
|
||||
fullyQualifiedName: 'mlflow_svc.eta_predictions',
|
||||
name: 'fact_sale',
|
||||
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.fact_sale',
|
||||
},
|
||||
{
|
||||
name: 'operations_view',
|
||||
@ -904,8 +904,8 @@ export const DOMAIN_3 = {
|
||||
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
|
||||
},
|
||||
{
|
||||
name: 'eta_predictions',
|
||||
fullyQualifiedName: 'mlflow_svc.eta_predictions',
|
||||
name: 'fact_sale',
|
||||
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.fact_sale',
|
||||
},
|
||||
{
|
||||
name: 'operations_view',
|
||||
|
||||
@ -766,7 +766,7 @@ describe('Glossary page should work properly', { tags: 'Governance' }, () => {
|
||||
.click();
|
||||
|
||||
checkDisplayName(NEW_GLOSSARY.name);
|
||||
addOwner('Aaron Johnson', GLOSSARY_OWNER_LINK_TEST_ID);
|
||||
addOwner('Alex Pollard', GLOSSARY_OWNER_LINK_TEST_ID);
|
||||
});
|
||||
|
||||
it('Remove Owner', () => {
|
||||
@ -775,7 +775,7 @@ describe('Glossary page should work properly', { tags: 'Governance' }, () => {
|
||||
.click();
|
||||
|
||||
checkDisplayName(NEW_GLOSSARY.name);
|
||||
removeOwner('Aaron Johnson', GLOSSARY_OWNER_LINK_TEST_ID);
|
||||
removeOwner('Alex Pollard', GLOSSARY_OWNER_LINK_TEST_ID);
|
||||
});
|
||||
|
||||
it('Verify and Remove Tags from Glossary', () => {
|
||||
|
||||
@ -24,7 +24,14 @@ import {
|
||||
import { AxiosError } from 'axios';
|
||||
import { debounce, isEmpty, isUndefined, pick } from 'lodash';
|
||||
import { CustomTagProps } from 'rc-select/lib/BaseSelect';
|
||||
import React, { FC, useCallback, useMemo, useRef, useState } from 'react';
|
||||
import React, {
|
||||
FC,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
|
||||
import { TAG_START_WITH } from '../../../constants/Tag.constants';
|
||||
@ -283,6 +290,10 @@ const AsyncSelectList: FC<AsyncSelectListProps & SelectProps> = ({
|
||||
onChange?.(selectedValues);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadOptions('');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Select
|
||||
autoFocus
|
||||
@ -297,7 +308,6 @@ const AsyncSelectList: FC<AsyncSelectListProps & SelectProps> = ({
|
||||
style={{ width: '100%' }}
|
||||
tagRender={customTagRender}
|
||||
onChange={handleChange}
|
||||
onFocus={() => loadOptions('')}
|
||||
onInputKeyDown={(event) => {
|
||||
if (event.key === 'Backspace') {
|
||||
return event.stopPropagation();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user