Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): #13963 glossary term custom property update #14035

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ const GlossaryTermsV1 = ({
tab !== 'assets' && activeTabHandler('assets');
}, [assetTabRef, tab]);

const onExtensionUpdate = async (updatedTable: GlossaryTerm) => {
await handleGlossaryTermUpdate({
...glossaryTerm,
extension: updatedTable.extension,
});
};
const onExtensionUpdate = useCallback(
async (updatedTable: GlossaryTerm) => {
await handleGlossaryTermUpdate({
...glossaryTerm,
extension: updatedTable.extension,
});
},
[glossaryTerm, handleGlossaryTermUpdate]
);

const tabItems = useMemo(() => {
const items = [
Expand Down Expand Up @@ -241,6 +244,7 @@ const GlossaryTermsV1 = ({
isVersionView,
assetPermissions,
handleAssetSave,
onExtensionUpdate,
]);

const fetchGlossaryTermAssets = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
getDiffByFieldName,
getUpdatedExtensionDiffFields,
} from '../../../utils/EntityVersionUtils';
import { getDecodedFqn } from '../../../utils/StringsUtils';
import { showErrorToast } from '../../../utils/ToastUtils';
import { usePermissionProvider } from '../../PermissionProvider/PermissionProvider';
import {
Expand Down Expand Up @@ -67,19 +68,20 @@ export const CustomPropertyTable = <T extends ExtentionEntitiesKeys>({
const [entityTypeDetailLoading, setEntityTypeDetailLoading] =
useState<boolean>(false);
const { fqn } = useParams<{ fqn: string; tab: string; version: string }>();
const decodedeFqn = getDecodedFqn(fqn);

const fetchExtentiondetails = async () => {
const response = await getEntityExtentionDetailsFromEntityType<T>(
entityType,
fqn
decodedeFqn
);

setExtentionDetails(response as ExtentionEntities[T]);
};

useEffect(() => {
fetchExtentiondetails();
}, [fqn]);
}, [decodedeFqn]);

const [typePermission, setPermission] = useState<OperationPermission>();
const versionDetails = entityDetails ?? extentionDetails;
Expand Down Expand Up @@ -128,7 +130,7 @@ export const CustomPropertyTable = <T extends ExtentionEntitiesKeys>({
setExtentionDetails(updatedData);
}
},
[versionDetails]
[versionDetails, handleExtensionUpdate]
);

const extensionObject: {
Expand Down
Loading