Skip to content

Commit 06d0aeb

Browse files
authored
Merge pull request #1453 from terrestris/history-config-editor
only use DiffEditor if entityHistory is enabled
2 parents cc2fabd + 8cff161 commit 06d0aeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Component/FormField/JSONEditor/JSONEditor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import _isNil from 'lodash/isNil';
3737

3838
import * as monacoEditor from 'monaco-editor';
3939

40+
import config from 'shogunApplicationConfig';
41+
4042
import {
4143
useTranslation
4244
} from 'react-i18next';
@@ -85,6 +87,8 @@ export const JSONEditor: React.FC<JSONEditorProps> = ({
8587
const originalValues = useAppSelector(state => state.originalConfigValues);
8688
const originalValue = originalValues[`${entityType}.${dataField}`];
8789

90+
const historyEnabled = config.entityHistory?.enabled;
91+
8892
const {
8993
t
9094
} = useTranslation();
@@ -234,7 +238,7 @@ export const JSONEditor: React.FC<JSONEditorProps> = ({
234238
/>
235239
</div>
236240
{
237-
isConfigEqual ? (
241+
(isConfigEqual || !historyEnabled) ? (
238242
<Editor
239243
onMount={onMount}
240244
value={currentValue}

0 commit comments

Comments
 (0)