Skip to content

v1.6.0 #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 498 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
498 commits
Select commit Hold shift + click to select a range
a2ebc19
Merge branch 'ari/rr-underscore-template' into ari/tasks-cpt-2
aristath Jun 3, 2025
7d11425
cleanup
aristath Jun 3, 2025
e50c2cd
cleanup
aristath Jun 3, 2025
5538f01
prplSuggestedTask.getPostsCollectionPromise
aristath Jun 3, 2025
70d1633
load posts in series
aristath Jun 3, 2025
eb78cb4
bugfix
aristath Jun 3, 2025
8031e6b
simplification
aristath Jun 3, 2025
8c05ae8
small refactor - move tasks injection
aristath Jun 3, 2025
a47f77b
Backport
aristath Jun 3, 2025
ecdba39
merge dev into ...
ilicfilip Jun 3, 2025
4447b3d
object, not array
ilicfilip Jun 3, 2025
6f2f4d7
use a promise when getting terms
aristath Jun 4, 2025
8db30f3
single line, to remove blank lines in Chrome
aristath Jun 4, 2025
2a2a926
yet another bugfix
aristath Jun 4, 2025
bfcfc35
Log more info
aristath Jun 4, 2025
e13d7ad
tweak messages
aristath Jun 4, 2025
30b0bda
Merge branch 'develop' into ari/tasks-cpt-2
aristath Jun 4, 2025
ac7c00f
remove line wqhich was added for a fake merge
aristath Jun 4, 2025
32580ad
Merge branch 'develop' into ari/tasks-cpt-2
aristath Jun 4, 2025
bd9f10d
Merge branch 'develop' into ari/tasks-cpt-2
aristath Jun 4, 2025
b3d9af8
syntax tweak
aristath Jun 4, 2025
29be6b0
Merge branch 'develop' into filip/wp-cli
ilicfilip Jun 4, 2025
e687de0
tweak injectItems method
aristath Jun 4, 2025
14662d0
backfix & backport https://github.com/ProgressPlanner/progress-planne…
aristath Jun 4, 2025
7a73eac
Merge branch 'develop' into ari/tasks-cpt-2
aristath Jun 4, 2025
edc9376
Cleanup: remove the prpl-suggested-task web-component
aristath Jun 4, 2025
32eae42
Move event listener & tweak to use listId
aristath Jun 5, 2025
cc3d494
Add insertPosition arg
aristath Jun 5, 2025
7598b23
Deprecate the `prpl/todo/injectItem` event
aristath Jun 5, 2025
3d4ed52
show reorder buttons
aristath Jun 5, 2025
b3e9cf8
bugfix saving new menu_order
aristath Jun 5, 2025
b0ba2ad
cleanup
aristath Jun 5, 2025
1135e25
`window.progressPlannerTodo` is no longer needed
aristath Jun 5, 2025
f1a5703
Properly order todos on load
aristath Jun 5, 2025
c13e623
Remove console.log
aristath Jun 5, 2025
a007015
bugfix missing category & provider slugs
aristath Jun 5, 2025
3b951fc
improve a11y hook
aristath Jun 5, 2025
376a2ae
WIP for completing todos
aristath Jun 5, 2025
eabef99
afterInject -> afterRequestComplete & fix when no items are fetched
ilicfilip Jun 5, 2025
a8c66dc
bring back task list style & fix e2e tests
ilicfilip Jun 5, 2025
12b1e6d
Merge branch 'main' into develop
aristath Jun 5, 2025
d57e161
Merge branch 'develop' into ari/tasks-cpt-2
aristath Jun 5, 2025
9dc25bc
Merge branch 'develop' into filip/wp-cli
ilicfilip Jun 5, 2025
102d6a2
Add `window.prplGetTermsCollectionsPromises()`
aristath Jun 5, 2025
cf3e701
l10n tweak
aristath Jun 5, 2025
8249ada
Remove extraneous wp.api.loadPromise
aristath Jun 5, 2025
057e0f7
remove recursive call
ilicfilip Jun 5, 2025
f22f3ea
Additiona to previous commit
aristath Jun 5, 2025
dc8695e
Merge remote-tracking branch 'origin/ari/tasks-cpt-2' into ari/tasks-…
ilicfilip Jun 5, 2025
8d8e360
one more cleanup for custom web component
ilicfilip Jun 5, 2025
ef80f09
parseInt, comparison failed without it
ilicfilip Jun 5, 2025
40d898b
reverse check, as undefined values trigger requests
ilicfilip Jun 5, 2025
162c215
Show completed todos
aristath Jun 5, 2025
1ddddd0
Oops
aristath Jun 5, 2025
6369269
remove console.log
aristath Jun 5, 2025
6492823
proprly check checkboxes for completed tasks
aristath Jun 5, 2025
c2eb3b4
Allow moving todos from completed to pending
aristath Jun 5, 2025
189081e
call prplGetTermsCollectionPromise only once
ilicfilip Jun 5, 2025
3ec3152
half fix
ilicfilip Jun 5, 2025
ac1ae3f
Merge branch 'filip/cpt-2-test' into ari/tasks-cpt-2
aristath Jun 6, 2025
99371af
another semi working state
ilicfilip Jun 6, 2025
d6d5d38
more wip
ilicfilip Jun 6, 2025
00e160c
explicit check for every post status
ilicfilip Jun 6, 2025
65fce83
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
ilicfilip Jun 7, 2025
9a1c8d2
another one for post statuses
ilicfilip Jun 7, 2025
ffd6143
`pending` is not a valid post-status
aristath Jun 9, 2025
bb1b519
Remove custom `pending_celebration` post-status
aristath Jun 9, 2025
f1ca98f
allowReorder & deletable are set in the template & really delete the …
ilicfilip Jun 9, 2025
c1e21c0
fix creating first golden task
ilicfilip Jun 9, 2025
8baad88
wait for all requests to finish before resolving the promise
ilicfilip Jun 9, 2025
1283b60
Move updateRaviGauge function
aristath Jun 9, 2025
61564da
dont remove golden task from DOM & resize grid
ilicfilip Jun 9, 2025
a71979f
fix dashboard widgets
ilicfilip Jun 9, 2025
77d6001
remove console.log
ilicfilip Jun 9, 2025
1b7db56
Remove non-existent tests class
aristath Jun 9, 2025
7a11c9a
Merge remote-tracking branch 'origin/ari/tasks-cpt-2' into ari/tasks-…
aristath Jun 9, 2025
df61f9a
partial revert of earlier commit
aristath Jun 9, 2025
fa37dcf
Some inline docs
aristath Jun 9, 2025
0f62540
fix re-injecting tasks after completion
ilicfilip Jun 9, 2025
4844460
Merge remote-tracking branch 'origin/ari/tasks-cpt-2' into ari/tasks-…
ilicfilip Jun 9, 2025
5774df9
Add `prplGetTerms()`
aristath Jun 9, 2025
d2865f6
strike through golden task properly
ilicfilip Jun 9, 2025
6da337a
trigger resize after todo item is deleted
ilicfilip Jun 9, 2025
7688887
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
ilicfilip Jun 9, 2025
1ac4753
re-inject after post is snoozed
ilicfilip Jun 9, 2025
6f44530
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
ilicfilip Jun 9, 2025
feb9556
injectItemsFromCategory instead of 'maybeInjectItem' event
ilicfilip Jun 9, 2025
c7b95a1
dont escape URL
ilicfilip Jun 9, 2025
0cb731f
use injectTrigger out of injectItems, use Promise & .then
ilicfilip Jun 9, 2025
fe945f4
dont escape URL
ilicfilip Jun 9, 2025
2d06f5b
restructure terms script
aristath Jun 10, 2025
82b16b3
rename getTermObject to getTerm
aristath Jun 10, 2025
ae03552
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
ilicfilip Jun 10, 2025
2cf8258
getTerm
ilicfilip Jun 10, 2025
30e39d1
inject pending celebration tasks
ilicfilip Jun 10, 2025
c3129e2
Shorter
aristath Jun 10, 2025
3a0dffd
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
aristath Jun 10, 2025
0d9994f
small celebrate refactor
ilicfilip Jun 10, 2025
dede9b6
Merge remote-tracking branch 'origin/filip/cpt-2-test' into filip/cpt…
ilicfilip Jun 10, 2025
fa542f1
Merge branch 'filip/cpt-2-test' into ari/tasks-cpt-2
aristath Jun 10, 2025
fb7c512
JS tweaks
aristath Jun 10, 2025
053c2b0
we dont need factory here anymore
ilicfilip Jun 10, 2025
077df96
remove get_task_details from 'maybe_enqueue_focus_el_script' as well
ilicfilip Jun 10, 2025
70decd7
set popover_id
ilicfilip Jun 10, 2025
49eaa7b
set popover_id
ilicfilip Jun 10, 2025
7bd38c0
make popover for interactive task work
ilicfilip Jun 10, 2025
5d42226
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
ilicfilip Jun 10, 2025
621f67b
more tweaks
aristath Jun 10, 2025
7b2799c
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
aristath Jun 10, 2025
1b0e834
define url_target
ilicfilip Jun 10, 2025
8233b83
remove get_task_details from Debug tool
ilicfilip Jun 10, 2025
ee87e59
unify get_task_id
ilicfilip Jun 10, 2025
2405b4a
WIP migrate tasks
ilicfilip Jun 10, 2025
5237550
No need for a var
aristath Jun 11, 2025
9e76343
Add missing line
aristath Jun 11, 2025
e33f56d
Add `get_title_with_data` method
aristath Jun 11, 2025
f4e79cc
one get_task_details
ilicfilip Jun 11, 2025
a6ea5e3
more WIP migrations & get_url_with_data / get_description_with_data
ilicfilip Jun 11, 2025
852ef02
Use integers for the priorities
aristath Jun 11, 2025
2209a7d
Merge remote-tracking branch 'origin/filip/cpt-2-test' into filip/cpt…
aristath Jun 11, 2025
5b0f724
'post_status' not 'status'
ilicfilip Jun 11, 2025
9d28480
check for "forever" snoozed tasks
ilicfilip Jun 11, 2025
c3c457c
Add a loader when creating a new TODO item
aristath Jun 11, 2025
5b46612
Inline docs for CSS loader
aristath Jun 11, 2025
35026f3
Merge branch 'ari/tasks-cpt-2' into filip/cpt-2-test
aristath Jun 11, 2025
7ddf622
migrate user tasks.. almost
ilicfilip Jun 11, 2025
f003d50
Merge remote-tracking branch 'origin/filip/cpt-2-test' into filip/cpt…
ilicfilip Jun 11, 2025
24921f7
dont clean user tasks
ilicfilip Jun 11, 2025
fe7d353
set dismissable & snoozable
ilicfilip Jun 11, 2025
a1718b5
->get_provider_id()
ilicfilip Jun 11, 2025
0cd3d34
terms can be hardcoded here
aristath Jun 11, 2025
6552073
Merge pull request #507 from ProgressPlanner/filip/cpt-2-test
aristath Jun 11, 2025
38ca693
clean up only repetitive tasks
ilicfilip Jun 11, 2025
d5323a5
adjust tests to new code logic
ilicfilip Jun 11, 2025
592d5be
create task & collaborator task provider
ilicfilip Jun 11, 2025
8b0e016
fix tasks rest api response
ilicfilip Jun 11, 2025
0254aaa
whitespace cleanup
aristath Jun 12, 2025
525012b
Add a view for the email-sending popover
aristath Jun 12, 2025
8389ae2
Recommended PHP version update
aristath Jun 12, 2025
1683ed2
all post types in the rest endpoint
ilicfilip Jun 12, 2025
301abd0
visual inspection of PHP files
aristath Jun 12, 2025
8ba5360
Merge remote-tracking branch 'origin/ari/tasks-cpt-2' into ari/tasks-…
aristath Jun 12, 2025
d714aae
update post status for tests
ilicfilip Jun 12, 2025
6b588da
trash, not publish
ilicfilip Jun 12, 2025
19fd532
Add `is_debug_mode_enabled` method
aristath Jun 12, 2025
936da71
disable checkbox for completed tasks (to prevent multiple requests)
ilicfilip Jun 12, 2025
e285613
minor JS tweaks
aristath Jun 12, 2025
40b0e30
missed migrating this one
aristath Jun 12, 2025
c4e03a7
Prtially revert e2856138fbb1b81d984286c23f37a2a6fb56c922
aristath Jun 12, 2025
4e68fbb
try waitFor( { state: 'detached' } );
ilicfilip Jun 12, 2025
d38cb87
const firstItem = page.locator(SELECTORS.TODO_ITEM ).nth(0);
ilicfilip Jun 12, 2025
615aa30
<label>…</label> intercepts pointer events
ilicfilip Jun 12, 2025
0dbbbbe
meh
ilicfilip Jun 12, 2025
27e97d2
update dismissible test, to new DOM & flow
ilicfilip Jun 12, 2025
d43e547
abstract cleanup routine
ilicfilip Jun 13, 2025
d742236
indents
ilicfilip Jun 13, 2025
c9feae7
update cleanup routine
ilicfilip Jun 13, 2025
b026351
close context
ilicfilip Jun 13, 2025
da3dacb
add wait for detached state
ilicfilip Jun 13, 2025
44a87c7
remove handler
ilicfilip Jun 13, 2025
364296e
get console ouput
ilicfilip Jun 13, 2025
566673e
debug failed requests
ilicfilip Jun 13, 2025
4caaea4
handle plain URL format
ilicfilip Jun 13, 2025
7bde47e
remove debug code
ilicfilip Jun 13, 2025
a31ce8e
live update ravi gauge on the WP dashboard page as well
ilicfilip Jun 13, 2025
39a7921
Minor JS tweaks
aristath Jun 16, 2025
415d0e4
Merge pull request #456 from ProgressPlanner/ari/tasks-cpt-2
aristath Jun 16, 2025
9c24bd8
try to fix playground
ilicfilip Jun 16, 2025
94cad5c
set status, then save
ilicfilip Jun 16, 2025
ba68848
Destroy the post, without the force parameter.
ilicfilip Jun 16, 2025
2416b76
Merge pull request #509 from ProgressPlanner/filip/v16/tweak-celebration
aristath Jun 16, 2025
a21d327
Merge branch 'develop' into filip/wp-cli
ilicfilip Jun 16, 2025
bd7d048
update rest endpoint
ilicfilip Jun 16, 2025
255115d
Merge pull request #510 from ProgressPlanner/filip/v16/update-rest-en…
aristath Jun 16, 2025
549cc84
add "is_completed" callback
ilicfilip Jun 16, 2025
512388d
prevent celebration on WP dashboard screen
ilicfilip Jun 17, 2025
8cb25fe
Merge branch 'develop' into filip/wp-cli
aristath Jun 17, 2025
594cef0
Remove extra line used to push the merge
aristath Jun 17, 2025
1a6ec1f
use our constant & remove unused enqueue
ilicfilip Jun 17, 2025
2dfb189
Allow excess points to complete previous monthly badge
aristath Jun 17, 2025
4c58d37
bugfix
aristath Jun 17, 2025
671fc2d
fix target_post_id for content-review
ilicfilip Jun 17, 2025
ee13b54
Change the way previous badge progress is shown
aristath Jun 17, 2025
3d497c5
extra check
aristath Jun 17, 2025
9b4cd3f
Tweak for playground testing
aristath Jun 17, 2025
ac328d8
lock while task is being added
ilicfilip Jun 17, 2025
0290451
Merge pull request #515 from ProgressPlanner/filip/v16/lock-adding-tasks
aristath Jun 18, 2025
8eb6be0
Merge pull request #514 from ProgressPlanner/filip/v16/fix-target-pos…
aristath Jun 18, 2025
bf23df6
Merge pull request #512 from ProgressPlanner/filip/v16/more-celebrati…
aristath Jun 18, 2025
b8d31a3
Merge branch 'develop' into ari/excess-points-complete-previous-month…
aristath Jun 18, 2025
8b3a522
Merge branch 'develop' into filip/wp-cli
aristath Jun 18, 2025
952fc5a
bugfix
aristath Jun 18, 2025
e78849f
Don't go too far
aristath Jun 18, 2025
fd83f2e
typo
aristath Jun 18, 2025
44f0226
math bug
aristath Jun 18, 2025
6222f74
Use points & max-points instead of progress
aristath Jun 18, 2025
6f2127c
live-update previous-month badge points
aristath Jun 18, 2025
813ccb7
Fix script dependency
aristath Jun 18, 2025
7c80735
Remove element after completion
aristath Jun 18, 2025
f84d002
preload tasks
ilicfilip Jun 18, 2025
c681760
Merge pull request #516 from ProgressPlanner/filip/v16/preload-tasks
ilicfilip Jun 18, 2025
526c899
move remove loading code
ilicfilip Jun 18, 2025
5f29d4c
Merge remote-tracking branch 'origin/filip/v16/preload-tasks' into de…
aristath Jun 18, 2025
7989f52
dont limit number of celebration tasks
ilicfilip Jun 18, 2025
75d435a
Merge remote-tracking branch 'origin/filip/v16/no-limit-for-celebrati…
aristath Jun 18, 2025
726e133
Add stats for active plugins
aristath Jun 19, 2025
2cefa94
Merge branch 'develop' into ari/excess-points-complete-previous-month…
aristath Jun 19, 2025
90191d5
CS
aristath Jun 19, 2025
46307fb
Merge branch 'develop' into ari/excess-points-complete-previous-month…
aristath Jun 19, 2025
c80fe41
Allow going back 2 months
aristath Jun 19, 2025
c17bd27
CS
aristath Jun 19, 2025
9fa9157
Fix points math
aristath Jun 19, 2025
58ed050
bugfix
aristath Jun 19, 2025
851739d
CS
aristath Jun 19, 2025
6c71a3b
Do not remove the element
aristath Jun 19, 2025
5841acd
We were missing the parent call here
aristath Jun 19, 2025
df34033
Expose widget-IDs to JS
aristath Jun 19, 2025
f78da6f
Revert "Expose widget-IDs to JS"
aristath Jun 19, 2025
8c07c7c
Merge branch 'develop' into filip/wp-cli
ilicfilip Jun 19, 2025
3f03373
Refactor
aristath Jun 20, 2025
eb31d2a
Yet another UX improvement
aristath Jun 20, 2025
bf48f2c
Changelog
aristath Jun 20, 2025
0dd3003
Merge branch 'develop' into ari/excess-points-complete-previous-month…
aristath Jun 20, 2025
df067b8
Changelog
aristath Jun 20, 2025
384b7c5
Merge branch 'develop' into filip/wp-cli
aristath Jun 20, 2025
e13c00d
Move `prplUpdatePreviousMonthBadgeProgressBar` to its web-component file
aristath Jun 20, 2025
dff55d1
fix dashboard widget
ilicfilip Jun 20, 2025
3bc4f87
Merge pull request #513 from ProgressPlanner/ari/excess-points-comple…
aristath Jun 20, 2025
2098100
Merge branch 'develop' into filip/wp-cli
ilicfilip Jun 20, 2025
1c84ddf
user var instead of API call to check if user term exists
ilicfilip Jun 20, 2025
7d31eb1
Require at least WP 6.6
aristath Jun 23, 2025
f53f9ad
Merge branch 'develop' into filip/wp-cli
aristath Jun 23, 2025
b221940
minor tweaks
aristath Jun 23, 2025
e7e2dea
Add a Deprecations class
aristath Jun 23, 2025
c237e26
CS
aristath Jun 23, 2025
d1f7fb0
task_id and title are required.
ilicfilip Jun 23, 2025
fe9a06a
update comment
ilicfilip Jun 23, 2025
97f8508
Show better view of remaining points and days
aristath Jun 23, 2025
53a5aa9
Fix for autoloader
aristath Jun 23, 2025
a74f311
Merge branch 'develop' into filip/wp-cli
aristath Jun 23, 2025
ef1103f
Minor coding tweaks
aristath Jun 23, 2025
71aa8ef
Merge pull request #494 from ProgressPlanner/filip/wp-cli
ilicfilip Jun 23, 2025
c5c1d97
prevent multiple checkbox clicks for todos
ilicfilip Jun 23, 2025
e564fca
Merge pull request #521 from ProgressPlanner/filip/v16/prevent-multip…
aristath Jun 23, 2025
f38b3db
Merge branch 'develop' into filip/v16/optimize-task-loading
ilicfilip Jun 23, 2025
91189f1
dont inject pending celebration on WP dashboard page
ilicfilip Jun 23, 2025
b59ea2c
Add a separator
aristath Jun 23, 2025
c260db3
Merge pull request #522 from ProgressPlanner/filip/v16/dont-celebrate…
aristath Jun 23, 2025
08ea892
Merge branch 'develop' into filip/v16/optimize-task-loading
ilicfilip Jun 23, 2025
3d958aa
Merge pull request #518 from ProgressPlanner/filip/v16/optimize-task-…
ilicfilip Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
= 1.6.0 =

Enhancements:

* Allow users to collect extra points for previous months' badges.

Under the hood:

* Ravi's Recommendations are now a custom post type.

= 1.5.0 =

Added these recommendations from Ravi:
Expand Down
33 changes: 30 additions & 3 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@
}
}
}


}

.prpl-hidden {
Expand Down Expand Up @@ -281,7 +279,6 @@ button.prpl-info-icon {
}
}


/*------------------------------------*\
Buttons
\*------------------------------------*/
Expand Down Expand Up @@ -481,3 +478,33 @@ button.prpl-info-icon {
grid-template-columns: repeat(2, 1fr);
gap: var(--prpl-padding);
}

/*------------------------------------*\
Loader.
See https://cssloaders.github.io/ for more.
\*------------------------------------*/
.prpl-loader {
width: 48px;
height: 48px;
border: 5px solid #fff;
border-bottom-color: transparent;
border-radius: 50%;
display: inline-block;
box-sizing: border-box;
animation: rotation 1s linear infinite;
z-index: 20;
position: absolute;
top: calc(50% - 24px);
left: calc(50% - 24px);
}

@keyframes rotation {

0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}
2 changes: 1 addition & 1 deletion assets/css/dashboard-widgets/score.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Admin widget.
*
* Dependencies: progress-planner/web-components/prpl-suggested-task, progress-planner/web-components/prpl-badge
* Dependencies: progress-planner/suggested-task, progress-planner/web-components/prpl-badge
*/
#progress_planner_dashboard_widget_score {

Expand Down
31 changes: 17 additions & 14 deletions assets/css/page-widgets/suggested-tasks.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Suggested tasks widget.
*
* Dependencies: progress-planner/web-components/prpl-suggested-task, progress-planner/web-components/prpl-badge
* Dependencies: progress-planner/suggested-task, progress-planner/web-components/prpl-badge
*/

.prpl-widget-wrapper.prpl-suggested-tasks {
Expand Down Expand Up @@ -96,16 +96,19 @@

.prpl-dashboard-widget-suggested-tasks {

&:not(:has(.prpl-suggested-tasks-loading)):not(:has(.prpl-suggested-tasks-list li)) {

.prpl-no-suggested-tasks {
display: block;
}
}

&:has(.prpl-suggested-tasks-list li) {

.prpl-widget-title {
display: flex;
}

.prpl-no-suggested-tasks {
display: none;
}

hr {
display: block;
}
Expand All @@ -116,11 +119,16 @@
display: none;
}

.prpl-no-suggested-tasks {
display: block;
.prpl-no-suggested-tasks,
.prpl-suggested-tasks-loading {
display: none;
background-color: var(--prpl-background-green);
padding: calc(var(--prpl-padding) / 2);
}

.prpl-suggested-tasks-loading {
display: block;
}
}

.prpl-suggested-tasks-list {
Expand All @@ -132,11 +140,8 @@
border-bottom: none;
}

prpl-suggested-task:nth-child(odd) {

.prpl-suggested-task {
background-color: #f9fafb;
}
.prpl-suggested-task:nth-child(odd) {
background-color: #f9fafb;
}

/* If task has disabled checkbox it's title should be italic. */
Expand Down Expand Up @@ -223,7 +228,6 @@
flex-direction: column;
justify-content: space-between;


.progress-label {
display: inline-block;
}
Expand Down Expand Up @@ -544,7 +548,6 @@
}
}


/* Checkmark */
.prpl-custom-control::after {
content: "";
Expand Down
22 changes: 20 additions & 2 deletions assets/css/page-widgets/todo.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* TODOs widget.
*
* Dependencies: progress-planner/web-components/prpl-suggested-task
* Dependencies: progress-planner/suggested-task
*/

.prpl-widget-wrapper.prpl-todo {
Expand Down Expand Up @@ -145,7 +145,6 @@
}
}


#create-todo-item {
padding: 0 16px;
}
Expand Down Expand Up @@ -192,3 +191,22 @@
display: none;
}
}

#todo-list {

&:has(.prpl-loader) {
position: relative;

&::before {
content: "";
display: block;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
}
}
1 change: 0 additions & 1 deletion assets/css/page-widgets/whats-new.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
}
}


img {
width: 100%;
}
Expand Down
5 changes: 0 additions & 5 deletions assets/css/settings-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
padding: var(--prpl-settings-page-gap) var(--prpl-settings-page-gap) 2rem var(--prpl-settings-page-gap);
}
}


}

.prpl-settings-section-title {
Expand Down Expand Up @@ -108,7 +106,6 @@
}
}


.item-actions,
.prpl-select-page {
display: flex;
Expand Down Expand Up @@ -251,7 +248,6 @@

}


/* License */
.prpl-column-license {

Expand Down Expand Up @@ -298,7 +294,6 @@

}


/* Grid layout for wrapper for:
- Valuable post types
- Default login destination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@
}

}


}

&[data-task-action="celebrate"] {
Expand Down
1 change: 0 additions & 1 deletion assets/css/upgrade-tasks.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
}
}


.prpl-onboarding-task-status {
display: block;
width: 1.5rem;
Expand Down
82 changes: 14 additions & 68 deletions assets/js/celebrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* A script that triggers confetti on the container element.
*
* Dependencies: particles-confetti
* Dependencies: particles-confetti, progress-planner/suggested-task
*/
/* eslint-disable camelcase */

Expand All @@ -13,7 +13,7 @@ document.addEventListener( 'prpl/celebrateTasks', ( event ) => {
/**
* Trigger the confetti on the container element.
*/
const containerElement = event.detail?.element
const containerEl = event.detail?.element
? event.detail.element.closest( '.prpl-suggested-tasks-list' )
: document.querySelector(
'.prpl-widget-wrapper.prpl-suggested-tasks .prpl-suggested-tasks-list'
Expand All @@ -30,14 +30,14 @@ document.addEventListener( 'prpl/celebrateTasks', ( event ) => {

const prplRenderAttemptshoot = () => {
// Get the tasks list position
const origin = containerElement
const origin = containerEl
? {
x:
( containerElement.getBoundingClientRect().left +
containerElement.offsetWidth / 2 ) /
( containerEl.getBoundingClientRect().left +
containerEl.offsetWidth / 2 ) /
window.innerWidth,
y:
( containerElement.getBoundingClientRect().top + 50 ) /
( containerEl.getBoundingClientRect().top + 50 ) /
window.innerHeight,
}
: { x: 0.5, y: 0.3 }; // fallback if list not found
Expand Down Expand Up @@ -83,75 +83,23 @@ document.addEventListener( 'prpl/celebrateTasks', ( event ) => {
setTimeout( prplRenderAttemptshoot, 0 );
setTimeout( prplRenderAttemptshoot, 100 );
setTimeout( prplRenderAttemptshoot, 200 );

/**
* Strike completed tasks.
*/
document.dispatchEvent( new CustomEvent( 'prpl/strikeCelebratedTasks' ) );

// Remove celebrated tasks and add them to the completed tasks.
setTimeout( () => {
document.dispatchEvent(
new CustomEvent( 'prpl/markTasksAsCompleted' )
);
}, 2000 );
} );

/**
* Mark tasks as completed.
*/
document.addEventListener( 'prpl/markTasksAsCompleted', ( event ) => {
const taskList = event.detail?.taskList || 'prplSuggestedTasks';
document
.querySelectorAll( '.prpl-suggested-task-celebrated' )
.forEach( ( item ) => {
const task_id = item.getAttribute( 'data-task-id' );
const providerID = item.getAttribute( 'data-task-provider-id' );
const category = item.getAttribute( 'data-task-category' );
const el = document.querySelector(
`.prpl-suggested-task[data-task-id="${ task_id }"]`
);

if ( el ) {
el.parentElement.remove();
}

// Get the task index.
let taskIndex = false;
window[ taskList ].tasks.forEach( ( taskItem, index ) => {
if ( taskItem.task_id === task_id ) {
taskIndex = index;
}
} );

// Mark the task as completed.
if ( false !== taskIndex ) {
window[ taskList ].tasks[ taskIndex ].status = 'completed';
}

// Refresh the list.
document.dispatchEvent(
new CustomEvent( 'prpl/suggestedTask/maybeInjectItem', {
detail: {
task_id,
providerID,
category,
},
} )
);
} );
} );

/**
* Strike completed tasks.
* Remove tasks from the DOM.
* The task will be striked through, before removed, if it has points.
*/
document.addEventListener( 'prpl/strikeCelebratedTasks', () => {
document.addEventListener( 'prpl/removeCelebratedTasks', () => {
document
.querySelectorAll(
'.prpl-suggested-task[data-task-action="celebrate"]'
)
.forEach( ( item ) => {
// Triggers the strikethrough animation.
item.classList.add( 'prpl-suggested-task-celebrated' );

// Remove the item from the DOM.
setTimeout( () => item.remove(), 2000 );
} );
} );

Expand All @@ -163,9 +111,7 @@ document.addEventListener( 'prpl/celebrateTasks', () => {
'#adminmenu #toplevel_page_progress-planner .update-plugins'
);
if ( points ) {
points.forEach( ( point ) => {
point.remove();
} );
points.forEach( ( point ) => point.remove() );
}
} );

Expand Down
4 changes: 2 additions & 2 deletions assets/js/external-link-accessibility-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ prplDocumentReady( () => {
} );

// Recheck the accessibility of the page when a new task is injected.
document.addEventListener( 'prpl/suggestedTask/injectItem', () => {
document.addEventListener( 'prpl/suggestedTask/itemInjected', () => {
// Wait for the new task to be added to the DOM.
setTimeout( () => {
externalLinkHelper.applyAccessibility();
}, 500 );
}, 10 );
} );
Loading
Loading