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): Convert clipboard copy to typescript #2131

Merged
merged 14 commits into from Jun 27, 2019

Conversation

@jessiehuff
Copy link
Contributor

jessiehuff commented May 31, 2019

Fixes #2130

@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented May 31, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented May 31, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@a5d571e). Click here to learn what that means.
The diff coverage is 74.46%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2131   +/-   ##
=========================================
  Coverage          ?   80.54%           
=========================================
  Files             ?      666           
  Lines             ?     8470           
  Branches          ?      729           
=========================================
  Hits              ?     6822           
  Misses            ?     1281           
  Partials          ?      367
Flag Coverage Δ
#patternfly3 85.23% <ø> (?)
#patternfly4 76.09% <74.46%> (?)
#patternflymisc 95.79% <ø> (?)
Impacted Files Coverage Δ
...c/components/ClipboardCopy/ClipboardCopyButton.tsx 66.66% <66.66%> (ø)
...components/ClipboardCopy/ClipboardCopyExpanded.tsx 75% <75%> (ø)
...c/components/ClipboardCopy/ClipboardCopyToggle.tsx 84.61% <84.61%> (ø)

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 a5d571e...1b34124. Read the comment docs.

Copy link
Contributor

redallen left a comment

Thank you! 🎖

@@ -31,7 +31,7 @@ export interface TooltipProps extends Omit<HTMLProps<HTMLDivElement>, 'content'
/** z-index of the tooltip */
zIndex?: number;
/** Size of the tooltip */
maxWidth?: '12.5rem';
maxWidth?: string;

This comment has been minimized.

Copy link
@redallen

redallen Jun 3, 2019

Contributor

Good catch!

/** Flag to show if the input is read only. */
isReadOnly?: boolean;
/** Adds Clipboard Copy variant styles. */
variant?: typeof ClipboardCopyVariant | 'inline' | 'expansion';

This comment has been minimized.

Copy link
@tlabaj

tlabaj Jun 17, 2019

Contributor

I thought we decided to just have the union of the values here and not the "Typeof"

This comment has been minimized.

Copy link
@jessiehuff

jessiehuff Jun 17, 2019

Author Contributor

I believe that we need the typeof for the older consumers using the enum.

it('Verify content expands', () => {
cy.get('.pf-c-clipboard-copy__group-toggle').click();
cy.get('.pf-c-clipboard-copy').should('have.class', 'pf-m-expanded');
});

This comment has been minimized.

Copy link
@tlabaj

tlabaj Jun 17, 2019

Contributor

I think we should add more verification steps here. We dod not verify that the copy actually works and I think we need to.

This comment has been minimized.

Copy link
@jessiehuff

jessiehuff Jun 17, 2019

Author Contributor

Do you know of a good way to test the copy paste feature? I tried this:

it('Verify copy to clipboard works', () => {
    const form = cy.get('.pf-c-form-control');
    form.clear().type('Hi'); 
    cy.get('.pf-c-clipboard-copy__group-copy').click(); 
    cy.get('.pf-c-form-control').clear().type('{cmd}v');
    form.should('have.value', 'Hi'); 
  });

But it always ends up typing "v" instead of doing a paste. I've been looking into it, but I'm not sure what the solution would be: cypress-io/cypress#3316

@jessiehuff jessiehuff force-pushed the jessiehuff:feat/clipboardTS branch from 6ff9c33 to 762c9fe Jun 18, 2019
Jessie
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Jun 18, 2019

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

Jessie
Jessie
Jessie
@tlabaj
tlabaj approved these changes Jun 27, 2019
Copy link
Contributor

tlabaj left a comment

LGTM

@dlabaj
dlabaj approved these changes Jun 27, 2019
@dlabaj dlabaj merged commit 44168dd into patternfly:master Jun 27, 2019
8 checks passed
8 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_integration Your tests passed on CircleCI!
Details
ci/circleci: build_pf3_docs Your tests passed on CircleCI!
Details
ci/circleci: build_pf4_docs Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test_jest_other Your tests passed on CircleCI!
Details
ci/circleci: test_jest_pf4 Your tests passed on CircleCI!
Details
ci/circleci: upload_docs Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.