New design implemented for Announcements page#2279
Merged
shewa12 merged 30 commits intov4-student-dashboardfrom Jan 1, 2026
Merged
New design implemented for Announcements page#2279shewa12 merged 30 commits intov4-student-dashboardfrom
shewa12 merged 30 commits intov4-student-dashboardfrom
Conversation
b-l-i-n-d
requested changes
Dec 29, 2025
| // Setup delete mutation | ||
| this.deleteMutation = this.query.useMutation(this.deleteAnnouncement, { | ||
| onSuccess: () => { | ||
| window.TutorCore.modal.closeModal('tutor-announcement-delete-modal'); |
Collaborator
There was a problem hiding this comment.
Define a const for the modal ID.
Collaborator
Author
There was a problem hiding this comment.
Can we use these to the php template?
Collaborator
There was a problem hiding this comment.
We can declare a PHP variable and pass the modal_id to the Alpine component, as this modal ID is used throughout the announcements.php file.
b-l-i-n-d
approved these changes
Dec 30, 2025
harunollyo
requested changes
Dec 30, 2025
shewa12
reviewed
Dec 30, 2025
Renamed DeleteConfirmationModal to ConfirmationModal for broader use beyond deletions. Updated handler method from delete_handler to confirm_handler and removed payload_key for a more flexible confirmation modal. Adjusted usage in announcements and my-courses dashboard templates to reflect these changes.
Introduces support for custom confirm and cancel button HTML in ConfirmationModal.php, allowing greater flexibility in modal actions.
Updated the announcement form handler to use the AnnouncementPayload type directly and removed unnecessary string conversions. In my-courses.php, ensured total count is cast to integer for pagination and adjusted modal handlers for course deletion to pass the courseId payload correctly.
harunollyo
reviewed
Jan 1, 2026
| @@ -0,0 +1,427 @@ | |||
| <?php | |||
| /** | |||
| * Tutor Component: Delete Confirmation Modal | |||
| defined( 'ABSPATH' ) || exit; | ||
|
|
||
| /** | ||
| * Delete Confirmation Modal Component Class. |
| $this->cancel_text = __( 'Cancel', 'tutor' ); | ||
| } | ||
| if ( empty( $this->confirm_text ) ) { | ||
| $this->confirm_text = __( 'Yes, Delete This', 'tutor' ); |
Collaborator
There was a problem hiding this comment.
It's no more delete confirmation component. So please change the default confirm_text to only Yes
| esc_attr( $alpine_json ), | ||
| $style_attr, | ||
| $icon_html, | ||
| esc_html( $this->title ?? __( 'Delete This Item?', 'tutor' ) ), |
Collaborator
There was a problem hiding this comment.
Default should be Are you sure?
| $style_attr, | ||
| $icon_html, | ||
| esc_html( $this->title ?? __( 'Delete This Item?', 'tutor' ) ), | ||
| esc_html( $this->message ?? __( 'Are you sure you want to delete this item permanently? Please confirm your choice.', 'tutor' ) ), |
Collaborator
There was a problem hiding this comment.
Change this accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.