mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-11 00:35:22 +00:00
FIX: parsing error in case of special character in tag for BulkEdit/Import case (#20776)
* fix parsing error in case of special character in tag for BulkEdit/Import case * change the behaviour to generic one and fix sonar issue * re-added the minor miss * changes as per comments
This commit is contained in:
parent
c1d7414578
commit
e80d385fd6
@ -17,7 +17,7 @@ import {
|
||||
FIELD_VALUES_CUSTOM_PROPERTIES,
|
||||
} from '../constant/glossaryImportExport';
|
||||
import { GlobalSettingOptions } from '../constant/settings';
|
||||
import { descriptionBox, uuid } from './common';
|
||||
import { descriptionBox, descriptionBoxReadOnly, uuid } from './common';
|
||||
import {
|
||||
addCustomPropertiesForEntity,
|
||||
fillTableColumnInputDetails,
|
||||
@ -170,6 +170,10 @@ const editGlossaryCustomProperty = async (
|
||||
.getByTestId('value-input')
|
||||
.fill(FIELD_VALUES_CUSTOM_PROPERTIES.STRING);
|
||||
await page.getByTestId('inline-save-btn').click();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(propertyName).getByTestId('value')
|
||||
).toHaveText(FIELD_VALUES_CUSTOM_PROPERTIES.STRING);
|
||||
}
|
||||
|
||||
if (type === CUSTOM_PROPERTIES_TYPES.MARKDOWN) {
|
||||
@ -184,6 +188,10 @@ const editGlossaryCustomProperty = async (
|
||||
await page.waitForSelector(descriptionBox, {
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
await expect(
|
||||
page.getByTestId(propertyName).locator(descriptionBoxReadOnly)
|
||||
).toContainText('### Overview');
|
||||
}
|
||||
|
||||
if (type === CUSTOM_PROPERTIES_TYPES.SQL_QUERY) {
|
||||
@ -193,6 +201,10 @@ const editGlossaryCustomProperty = async (
|
||||
.fill(FIELD_VALUES_CUSTOM_PROPERTIES.SQL_QUERY);
|
||||
|
||||
await page.getByTestId('inline-save-btn').click();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(propertyName).locator('.CodeMirror-lines')
|
||||
).toContainText(FIELD_VALUES_CUSTOM_PROPERTIES.SQL_QUERY);
|
||||
}
|
||||
|
||||
if (type === CUSTOM_PROPERTIES_TYPES.TABLE) {
|
||||
@ -206,6 +218,14 @@ const editGlossaryCustomProperty = async (
|
||||
await fillTableColumnInputDetails(page, values[1], columns[1]);
|
||||
|
||||
await page.locator('[data-testid="update-table-type-property"]').click();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(propertyName).getByRole('cell', { name: columns[0] })
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(propertyName).getByRole('cell', { name: values[0] })
|
||||
).toBeVisible();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -15,16 +15,20 @@ import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { AxiosError } from 'axios';
|
||||
import { CustomizeEntityType } from '../../../constants/Customize.constants';
|
||||
import { Table } from '../../../generated/entity/data/table';
|
||||
import { Type } from '../../../generated/entity/type';
|
||||
import { getTypeByFQN } from '../../../rest/metadataTypeAPI';
|
||||
import {
|
||||
convertCustomPropertyStringToEntityExtension,
|
||||
convertEntityExtensionToCustomPropertyString,
|
||||
} from '../../../utils/CSV/CSV.utils';
|
||||
import { DEFAULT_ENTITY_PERMISSION } from '../../../utils/PermissionsUtils';
|
||||
import { showErrorToast } from '../../../utils/ToastUtils';
|
||||
import { CustomPropertyTable } from '../../common/CustomPropertyTable/CustomPropertyTable';
|
||||
import { ExtentionEntities } from '../../common/CustomPropertyTable/CustomPropertyTable.interface';
|
||||
import Loader from '../../common/Loader/Loader';
|
||||
import { GenericProvider } from '../../Customization/GenericProvider/GenericProvider';
|
||||
import {
|
||||
ExtensionDataProps,
|
||||
ModalWithCustomPropertyEditorProps,
|
||||
@ -74,6 +78,12 @@ export const ModalWithCustomPropertyEditor = ({
|
||||
setIsSaveLoading(false);
|
||||
};
|
||||
|
||||
const onExtensionUpdate = async (
|
||||
data: ExtentionEntities[keyof ExtentionEntities]
|
||||
) => {
|
||||
setExtensionObject(data.extension);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchTypeDetail();
|
||||
}, []);
|
||||
@ -111,12 +121,24 @@ export const ModalWithCustomPropertyEditor = ({
|
||||
{isLoading ? (
|
||||
<Loader />
|
||||
) : (
|
||||
<CustomPropertyTable
|
||||
hasEditAccess
|
||||
hasPermission
|
||||
isRenderedInRightPanel
|
||||
entityType={entityType as keyof ExtentionEntities}
|
||||
/>
|
||||
<GenericProvider<Table>
|
||||
customizedPage={null}
|
||||
data={
|
||||
{
|
||||
extension: extensionObject,
|
||||
} as Table
|
||||
}
|
||||
isVersionView={false}
|
||||
permissions={DEFAULT_ENTITY_PERMISSION}
|
||||
type={entityType as CustomizeEntityType}
|
||||
onUpdate={onExtensionUpdate}>
|
||||
<CustomPropertyTable
|
||||
hasEditAccess
|
||||
hasPermission
|
||||
isRenderedInRightPanel
|
||||
entityType={entityType as keyof ExtentionEntities}
|
||||
/>
|
||||
</GenericProvider>
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
|
@ -69,7 +69,6 @@ export const CustomPropertyTable = <T extends ExtentionEntitiesKeys>({
|
||||
onUpdate,
|
||||
filterWidgets,
|
||||
} = useGenericContext<ExtentionEntities[T]>();
|
||||
|
||||
const [entityTypeDetail, setEntityTypeDetail] = useState<Type>({} as Type);
|
||||
const [entityTypeDetailLoading, setEntityTypeDetailLoading] =
|
||||
useState<boolean>(true);
|
||||
|
@ -43,9 +43,11 @@ class CSVUtilsClassBase {
|
||||
'extension',
|
||||
'synonyms',
|
||||
'description',
|
||||
'tags',
|
||||
'glossaryTerms',
|
||||
'relatedTerms',
|
||||
'column.description',
|
||||
'column.tags',
|
||||
'column.glossaryTerms',
|
||||
];
|
||||
}
|
||||
@ -136,9 +138,7 @@ class CSVUtilsClassBase {
|
||||
: undefined;
|
||||
|
||||
const handleChange = (tags: TagLabel[]) => {
|
||||
props.onChange(
|
||||
tags.map((tag) => tag.tagFQN.replaceAll('"', '""')).join(';')
|
||||
);
|
||||
props.onChange(tags.map((tag) => tag.tagFQN).join(';'));
|
||||
};
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user