Skip to content

New design implemented for Announcements page#2279

Merged
shewa12 merged 30 commits intov4-student-dashboardfrom
v4-announcements
Jan 1, 2026
Merged

New design implemented for Announcements page#2279
shewa12 merged 30 commits intov4-student-dashboardfrom
v4-announcements

Conversation

@sazedul-haque
Copy link
Copy Markdown
Collaborator

No description provided.

@sazedul-haque sazedul-haque added the 4.0.0 Tutor v4.w0w label Dec 26, 2025
@sazedul-haque sazedul-haque changed the base branch from 4.0.0-dev to v4-student-dashboard December 26, 2025 06:32
// Setup delete mutation
this.deleteMutation = this.query.useMutation(this.deleteAnnouncement, {
onSuccess: () => {
window.TutorCore.modal.closeModal('tutor-announcement-delete-modal');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define a const for the modal ID.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use these to the php template?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread assets/src/js/frontend/dashboard/pages/announcements.ts Outdated
Comment thread assets/src/js/frontend/dashboard/pages/announcements.ts Outdated
Comment thread assets/src/js/frontend/dashboard/pages/announcements.ts Outdated
Comment thread assets/src/js/frontend/dashboard/pages/announcements.ts Outdated
Comment thread components/InputField.php Outdated
Comment thread assets/core/ts/components/select.ts Outdated
Comment thread assets/core/ts/components/form.ts Outdated
Comment thread assets/core/ts/components/form.ts Outdated
Comment thread assets/core/ts/components/form.ts
Comment thread components/DeleteConfirmationModal.php Outdated
Comment thread components/DeleteConfirmationModal.php Outdated
Comment thread components/DeleteConfirmationModal.php Outdated
Comment thread templates/dashboard/announcements.php Outdated
Comment thread templates/dashboard/announcements.php Outdated
Comment thread templates/dashboard/my-courses.php Outdated
Comment thread components/DeleteConfirmationModal.php Outdated
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.
@shewa12 shewa12 merged commit 32e6588 into v4-student-dashboard Jan 1, 2026
10 of 13 checks passed
@@ -0,0 +1,427 @@
<?php
/**
* Tutor Component: Delete Confirmation Modal
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this comment

defined( 'ABSPATH' ) || exit;

/**
* Delete Confirmation Modal Component Class.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this comment

$this->cancel_text = __( 'Cancel', 'tutor' );
}
if ( empty( $this->confirm_text ) ) {
$this->confirm_text = __( 'Yes, Delete This', 'tutor' );
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' ) ),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' ) ),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this accordingly

@sazedul-haque sazedul-haque deleted the v4-announcements branch January 1, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants