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

Commit

Permalink
Remove complete task option check
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatf committed Oct 19, 2021
1 parent 0044fea commit ea433e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions client/header/activity-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
const {
hasUnreadNotes,
hasAbbreviatedNotifications,
isCompletedTask,
thingsToDoNextCount,
requestingTaskListOptions,
setupTaskListComplete,
setupTaskListHidden,
trackedCompletedTasks,
previewSiteBtnTrackData,
} = useSelect( ( select ) => {
const { getOption } = select( OPTIONS_STORE_NAME );
Expand Down Expand Up @@ -154,9 +154,18 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
( list ) => list.id === 'setup' && list.isComplete
),
setupTaskListHidden: isSetupTaskListHidden,
trackedCompletedTasks:
getOption( 'woocommerce_task_list_tracked_completed_tasks' ) ||
[],
isCompletedTask: Boolean(
query.task &&
taskLists.reduce( ( value, list ) => {
return (
value ||
list.tasks.find(
( task ) =>
task.id === query.task && task.isComplete
)
);
}, false )
),
previewSiteBtnTrackData: getPreviewSiteBtnTrackData(
select,
getOption
Expand Down Expand Up @@ -343,7 +352,7 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
task &&
highlightShown !== 'yes' &&
( startedTasks || {} )[ task ] > 1 &&
! trackedCompletedTasks.includes( task )
! isCompletedTask
) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion client/header/activity-panel/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe( 'Activity Panel', () => {
requestingTaskListOptions: false,
setupTaskListComplete: false,
setupTaskListHidden: false,
trackedCompletedTasks: [ 'payment' ],
isCompletedTask: true,
} ) );

const { queryByText } = render(
Expand Down

0 comments on commit ea433e4

Please sign in to comment.