From 40cd87f25352993259208d487af75e008a09b2c4 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Wed, 3 Jun 2020 14:38:05 -0400 Subject: [PATCH 1/2] Adds message for unsynced projects for copy to clipboard button --- .../ClipboardCopyButton.jsx | 10 ++++++- .../ClipboardCopyButton.test.jsx | 13 ++++++++ .../Project/ProjectList/ProjectListItem.jsx | 23 +++++++++----- .../ProjectList/ProjectListItem.test.jsx | 30 +++++++++++++++++++ 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/awx/ui_next/src/components/ClipboardCopyButton/ClipboardCopyButton.jsx b/awx/ui_next/src/components/ClipboardCopyButton/ClipboardCopyButton.jsx index 8fcac00468..30367bff79 100644 --- a/awx/ui_next/src/components/ClipboardCopyButton/ClipboardCopyButton.jsx +++ b/awx/ui_next/src/components/ClipboardCopyButton/ClipboardCopyButton.jsx @@ -40,7 +40,13 @@ class ClipboardCopyButton extends React.Component { }; render() { - const { clickTip, entryDelay, exitDelay, hoverTip } = this.props; + const { + clickTip, + entryDelay, + exitDelay, + hoverTip, + isDisabled, + } = this.props; const { copied } = this.state; return ( @@ -51,6 +57,7 @@ class ClipboardCopyButton extends React.Component { content={copied ? clickTip : hoverTip} > @@ -70,10 +70,10 @@ class ClipboardCopyButton extends React.Component { } ClipboardCopyButton.propTypes = { - clickTip: PropTypes.string.isRequired, + copyTip: PropTypes.string.isRequired, entryDelay: PropTypes.number, exitDelay: PropTypes.number, - hoverTip: PropTypes.string.isRequired, + copiedSuccessTip: PropTypes.string.isRequired, stringToCopy: PropTypes.string.isRequired, switchDelay: PropTypes.number, isDisabled: PropTypes.bool.isRequired, diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx index c5090dfa30..d5651a130e 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.jsx @@ -128,14 +128,14 @@ function ProjectListItem({ {project.scm_revision.substring(0, 7)} {!project.scm_revision && ( )} , ]} diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx index d833d58c27..7866015703 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectListItem.test.jsx @@ -245,7 +245,7 @@ describe('', () => { ); expect( wrapper.find('span[aria-label="copy to clipboard disabled"]').text() - ).toBe('Sync to activate'); + ).toBe('Sync for revision'); expect(wrapper.find('ClipboardCopyButton').prop('isDisabled')).toBe(true); }); });