Fixed: Advanced settings for Metadata consumers

pull/10799/head
Bogdan 1 month ago
parent d34d23a052
commit af60cca9ae

@ -1,5 +1,6 @@
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import AppState from 'App/State/AppState';
import Modal from 'Components/Modal/Modal';
import { sizes } from 'Helpers/Props';
import { clearPendingChanges } from 'Store/Actions/baseActions';
@ -7,7 +8,8 @@ import EditMetadataModalContent, {
EditMetadataModalContentProps,
} from './EditMetadataModalContent';
interface EditMetadataModalProps extends EditMetadataModalContentProps {
interface EditMetadataModalProps
extends Omit<EditMetadataModalContentProps, 'advancedSettings'> {
isOpen: boolean;
}
@ -18,6 +20,10 @@ function EditMetadataModal({
}: EditMetadataModalProps) {
const dispatch = useDispatch();
const advancedSettings = useSelector(
(state: AppState) => state.settings.advancedSettings
);
const handleModalClose = useCallback(() => {
dispatch(clearPendingChanges({ section: 'metadata' }));
onModalClose();
@ -27,6 +33,7 @@ function EditMetadataModal({
<Modal size={sizes.MEDIUM} isOpen={isOpen} onModalClose={handleModalClose}>
<EditMetadataModalContent
{...otherProps}
advancedSettings={advancedSettings}
onModalClose={handleModalClose}
/>
</Modal>

@ -95,7 +95,6 @@ function Metadata({ id, name, enable, fields }: MetadataProps) {
) : null}
<EditMetadataModal
advancedSettings={false}
id={id}
isOpen={isEditMetadataModalOpen}
onModalClose={handleModalClose}

Loading…
Cancel
Save