mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Improves copy clipaboard message and some prop names
This commit is contained in:
parent
40cd87f253
commit
edb0df788b
@ -41,10 +41,10 @@ class ClipboardCopyButton extends React.Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
clickTip,
|
||||
copyTip,
|
||||
entryDelay,
|
||||
exitDelay,
|
||||
hoverTip,
|
||||
copiedSuccessTip,
|
||||
isDisabled,
|
||||
} = this.props;
|
||||
const { copied } = this.state;
|
||||
@ -54,13 +54,13 @@ class ClipboardCopyButton extends React.Component {
|
||||
entryDelay={entryDelay}
|
||||
exitDelay={exitDelay}
|
||||
trigger="mouseenter focus click"
|
||||
content={copied ? clickTip : hoverTip}
|
||||
content={copied ? copiedSuccessTip : copyTip}
|
||||
>
|
||||
<Button
|
||||
isDisabled={isDisabled}
|
||||
variant="plain"
|
||||
onClick={this.handleCopyClick}
|
||||
aria-label={hoverTip}
|
||||
aria-label={copyTip}
|
||||
>
|
||||
<CopyIcon />
|
||||
</Button>
|
||||
@ -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,
|
||||
|
||||
@ -128,14 +128,14 @@ function ProjectListItem({
|
||||
{project.scm_revision.substring(0, 7)}
|
||||
{!project.scm_revision && (
|
||||
<Label aria-label={i18n._(t`copy to clipboard disabled`)}>
|
||||
{i18n._(t`Sync to activate`)}
|
||||
{i18n._(t`Sync for revision`)}
|
||||
</Label>
|
||||
)}
|
||||
<ClipboardCopyButton
|
||||
isDisabled={!project.scm_revision}
|
||||
stringToCopy={project.scm_revision}
|
||||
hoverTip={i18n._(t`Copy full revision to clipboard.`)}
|
||||
clickTip={i18n._(t`Successfully copied to clipboard!`)}
|
||||
copyTip={i18n._(t`Copy full revision to clipboard.`)}
|
||||
copiedSuccessTip={i18n._(t`Successfully copied to clipboard!`)}
|
||||
/>
|
||||
</DataListCell>,
|
||||
]}
|
||||
|
||||
@ -245,7 +245,7 @@ describe('<ProjectsListItem />', () => {
|
||||
);
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user