+ | (($Diff) => string | Array),
+ options?: TranslateOptions
+ ): Translator;
+
+ declare type I18nProps = {
+ i18n?: Object,
+ ns?: string | Array,
+ children: (t: TFunction, { i18n: Object, t: TFunction }) => React$Node,
+ initialI18nStore?: Object,
+ initialLanguage?: string
+ };
+ declare var I18n: React$ComponentType;
+
+ declare type InterpolateProps = {
+ className?: string,
+ dangerouslySetInnerHTMLPartElement?: string,
+ i18n?: Object,
+ i18nKey?: string,
+ options?: Object,
+ parent?: string,
+ style?: Object,
+ t?: TFunction,
+ useDangerouslySetInnerHTML?: boolean
+ };
+ declare var Interpolate: React$ComponentType;
+
+ declare type TransProps = {
+ count?: number,
+ parent?: string,
+ i18n?: Object,
+ i18nKey?: string,
+ t?: TFunction
+ };
+ declare var Trans: React$ComponentType;
+
+ declare type ProviderProps = { i18n: Object, children: React$Element<*> };
+ declare var I18nextProvider: React$ComponentType;
+
+ declare type NamespacesProps = {
+ components: Array>,
+ i18n: { loadNamespaces: Function }
+ };
+ declare function loadNamespaces(props: NamespacesProps): Promise;
+
+ declare var reactI18nextModule: {
+ type: "3rdParty",
+ init: (instance: Object) => void
+ };
+
+ declare function setDefaults(options: TranslateOptions): void;
+
+ declare function getDefaults(): TranslateOptions;
+
+ declare function getI18n(): Object;
+
+ declare function setI18n(instance: Object): void;
+}
diff --git a/scm-ui-components/packages/ui-components/package.json b/scm-ui-components/packages/ui-components/package.json
index 096a8636b3..3d52d16173 100644
--- a/scm-ui-components/packages/ui-components/package.json
+++ b/scm-ui-components/packages/ui-components/package.json
@@ -12,7 +12,7 @@
"eslint-fix": "eslint src --fix"
},
"devDependencies": {
- "@scm-manager/ui-bundler": "^0.0.17",
+ "@scm-manager/ui-bundler": "^0.0.19",
"create-index": "^2.3.0",
"enzyme": "^3.5.0",
"enzyme-adapter-react-16": "^1.3.1",
diff --git a/scm-ui-components/packages/ui-components/src/apiclient.js b/scm-ui-components/packages/ui-components/src/apiclient.js
index 0b57abeada..bd19dcdf14 100644
--- a/scm-ui-components/packages/ui-components/src/apiclient.js
+++ b/scm-ui-components/packages/ui-components/src/apiclient.js
@@ -48,6 +48,14 @@ class ApiClient {
return this.httpRequestWithJSONBody("PUT", url, contentType, payload);
}
+ head(url: string) {
+ let options: RequestOptions = {
+ method: "HEAD"
+ };
+ options = Object.assign(options, fetchOptions);
+ return fetch(createUrl(url), options).then(handleStatusCode);
+ }
+
delete(url: string): Promise {
let options: RequestOptions = {
method: "DELETE"
diff --git a/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js
new file mode 100644
index 0000000000..3a99dc876b
--- /dev/null
+++ b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js
@@ -0,0 +1,25 @@
+//@flow
+import React from "react";
+import Button, { type ButtonProps } from "./Button";
+import type {File} from "@scm-manager/ui-types";
+
+type Props = {
+ displayName: string,
+ url: string
+};
+
+class DownloadButton extends React.Component {
+ render() {
+ const {displayName, url} = this.props;
+ return (
+
+
+
+
+ {displayName}
+
+ );
+ }
+}
+
+export default DownloadButton;
diff --git a/scm-ui-components/packages/ui-components/src/buttons/index.js b/scm-ui-components/packages/ui-components/src/buttons/index.js
index d7da320fc2..2e166e1d93 100644
--- a/scm-ui-components/packages/ui-components/src/buttons/index.js
+++ b/scm-ui-components/packages/ui-components/src/buttons/index.js
@@ -7,4 +7,4 @@ export { default as DeleteButton } from "./DeleteButton.js";
export { default as EditButton } from "./EditButton.js";
export { default as RemoveEntryOfTableButton } from "./RemoveEntryOfTableButton.js";
export { default as SubmitButton } from "./SubmitButton.js";
-
+export {default as DownloadButton} from "./DownloadButton.js";
diff --git a/scm-ui-components/packages/ui-components/yarn.lock b/scm-ui-components/packages/ui-components/yarn.lock
index b4b0cc32a8..0200fdd1bf 100644
--- a/scm-ui-components/packages/ui-components/yarn.lock
+++ b/scm-ui-components/packages/ui-components/yarn.lock
@@ -641,9 +641,9 @@
version "0.0.2"
resolved "https://registry.yarnpkg.com/@scm-manager/eslint-config/-/eslint-config-0.0.2.tgz#94cc8c3fb4f51f870b235893dc134fc6c423ae85"
-"@scm-manager/ui-bundler@^0.0.17":
- version "0.0.17"
- resolved "https://registry.yarnpkg.com/@scm-manager/ui-bundler/-/ui-bundler-0.0.17.tgz#949b90ca57e4268be28fcf4975bd9622f60278bb"
+"@scm-manager/ui-bundler@^0.0.19":
+ version "0.0.19"
+ resolved "https://registry.yarnpkg.com/@scm-manager/ui-bundler/-/ui-bundler-0.0.19.tgz#646ab1fa1e5389fad614542215c60678fb9816ae"
dependencies:
"@babel/core" "^7.0.0"
"@babel/plugin-proposal-class-properties" "^7.0.0"
diff --git a/scm-ui-components/packages/ui-types/package.json b/scm-ui-components/packages/ui-types/package.json
index 0701870562..122b1ba504 100644
--- a/scm-ui-components/packages/ui-types/package.json
+++ b/scm-ui-components/packages/ui-types/package.json
@@ -14,7 +14,7 @@
"check": "flow check"
},
"devDependencies": {
- "@scm-manager/ui-bundler": "^0.0.17"
+ "@scm-manager/ui-bundler": "^0.0.19"
},
"browserify": {
"transform": [
diff --git a/scm-ui-components/packages/ui-types/yarn.lock b/scm-ui-components/packages/ui-types/yarn.lock
index 58b579d6ae..4f7257e8bb 100644
--- a/scm-ui-components/packages/ui-types/yarn.lock
+++ b/scm-ui-components/packages/ui-types/yarn.lock
@@ -707,9 +707,9 @@
version "0.0.2"
resolved "https://registry.yarnpkg.com/@scm-manager/eslint-config/-/eslint-config-0.0.2.tgz#94cc8c3fb4f51f870b235893dc134fc6c423ae85"
-"@scm-manager/ui-bundler@^0.0.17":
- version "0.0.17"
- resolved "https://registry.yarnpkg.com/@scm-manager/ui-bundler/-/ui-bundler-0.0.17.tgz#949b90ca57e4268be28fcf4975bd9622f60278bb"
+"@scm-manager/ui-bundler@^0.0.19":
+ version "0.0.19"
+ resolved "https://registry.yarnpkg.com/@scm-manager/ui-bundler/-/ui-bundler-0.0.19.tgz#646ab1fa1e5389fad614542215c60678fb9816ae"
dependencies:
"@babel/core" "^7.0.0"
"@babel/plugin-proposal-class-properties" "^7.0.0"
diff --git a/scm-ui/package.json b/scm-ui/package.json
index 8a05cb93f8..69ca90a5af 100644
--- a/scm-ui/package.json
+++ b/scm-ui/package.json
@@ -27,6 +27,7 @@
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-router-redux": "^5.0.0-alpha.9",
+ "react-syntax-highlighter": "^9.0.1",
"redux": "^4.0.0",
"redux-devtools-extension": "^2.13.5",
"redux-logger": "^3.0.6",
@@ -47,7 +48,7 @@
"pre-commit": "jest && flow && eslint src"
},
"devDependencies": {
- "@scm-manager/ui-bundler": "^0.0.17",
+ "@scm-manager/ui-bundler": "^0.0.19",
"copyfiles": "^2.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
diff --git a/scm-ui/public/index.mustache b/scm-ui/public/index.mustache
index 802be2ca97..62a40d8e93 100644
--- a/scm-ui/public/index.mustache
+++ b/scm-ui/public/index.mustache
@@ -36,5 +36,9 @@
+
+ {{#liveReloadURL}}
+
+ {{/liveReloadURL}}