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

Fixes #30787 - upgrade js vendor to 8.3.0 #7963

Merged
merged 1 commit into from Feb 9, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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