Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Update createNotice actions onclick -> callback
Browse files Browse the repository at this point in the history
  • Loading branch information
chihsuan committed Feb 14, 2022
1 parent 46a0a0c commit d5aca6c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions client/homescreen/activity-panel/reviews/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ReviewsPanel extends Component {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
updateReview(
reviewId,
{
Expand Down Expand Up @@ -113,7 +113,7 @@ class ReviewsPanel extends Component {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
updateReview(
reviewId,
{
Expand Down
2 changes: 1 addition & 1 deletion client/homescreen/activity-panel/stock/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class ProductStockCard extends Component {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
updateProductStock(
product,
product.stock_quantity
Expand Down
2 changes: 1 addition & 1 deletion client/inbox-panel/dismiss-all-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DismissAllModal = ( { onClose } ) => {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
batchUpdateNotes(
notesRemoved.map( ( note ) => note.id ),
{
Expand Down
2 changes: 1 addition & 1 deletion client/inbox-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const InboxPanel = ( { showHeader = true } ) => {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
updateNote( noteId, {
is_deleted: 0,
} );
Expand Down
2 changes: 1 addition & 1 deletion client/tasks/fills/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Appearance extends Component {
'Customize',
'woocommerce-admin'
),
onClick: () => {
callback: () => {
queueRecordEvent(
'tasklist_appearance_customize_homepage',
{}
Expand Down
4 changes: 2 additions & 2 deletions client/tasks/task-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const TaskListItem: React.FC< TaskListItemProps > = ( {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => undoDismissTask( id ),
callback: () => undoDismissTask( id ),
},
],
} );
Expand All @@ -84,7 +84,7 @@ export const TaskListItem: React.FC< TaskListItemProps > = ( {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => undoSnoozeTask( id ),
callback: () => undoSnoozeTask( id ),
},
],
}
Expand Down
2 changes: 1 addition & 1 deletion client/two-column-tasks/task-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const TaskList = ( {
actions: [
{
label: __( 'Undo', 'woocommerce-admin' ),
onClick: () => undoDismissTask( id ),
callback: () => undoDismissTask( id ),
},
],
} );
Expand Down
2 changes: 1 addition & 1 deletion packages/customer-effort-score/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function CustomerEffortScore( {
actions: [
{
label: __( 'Give feedback', 'woocommerce-admin' ),
onClick: () => {
callback: () => {
setVisible( true );
onModalShownCallback();
},
Expand Down
2 changes: 1 addition & 1 deletion packages/customer-effort-score/src/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe( 'CustomerEffortScore', () => {

// Assuming the first action is the "Give feedback" action,
// manually call callback.
const callback = actions[ 0 ].onClick;
const callback = actions[ 0 ].callback;
if ( typeof callback === 'function' ) {
callback();
}
Expand Down

0 comments on commit d5aca6c

Please sign in to comment.