Add edit button to variations list items (#36079)

* Add edit button to variations list items

* Add comment feedbacks
This commit is contained in:
Maikel David Pérez Gómez 2022-12-27 15:22:52 -03:00 committed by GitHub
parent 5137973d91
commit 8fc2818e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View File

@ -51,6 +51,7 @@
.components-button {
position: relative;
color: var(--wp-admin-theme-color);
&:disabled,
&[aria-disabled='true'] {

View File

@ -7,7 +7,14 @@ import {
EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME,
ProductVariation,
} from '@woocommerce/data';
import { ListItem, Pagination, Sortable, Tag } from '@woocommerce/components';
import {
Link,
ListItem,
Pagination,
Sortable,
Tag,
} from '@woocommerce/components';
import { getNewPath } from '@woocommerce/navigation';
import { useContext, useState } from '@wordpress/element';
import { useParams } from 'react-router-dom';
import { useSelect, useDispatch } from '@wordpress/data';
@ -192,6 +199,17 @@ export const Variations: React.FC = () => {
{ getProductStockStatus( variation ) }
</div>
<div className="woocommerce-product-variations__actions">
<Link
href={ getNewPath(
{},
`/product/${ productId }/variation/${ variation.id }`
) }
type="wc-admin"
className="components-button"
>
{ __( 'Edit', 'woocommerce' ) }
</Link>
{ variation.status === 'private' && (
<Tooltip
position="top center"

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add edit button to variations list items