Skip to content

Conversation

@b-l-i-n-d
Copy link
Collaborator

@b-l-i-n-d b-l-i-n-d commented Dec 30, 2025

In this PR:

  • Make a dynamic review component with API integrations.
  • ✨ New StarRatingInput, StartRating components
  • InputField component bugfix
  • Button component icon-only variant

@b-l-i-n-d b-l-i-n-d added the 4.0.0 Tutor v4.w0w label Dec 30, 2025
@b-l-i-n-d b-l-i-n-d marked this pull request as draft December 30, 2025 07:39
@b-l-i-n-d b-l-i-n-d marked this pull request as ready for review January 1, 2026 10:50
Updated StarRating and StarRatingInput components for improved logic and code consistency, including default field name, icon size constant, and safer value checks. Refactored the dashboard reviews template to streamline variable naming, update template loading, and improve pagination logic.
Both StarRating and StarRatingInput now assign the rendered output to a component_string property before returning it. This allows access to the rendered string elsewhere in the component lifecycle if needed.
Introduces an $error property and an error() setter method to the InputField component, allowing error messages to be set and displayed. Updates usage example in the docblock to demonstrate the new error() method.
Replaced anchor tags with the Tutor Button component for the back and close actions in the account header. This improves consistency and leverages the component-based approach for buttons.
Merged the logic for displaying received and given reviews into a single template (reviews.php) and removed the now-redundant given-reviews.php. Updated the reviews page to dynamically handle both instructor and user reviews, streamline pagination, and improve the empty state handling.
Actions and edit form for reviews are now conditionally rendered based on a new 'is_editable' property. Also updated review content sanitization and changed form mode to 'onChange' for edit mode.
Simplified the assignment of the is_editable property for reviews by replacing array_map with a foreach loop. Removed unused received_count variable and improved variable naming for clarity in pagination and review count handling.
Refines the initials() method to generate initials from the user's display name by extracting the first letter of each word, uppercasing them, and limiting the result to two characters. This ensures more accurate and consistent avatar initials.
Added student avatar and display name to review cards for non-editable reviews. Updated SCSS for student info styling and set user_avatar in reviews data.
Introduced a new review card component for displaying individual course reviews and created a reviews page template that utilizes this component. Minor formatting update was also made to the profile pages header component.
Appended a newline character at the end of review-card.php and reviews.php to follow POSIX standards and improve file formatting consistency.
Refactored the initials() method to directly use the sanitized and uppercased input, removing logic that extracted initials from a display name. This change assumes the input is already the desired initials.
@b-l-i-n-d b-l-i-n-d requested a review from harunollyo January 9, 2026 06:14
Changed navigation elements from <a> tags to <button> elements in the profile pages header component for improved accessibility and semantic correctness.
Appends a newline character at the end of profile-pages-header.php to improve file formatting and comply with POSIX standards.
Replaced (int) casts with esc_attr for better output sanitization in StarRatingInput. Refactored reviews pagination to always render and added a class attribute for consistent styling.
@b-l-i-n-d b-l-i-n-d requested a review from harunollyo January 9, 2026 09:45
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