From e8666fa3e861d9c9b1935603e7c9ff0158a6ac0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Fri, 1 Feb 2019 15:53:13 +0100 Subject: [PATCH 1/3] Add disabled flag to download button --- .../packages/ui-components/src/buttons/DownloadButton.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js index 279c472f0e..ac24d68447 100644 --- a/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js +++ b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js @@ -3,14 +3,15 @@ import React from "react"; type Props = { displayName: string, - url: string + url: string, + disabled: boolean }; class DownloadButton extends React.Component { render() { - const { displayName, url } = this.props; + const { displayName, url, disabled } = this.props; return ( - + From 5432ee56dc00759629c58c400457f9df71358f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Fri, 1 Feb 2019 18:20:50 +0100 Subject: [PATCH 2/3] Add optional callback to download button --- .../packages/ui-components/src/buttons/DownloadButton.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js index ac24d68447..382bd500c5 100644 --- a/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js +++ b/scm-ui-components/packages/ui-components/src/buttons/DownloadButton.js @@ -4,14 +4,16 @@ import React from "react"; type Props = { displayName: string, url: string, - disabled: boolean + disabled: boolean, + onClick?: () => void }; class DownloadButton extends React.Component { render() { - const { displayName, url, disabled } = this.props; + const { displayName, url, disabled, onClick } = this.props; + const onClickOrDefault = !!onClick ? onClick : () => {}; return ( - + From ac6baa55eb18e45ad6fa557ee5fc45350f2f1b4c Mon Sep 17 00:00:00 2001 From: Mohamed Karray Date: Wed, 6 Feb 2019 09:02:03 +0000 Subject: [PATCH 3/3] Close branch feature/enhance_download_button