Skip to content

Commit 76658cb

Browse files
committed
Merge branch 'formatters2' into dev
2 parents bcfbdbf + a0a6931 commit 76658cb

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"html-react-parser": "^5.0.11",
174174
"intro.js": "^7.2.0",
175175
"intro.js-react": "^1.0.0",
176-
"jsondiffpatch": "^0.6.0",
176+
"jsondiffpatch": "^0.5.0",
177177
"lodash": "^4.17.21",
178178
"node": "^18.12.1",
179179
"rc-slider": "^10.5.0",

src/app/components/StateRoute/History.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
// @ts-nocheck
44
import React, { useEffect } from 'react';
55
// formatting findDiff return data to show the changes with colors, aligns with actions.tsx
6-
import { diff } from 'jsondiffpatch';
7-
const jsondiffpatch = require('jsondiffpatch');
8-
// import * as jsondiffpatch from 'jsondiffpatch';
9-
// import { diff } from 'jsondiffpatch';
10-
// import jsondiffpatch from 'jsondiffpatch/formatters';
11-
// const jsondiffpatch = require('jsondiffpatch');
6+
import { diff, formatters } from 'jsondiffpatch';
127
import * as d3 from 'd3';
138
import { DefaultMargin } from '../../FrontendTypes';
149
import { useDispatch } from 'react-redux';
@@ -159,7 +154,7 @@ function History(props: Record<string, unknown>): JSX.Element {
159154
statelessCleaning(snapshots[index]),
160155
);
161156
const changedState = findStateChangeObj(delta); // determines if delta had any stateful changes
162-
const html = jsondiffpatch.formatters(changedState[0]); // formats the difference into html string
157+
const html = formatters.html.format(changedState[0]); // formats the difference into html string
163158
return html; // return html string
164159
}
165160

0 commit comments

Comments
 (0)