Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clipboardcopy): add clipboardcopy to PF4 #1538

Merged
merged 1 commit into from
Apr 22, 2019
Merged

feat(clipboardcopy): add clipboardcopy to PF4 #1538

merged 1 commit into from
Apr 22, 2019

Conversation

boaz0
Copy link
Member

@boaz0 boaz0 commented Mar 11, 2019

What:

closes #1417

Adding copy to clipboard into patternfly 4 react-core.

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://1538-pr-patternfly-react-patternfly.surge.sh

@codecov-io
Copy link

codecov-io commented Mar 11, 2019

Codecov Report

Merging #1538 into master will increase coverage by 0.01%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1538      +/-   ##
==========================================
+ Coverage   82.77%   82.79%   +0.01%     
==========================================
  Files         601      604       +3     
  Lines        6642     6655      +13     
  Branches       72       72              
==========================================
+ Hits         5498     5510      +12     
- Misses       1117     1118       +1     
  Partials       27       27
Flag Coverage Δ
#patternfly3 84.87% <ø> (ø) ⬆️
#patternfly4 79.53% <92.3%> (+0.06%) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...ct-core/src/components/ClipboardCopy/CopyButton.js 100% <100%> (ø)
...-core/src/components/ClipboardCopy/ToggleButton.js 100% <100%> (ø)
...re/src/components/ClipboardCopy/ExpandedContent.js 80% <80%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a42019...26c3de7. Read the comment docs.

@tlabaj tlabaj self-assigned this Mar 11, 2019
@tlabaj tlabaj requested review from tlabaj and kmcfaul March 11, 2019 15:37
@dgutride
Copy link
Member

patternfly/patternfly#505 - here is the relevant patternfly core issue/design links

@rachael-phillips
Copy link
Contributor

Related issue: #1417

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boaz0 can you update the description to include the related issue #1417

@christiemolloy
Copy link
Member

@boaz0 I believe that when you click on the "copy to clipboard" button the popover should remain for 2 seconds approximately. @mcarrano are you able to check on this? Otherwise looks really good!

@mcarrano
Copy link
Member

@boaz0 @christiemolloy Yes, the message that appears after you click Copy should stay for at least 2 seconds (maybe more?). We did not have a spec on this but I would try adding a 2 second timer and see how that feels.

Also, I noticed that in the Expandable version, the expansion area is not editable. It needs to be if a user is to be able to edit the entire contents. Also note that per the design. we should show the truncation ellipses when the text in the field gets truncated. See below.

Screen Shot 2019-03-13 at 5 06 54 PM

dlabaj
dlabaj previously approved these changes Mar 19, 2019
@tlabaj tlabaj added the A11y label Mar 21, 2019
@tlabaj tlabaj requested a review from jgiardino March 21, 2019 14:57
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add this the the react-integration app?

@jgiardino
Copy link
Collaborator

Great job on this, @boaz0! This looks great from an a11y perspective!

Yes, the message that appears after you click Copy should stay for at least 2 seconds (maybe more?). We did not have a spec on this but I would try adding a 2 second timer and see how that feels.

I agree that the tooltip should remain visible longer. For screen reader users, this pattern requires some updates to the tooltip so that the tooltip can function as an alert. This isn't a variation we support at the moment. I'll capture issues in core and react for this.

Also, I noticed that in the Expandable version, the expansion area is not editable. It needs to be if a user is to be able to edit the entire contents.

This is handled in core css. When I inspect the element, I don't see the overflow property that handles this in core. Maybe this was recently added to the core css and hasn't been pulled in yet?

tlabaj
tlabaj previously approved these changes Mar 28, 2019
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christiemolloy
Copy link
Member

@boaz0 I believe that when you click on the "copy to clipboard" button the popover should remain for 2 seconds approximately.

I had left this comment but it hasn't been implemented yet, could you try implementing the success tooltip to remain for 2 seconds?

@christiemolloy
Copy link
Member

Also, when I type a lot of characters this happens, it might be something that we need on the Core side @mcoker do you know if we should add white-space: pre

Screen Shot 2019-03-28 at 4 42 15 PM

@dlabaj dlabaj self-assigned this Mar 29, 2019
@boaz0
Copy link
Member Author

boaz0 commented Mar 31, 2019

@christiemolloy do you mind verifying that it is OK now. Thanks a lot

@christiemolloy
Copy link
Member

@boaz0 Im still seeing this
Screen Shot 2019-04-01 at 11 26 59 AM

@boaz0
Copy link
Member Author

boaz0 commented Apr 1, 2019

It's going to be replaced by textarea. I will update it soon.

Thanks.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way documentation is generated has been changed. Can you please remove the examples file. All examples should be in the md file.

@boaz0
Copy link
Member Author

boaz0 commented Apr 15, 2019

@tlabaj yes sure.

tlabaj
tlabaj previously approved these changes Apr 15, 2019
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christiemolloy
Copy link
Member

A few comments:

In React there is no ... where the text gets cut off in the input group. This is how it should look:
Screen Shot 2019-04-15 at 2 05 25 PM

Looks like the popover isn't directly in the center of the Copy to Clipboard icon
Screen Shot 2019-04-15 at 2 04 45 PM

Also looks like that when the clipboard copy button is selected the popover doesnt remain for 2 seconds.

@boaz0
Copy link
Member Author

boaz0 commented Apr 15, 2019

@christiemolloy

1 - We need to update the patternfly-next package to have that change.
2 - I believe it is related to #1740.
3 - Thanks for noticing, fixed that.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

import { ClipboardCopy } from '@patternfly/react-core';
class SimpleClipboardCopy extends React.Component {
render() {
return <ClipboardCopy isReadOnly>This is editable</ClipboardCopy>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say "not editable" since it's read only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang! You're right!

@mcoker
Copy link
Contributor

mcoker commented Apr 18, 2019

What's the purpose of the <textarea>? It has inline styles, the font-size is too big, and it scrolls instead of the expandable content container, so the overflow and scrollbar look odd.

Screen Shot 2019-04-18 at 5 46 55 PM

If we're going to keep that in the component, and the <textarea> should always wrap the expanded content, can we bring the element and the styling to core and fix the overflow/scrolling there, too?

If it was added to address the text wrapping issue @christiemolloy mentioned, we should be able to address that behavior in core, too, without the need for <textarea>.

@tlabaj tlabaj merged commit 6a5305e into patternfly:master Apr 22, 2019
@boaz0
Copy link
Member Author

boaz0 commented Apr 22, 2019

@mcoker I added textarea because @mcarrano mentioned that the text should also be edited through the expanded content block.

Yep, you're right, I should have done it in core but I wanted to get feedback as soon as possible. I will take care of it if you don't mind.

Sorry for the mess.

Thanks.

@mcoker
Copy link
Contributor

mcoker commented Apr 22, 2019

@boaz0 ah, I see! That's definitely a use case for a <textarea>. I also wonder if contenteditable on the HTMl element would work, which allows us to retain the styling and not need to introduce a new element?

@boaz0
Copy link
Member Author

boaz0 commented Apr 22, 2019

@mcoker
First time I have heard of contenteditable - thanks.
Yes, it seems to work too. 👍

@boaz0 boaz0 deleted the clipboardcopy_pf4 branch April 24, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy to Clipboard