Add text for manage button when no help text exists (https://github.com/woocommerce/woocommerce-admin/pull/7191)
* Add text for manage button when no help text exists * Update manage button text to set up * Handle PR feedback
This commit is contained in:
parent
3327a23378
commit
86ee870873
|
@ -240,8 +240,8 @@
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: $studio-gray-50;
|
color: $studio-gray-50;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-top: 16px;
|
margin-top: $gap;
|
||||||
margin-bottom: $gap-smaller;
|
margin-bottom: $gap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,16 @@ export const Connect = ( {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ helpText }
|
{ helpText || (
|
||||||
|
<p>
|
||||||
|
{ __(
|
||||||
|
"You can manage this payment gateway's settings by clicking the button below",
|
||||||
|
'woocommerce-admin'
|
||||||
|
) }
|
||||||
|
</p>
|
||||||
|
) }
|
||||||
<Button isPrimary href={ settingsUrl }>
|
<Button isPrimary href={ settingsUrl }>
|
||||||
{ __( 'Manage', 'woocommerce-admin' ) }
|
{ __( 'Set up', 'woocommerce-admin' ) }
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -68,7 +68,7 @@ describe( 'Connect', () => {
|
||||||
expect( inputs[ 1 ].placeholder ).toBe( 'API secret' );
|
expect( inputs[ 1 ].placeholder ).toBe( 'API secret' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should render the manage button when no connection URL or fields exist', () => {
|
it( 'should render the set up button when no connection URL or fields exist', () => {
|
||||||
const props = {
|
const props = {
|
||||||
...defaultProps,
|
...defaultProps,
|
||||||
paymentGateway: {
|
paymentGateway: {
|
||||||
|
@ -80,7 +80,7 @@ describe( 'Connect', () => {
|
||||||
const { container } = render( <Connect { ...props } /> );
|
const { container } = render( <Connect { ...props } /> );
|
||||||
|
|
||||||
const button = container.querySelector( 'a' );
|
const button = container.querySelector( 'a' );
|
||||||
expect( button.textContent ).toBe( 'Manage' );
|
expect( button.textContent ).toBe( 'Set up' );
|
||||||
expect( button.href ).toBe( mockGateway.settingsUrl );
|
expect( button.href ).toBe( mockGateway.settingsUrl );
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in New Issue