mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
fix url and add the postcss-easy-import dependency
This commit is contained in:
3669
scm-ui-components/yarn.lock
Normal file
3669
scm-ui-components/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@
|
||||
"i18next-fetch-backend": "^0.1.0",
|
||||
"moment": "^2.22.2",
|
||||
"node-sass": "^4.9.3",
|
||||
"postcss-easy-import": "^3.0.0",
|
||||
"react": "^16.4.2",
|
||||
"react-diff-view": "^1.7.0",
|
||||
"react-dom": "^16.4.2",
|
||||
@@ -52,6 +53,7 @@
|
||||
"fetch-mock": "^6.5.0",
|
||||
"flow-typed": "^2.5.1",
|
||||
"jest": "^23.5.0",
|
||||
"postcss-easy-import": "^3.0.0",
|
||||
"node-sass-chokidar": "^1.3.0",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"prettier": "^1.13.7",
|
||||
|
||||
@@ -104,16 +104,6 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
path={`${url}/edit`}
|
||||
component={() => <Edit repository={repository} />}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/diff`}
|
||||
component={() => (
|
||||
<ScmDiff
|
||||
namespace={"scmadmin"}
|
||||
name={"foo"}
|
||||
revision={"4c18735d4c3bd89242284ed3eac52592637024b6"}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/permissions`}
|
||||
render={props => (
|
||||
@@ -123,6 +113,16 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/diff`}
|
||||
component={() => (
|
||||
<ScmDiff
|
||||
namespace={repository.namespace}
|
||||
name={repository.name}
|
||||
revision={"db64ca5992ad8e327c7687d49f5297bef7b29893"}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="column">
|
||||
<Navigation>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
import { Diff, Hunk, parseDiff } from "react-diff-view";
|
||||
import { apiClient } from "@scm-manager/ui-components";
|
||||
import {Diff, Hunk, parseDiff} from "react-diff-view";
|
||||
import {apiClient} from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
namespace: string,
|
||||
@@ -17,13 +17,13 @@ class ScmDiff extends React.Component<Props> {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { namespace, name, revision } = this.props;
|
||||
const url = `http://localhost:8081/scm/api/rest/v2/repositories/${namespace}/${name}/diff/${revision}`;
|
||||
const {namespace, name, revision} = this.props;
|
||||
const url = `/repositories/${namespace}/${name}/diff/${revision}`;
|
||||
apiClient
|
||||
.get(url)
|
||||
.then(response => response.text())
|
||||
.then(text => this.setState({ diff: text }))
|
||||
.catch(error => this.setState({ error }));
|
||||
.then(text => this.setState({diff: text}))
|
||||
.catch(error => this.setState({error}));
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -31,11 +31,18 @@ class ScmDiff extends React.Component<Props> {
|
||||
return null;
|
||||
}
|
||||
const files = parseDiff(this.state.diff);
|
||||
|
||||
const renderFile = ({newPath, oldRevision, newRevision, type, hunks}) => (
|
||||
<div>
|
||||
<div> File: {newPath} </div>
|
||||
<Diff key={oldRevision + '-' + newRevision} diffType={type} hunks={hunks} viewType="split">
|
||||
</Diff>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{files.map(({ hunks }, i) => (
|
||||
<Diff key={i} hunks={hunks} viewType="unified" />
|
||||
))}
|
||||
{files.map(renderFile)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1830,7 +1830,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0:
|
||||
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
|
||||
dependencies:
|
||||
@@ -3677,6 +3677,16 @@ globby@^5.0.0:
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
globby@^6.1.0:
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
|
||||
dependencies:
|
||||
array-union "^1.0.1"
|
||||
glob "^7.0.3"
|
||||
object-assign "^4.0.1"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
globule@^1.0.0:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d"
|
||||
@@ -6491,7 +6501,7 @@ performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
|
||||
pify@^2.0.0:
|
||||
pify@^2.0.0, pify@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
|
||||
@@ -6549,6 +6559,41 @@ posix-character-classes@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
|
||||
|
||||
postcss-easy-import@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/postcss-easy-import/-/postcss-easy-import-3.0.0.tgz#8eaaf5ae59566083d0cae98735dfd803e3ab194d"
|
||||
dependencies:
|
||||
globby "^6.1.0"
|
||||
is-glob "^4.0.0"
|
||||
lodash "^4.17.4"
|
||||
object-assign "^4.0.1"
|
||||
pify "^3.0.0"
|
||||
postcss "^6.0.11"
|
||||
postcss-import "^10.0.0"
|
||||
resolve "^1.1.7"
|
||||
|
||||
postcss-import@^10.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-10.0.0.tgz#4c85c97b099136cc5ea0240dc1dfdbfde4e2ebbe"
|
||||
dependencies:
|
||||
object-assign "^4.0.1"
|
||||
postcss "^6.0.1"
|
||||
postcss-value-parser "^3.2.3"
|
||||
read-cache "^1.0.0"
|
||||
resolve "^1.1.7"
|
||||
|
||||
postcss-value-parser@^3.2.3:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"
|
||||
|
||||
postcss@^6.0.1, postcss@^6.0.11:
|
||||
version "6.0.23"
|
||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324"
|
||||
dependencies:
|
||||
chalk "^2.4.1"
|
||||
source-map "^0.6.1"
|
||||
supports-color "^5.4.0"
|
||||
|
||||
prelude-ls@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||
@@ -6842,6 +6887,12 @@ react@^16.4.2:
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
read-cache@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774"
|
||||
dependencies:
|
||||
pify "^2.3.0"
|
||||
|
||||
read-only-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
|
||||
@@ -7646,7 +7697,7 @@ source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, sour
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
||||
|
||||
source-map@^0.6.0, source-map@~0.6.0, source-map@~0.6.1:
|
||||
source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
|
||||
@@ -7909,7 +7960,7 @@ supports-color@^3.1.2:
|
||||
dependencies:
|
||||
has-flag "^1.0.0"
|
||||
|
||||
supports-color@^5.3.0:
|
||||
supports-color@^5.3.0, supports-color@^5.4.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user