Skip to content

Commit

Permalink
Fixes #30787 - upgrade js vendor to 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga authored and xprazak2 committed Feb 9, 2021
1 parent ccbc96d commit 7496899
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -21,7 +21,7 @@
"create-react-component": "yo react-domain"
},
"dependencies": {
"@theforeman/vendor": "^6.0.0",
"@theforeman/vendor": "^8.3.0",
"eslint-plugin-spellcheck": "0.0.17",
"intl": "~1.2.5",
"jed": "^1.1.1",
Expand Down
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import { parseDiff, Diff, markCharacterEdits } from 'react-diff-view';
import { parseDiff, Diff } from 'react-diff-view';
import { formatLines, diffLines } from 'unidiff';
import './diffview.scss';

Expand All @@ -13,20 +13,12 @@ const getDiff = (oldText, newText) => {
};

const DiffView = ({ oldText, newText, viewType, patch }) => {
const markEdits = markCharacterEdits({
threshold: 30,
markLongDistanceDiff: true,
});

// old,new Text
if (patch === '') {
const gitDiff = getDiff(oldText, newText);
const files = parseDiff(gitDiff);
const hunk = files[0].hunks;

return (
hunk && <Diff hunks={hunk} markEdits={markEdits} viewType={viewType} />
);
const { hunks, type } = files[0];
return hunks && <Diff hunks={hunks} viewType={viewType} diffType={type} />;
}
// Patch
const files = parseDiff(
Expand All @@ -42,7 +34,6 @@ const DiffView = ({ oldText, newText, viewType, patch }) => {
viewType={viewType}
diffType={type}
hunks={hunks}
markEdits={markEdits}
/>
);

Expand Down
Expand Up @@ -9,7 +9,6 @@ exports[`DiffView rendering render DiffView w/Patch 1`] = `
hideGutter={false}
hunks={Array []}
key="1111111-2222222"
markEdits={[Function]}
optimizeSelection={false}
viewType="unified"
/>
Expand Down Expand Up @@ -48,7 +47,6 @@ exports[`DiffView rendering render DiffView w/oldText & newText 1`] = `
},
]
}
markEdits={[Function]}
optimizeSelection={false}
viewType="split"
/>
Expand Down
Expand Up @@ -32,6 +32,7 @@ exports[`CustomContextSelector rendering render CustomContextSelector 1`] = `
}
}
paused={false}
preventScrollOnDeactivate={false}
>
<div
className="pf-c-select"
Expand Down

0 comments on commit 7496899

Please sign in to comment.