Skip to content

Commit 9250ab6

Browse files
authored
Merge branch 'develop' into filip/fix-year-week-boundary-bug
2 parents a66dfd7 + e169067 commit 9250ab6

17 files changed

Lines changed: 162 additions & 96 deletions

assets/css/onboarding/onboarding.css

Lines changed: 62 additions & 56 deletions
Large diffs are not rendered by default.

assets/js/onboarding/steps/OnboardingStep.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class OnboardingStep {
300300
const dashboardText =
301301
this.wizard.config?.l10n?.dashboard ||
302302
'Take me to the Recommendations dashboard';
303-
this.nextBtn.textContent = dashboardText;
303+
this.nextBtn.innerHTML = dashboardText;
304304
}
305305
}
306306

assets/js/recommendations/interactive-task.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,25 @@ const prplInteractiveTaskFormListener = {
118118
.finally( () => {
119119
// Hide loading state.
120120
prplInteractiveTaskFormListener.hideLoading( formElement );
121-
122-
// Remove the form listener once the callback is executed.
123-
formElement.removeEventListener(
124-
'submit',
125-
formSubmitHandler
126-
);
127121
} );
128122
};
129123

130124
// Add a form listener to the form.
131125
formElement.addEventListener( 'submit', formSubmitHandler );
126+
127+
// Remove the form listener when the popover is closed.
128+
document.getElementById( popoverId ).addEventListener(
129+
'toggle',
130+
( toggleEvent ) => {
131+
if ( toggleEvent.newState === 'closed' ) {
132+
formElement.removeEventListener(
133+
'submit',
134+
formSubmitHandler
135+
);
136+
}
137+
},
138+
{ once: true }
139+
);
132140
},
133141

134142
settings: ( {

classes/class-onboard-wizard.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ public function add_popover_scripts() {
315315
'startOnboarding' => \esc_html__( 'Start onboarding', 'progress-planner' ),
316316
/* translators: %s: Progress Planner name. */
317317
'privacyPolicyError' => sprintf( \esc_html__( 'You need to agree with the privacy policy to use the %s plugin.', 'progress-planner' ), \esc_html( \progress_planner()->get_ui__branding()->get_admin_menu_name() ) ),
318-
'dashboard' => \esc_html__( 'Take me to the dashboard', 'progress-planner' ),
318+
/* translators: %s: arrow icon */
319+
'dashboard' => sprintf( \esc_html__( 'Take me to the dashboard %s', 'progress-planner' ), '<span class="dashicons dashicons-arrow-right-alt2"></span>' ),
319320
'backToRecommendations' => \esc_html__( 'Back to recommendations', 'progress-planner' ),
320321
],
321322
'errorIcon' => \progress_planner()->get_asset( 'images/icon_exclamation_circle.svg' ),

classes/suggested-tasks/providers/class-set-valuable-post-types.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* Add tasks for settings saved.
3+
* Add tasks for set valuable post types.
44
*
55
* @package Progress_Planner
66
*/
77

88
namespace Progress_Planner\Suggested_Tasks\Providers;
99

1010
/**
11-
* Add tasks for settings saved.
11+
* Add tasks for set valuable post types.
1212
*/
1313
class Set_Valuable_Post_Types extends Tasks_Interactive {
1414

@@ -119,30 +119,31 @@ protected function get_title() {
119119

120120
/**
121121
* Check if the task should be added.
122-
* We add tasks only to users who have have completed "Fill the settings page" task
123-
* and have upgraded from v1.2 or have 'include_post_types' option empty.
122+
* We add tasks only to users who have upgraded from v1.2 or have 'include_post_types' option empty.
124123
* Reason being that this option was migrated,
125124
* but it could be missed, and post type selection should be revisited.
126125
*
127126
* @return bool
128127
*/
129128
public function should_add_task() {
130-
$saved_posts = \progress_planner()->get_suggested_tasks_db()->get_tasks_by( [ 'provider_id' => 'settings-saved' ] );
131-
if ( empty( $saved_posts ) ) {
129+
$activity = \progress_planner()->get_activities__query()->query_activities(
130+
[
131+
'category' => 'suggested_task',
132+
'data_id' => static::PROVIDER_ID,
133+
]
134+
);
135+
if ( ! empty( $activity ) ) {
132136
return false;
133137
}
134138

135-
// Is the task trashed?
136-
$post_trashed = 'trash' === $saved_posts[0]->post_status;
137-
138139
// Upgraded from <= 1.2?
139140
$upgraded = (bool) \get_option( 'progress_planner_set_valuable_post_types', false );
140141

141142
// Include post types option empty?
142143
$include_post_types = \progress_planner()->get_settings()->get( 'include_post_types', [] );
143144

144-
// Add the task only to users who have completed the "Settings saved" task and have upgraded from v1.2 or have 'include_post_types' option empty.
145-
return $post_trashed && ( true === $upgraded || empty( $include_post_types ) );
145+
// Add the task only to users who have upgraded from v1.2 or have 'include_post_types' option empty.
146+
return ( true === $upgraded || empty( $include_post_types ) );
146147
}
147148

148149
/**

views/onboarding/badges.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@
5656
</div>
5757
<div class="tour-footer">
5858
<div class="prpl-tour-next-wrapper">
59-
<button class="prpl-tour-next prpl-btn prpl-btn-secondary"><?php \esc_html_e( 'Got it', 'progress-planner' ); ?></button>
59+
<button class="prpl-tour-next prpl-btn prpl-btn-secondary">
60+
<?php
61+
/* translators: %s: arrow icon */
62+
printf( \esc_html__( 'Got it %s', 'progress-planner' ), '<span class="dashicons dashicons-arrow-right-alt2"></span>' );
63+
?>
64+
</button>
6065
</div>
6166
</div>
6267
</script>

views/onboarding/email-frequency.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@
9696
</div>
9797
<div class="tour-footer">
9898
<div class="prpl-tour-next-wrapper">
99-
<button class="prpl-tour-next prpl-btn prpl-btn-secondary"><?php \esc_html_e( 'Got it', 'progress-planner' ); ?></button>
99+
<button class="prpl-tour-next prpl-btn prpl-btn-secondary">
100+
<?php
101+
/* translators: %s: arrow icon */
102+
printf( \esc_html__( 'Got it %s', 'progress-planner' ), '<span class="dashicons dashicons-arrow-right-alt2"></span>' );
103+
?>
104+
</button>
100105
</div>
101106
</div>
102107
</script>

views/onboarding/first-task.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@
3131
</div>
3232
<div class="prpl-column">
3333
<?php if ( isset( $task ) ) : ?>
34-
<?php \progress_planner()->the_view( 'onboarding/tasks/' . $task['task_id'] . '.php', [ 'task' => $task ] ); ?>
34+
<?php
35+
\progress_planner()->the_view(
36+
'onboarding/tasks/' . $task['task_id'] . '.php',
37+
[
38+
'task' => $task,
39+
'show_chevron' => true,
40+
]
41+
);
42+
?>
3543
<?php endif; ?>
3644
</div>
3745
</div>

views/onboarding/more-tasks.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@
7474
</div>
7575
<div class="tour-footer">
7676
<div class="prpl-tour-next-wrapper">
77-
<button class="prpl-tour-next prpl-btn prpl-btn-secondary"><?php \esc_html_e( 'Take me to the dashboard', 'progress-planner' ); ?> &rsaquo;</button>
77+
<button class="prpl-tour-next prpl-btn prpl-btn-secondary">
78+
<?php
79+
/* translators: %s: arrow icon */
80+
printf( \esc_html__( 'Take me to the dashboard %s', 'progress-planner' ), '<span class="dashicons dashicons-arrow-right-alt2"></span>' );
81+
?>
82+
</button>
7883
</div>
7984
</div>
8085
</script>

views/onboarding/quit-confirmation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
<div class="prpl-quit-confirmation">
1919
<div class="prpl-error-box">
2020
<span class="prpl-error-icon">
21-
<?php \progress_planner()->the_asset( 'images/icon_exclamation_circle.svg' ); ?>
21+
<?php \progress_planner()->the_asset( 'images/icon_exclamation_circle_solid.svg' ); ?>
2222
</span>
2323
<div>
2424
<h3><?php \esc_html_e( 'Are you sure you want to quit?', 'progress-planner' ); ?></h3>
2525
<p>
2626
<?php
2727
/* translators: %s: Progress Planner name. */
28-
\printf( \esc_html__( 'You need to finish the onboarding before you can work with the %s and start improving your site.', 'progress-planner' ), \esc_html( \progress_planner()->get_ui__branding()->get_admin_menu_name() ) );
28+
\printf( \esc_html__( 'You need to finish the onboarding before you can work with the %s plugin and start improving your site.', 'progress-planner' ), \esc_html( \progress_planner()->get_ui__branding()->get_admin_menu_name() ) );
2929
?>
3030
</p>
3131
</div>

0 commit comments

Comments
 (0)