Skip to content
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

Buttons #251

Merged
merged 7 commits into from
Apr 28, 2024
Merged

Buttons #251

merged 7 commits into from
Apr 28, 2024

Conversation

Zaras00
Copy link
Contributor

@Zaras00 Zaras00 commented Apr 28, 2024

Summary by CodeRabbit

  • New Features

    • Introduced the ability to cancel customer complaints directly from the complaints interface.
    • Enhanced 404 error page with custom visuals and styling.
    • Updated the customer complaints view with a new modal for easier complaint cancellation.
    • Simplified the process for customers to cancel complaints with status 'pending'.
  • Bug Fixes

    • Corrected the display of equipment lists and pricing details in various customer views for consistency and clarity.
  • Style

    • Improved button styling across the application, including "Book Now" and "Add Complaint" buttons, to feature a green text color and border.
    • Adjusted padding and border properties for various buttons for a cleaner look.
  • Documentation

    • Updated the layout and functionality descriptions in view files to reflect changes in the user interface.
  • Refactor

    • Restructured HTML elements in customer views for better layout management and user experience.

Copy link
Contributor

coderabbitai bot commented Apr 28, 2024

Walkthrough

The recent updates involve enhancements and modifications across various PHP controllers, models, and views, focusing on complaint management, error handling, and UI improvements. Changes also include CSS adjustments for better styling and layout consistency. The overall aim is to streamline user interactions and improve the visual appeal of the application.

Changes

File Path Change Summary
.../API/Complaints.php Added cancelCustomerComplaint function.
.../controllers/Complaints.php Commented out show function calls in rentComplaints and rentComplaint.
.../_404.php Updated to use view method for 404 errors.
.../RentComplaint.php Updated table name and added new methods for complaint handling.
.../404.view.php Enhanced 404 error page display.
.../customer/... (multiple) Updated complaint handling UI and AJAX functionalities.
.../customer/components/... Various UI adjustments in customer components.
.../home.view.php Commented out sections related to blog and tips.
.../sections/... Updated button styles in various sections.
.../scss/wl/dashboard/... CSS updates for buttons, customer views, and error displays.

🐇✨
In the land of code, where the bits align,
A rabbit hopped, with changes divine.
Buttons green, and errors neat,
With every jump, bugs retreat.
Hop, hop, hooray! The code does play! 🎉
🐇✨

`

app/views/customer/components/customercomplaintlist.view.php: ## Short Summary:
The change in functionality involves simplifying the conditional rendering of buttons based on the status of a complaint in a customer complaint list view. The code now directly shows the "Cancel" button if the complaint status is 'pending'.

Alterations to the declarations of exported or public entities:

  • Removed a block of conditional rendering for buttons based on complaint status.
  • Added a new conditional block to show the "Cancel" button if the complaint status is 'pending'.

app/views/customer/components/customercomplaints.view.php: ## Short Summary
The change in functionality involves moving the "Equipment List" heading inside a <div> with the class "row" in the customer complaints view. This change likely affects the layout or styling of the equipment list section.

Alterations to the Declarations of Exported or Public Entities

  • No alterations to the declarations of exported or public entities.

app/views/customer/components/item.view.php: ## Short Summary
The changes in the item.view.php file involve updating the HTML elements' classes and tags for styling and structure adjustments. Specifically, there are modifications to the heading levels (h3 to h4, h1 to h3), addition of a div element around a price display, and adjustments to the count input section.

Alterations to the declarations of exported or public entities

  • <h3 class="rental-name"> <?php echo htmlspecialchars($equipment->rentalservice_name); ?> </h3> => <h4 class="rental-name"> <?php echo htmlspecialchars($equipment->rentalservice_name); ?> </h4>
  • <div class="row flex-d mt-5"> => <div class="row flex-d mt-5 px-6 mb-6">
  • <div class="col-lg-6"> => <div class="col-lg-6 p-3 rounded-9">
  • <h1 class="rental-name"> <?php echo htmlspecialchars($equipment->name); ?> </h1> => <h3 class="rental-name"> <?php echo htmlspecialchars($equipment->name); ?> </h3>
  • <h3 id="item-fee" data-fee="<?php echo htmlspecialchars($equipment->total); ?>">Rs. <?php echo htmlspecialchars($equipment->total); ?></h3> => <div class="row"><h5 id="item-fee" class="rent-item-view-price py-3" data-fee="<?php echo htmlspecialchars($equipment->total); ?>">Rs. <?php echo htmlspecialchars($equipment->total); ?></h5></div>

app/views/customer/orders.view.php: ## Short Summary
The changes in the app/views/customer/orders.view.php file involve restructuring the HTML elements within the page layout. Specifically, adjustments were made to the positioning and styling of various elements like buttons and containers. Additionally, comments were added and modified within the code.

Alterations to the declarations of exported or public entities

  • No alterations to the declarations of exported or public entities were identified in the provided diff.

app/views/customer/rent.view.php: ## Short Summary
In the rent.view.php file, the changes involve adding margin and padding classes (mb-3 and ml-2) to certain elements within the location container, affecting the layout of the form elements.

Alterations to the declarations of exported or public entities

  • <div class="location-form-element"> => <div class="location-form-element mb-3 ml-2">
  • <div class="location-button-container"> => <div class="location-button-container mb-3 ml-2">

app/views/home.view.php: ## Short Summary
The changes in app/views/home.view.php involve commenting out the inclusion of sections related to blog and tips, effectively disabling their display on the page.

Alterations to the declarations of exported or public entities

  • No alterations to the declarations of exported or public entities.

app/views/sections/complaints.php: ## Short Summary
The change in functionality involves updating the styling of the "Add Complain" button in the complaints.php file. The button now has a green text color and a border.

Alterations to the declarations of exported or public entities

  • None

app/views/sections/guide.php: ## Short Summary
In the guide.php file under app/views/sections, the changes involve updating the CSS classes for the "Book Now" button to include additional styling classes.

Alterations to the declarations of exported or public entities

  • class="btn" => class="btn-text-green border"

app/views/sections/hero.php: ## Short Summary
In the hero.php file, the changes involve updating the CSS classes for the "Get Started" button to include additional styling classes, specifically btn-text-green and border.

Alterations to the declarations of exported or public entities

  • class="btn" => class="btn-text-green border"
  • href="<?= ROOT_DIR ?>/login" => href="<?= ROOT_DIR ?>/login"

app/views/sections/rental-service.php: ## Short Summary
The change in functionality involves updating the CSS classes for the "Book Now" button in a PHP file, switching from a generic button style to a specific green text with a border style.

Alterations to the declarations of exported or public entities

  • class="btn" => class="btn-text-green border"

public/assets/scss/wl/dashboard/_button.scss: ## Short Summary
The changes in _button.scss involve adjusting padding values and border properties for different button styles, along with minor modifications to box-shadow settings. The padding is updated from 10px to 8px 16px, and the border thickness is reduced from 2px to 1px for various button styles. Additionally, the box-shadow values are refined for hover effects.

Alterations to the declarations of exported or public entities

  • padding: 8px 16px;
  • border: 1px solid $color-primary;
  • border: 1px solid $blue;
  • border: 1px solid $orange;
  • border: 1px solid $red;
  • box-shadow: 0px 1px 10px 1px rgba(105, 105, 105, 0.5);

public/assets/scss/wl/dashboard/_customer.scss: ## Short Summary
Added styling for the .rent-item-view-price class in the _customer.scss file to set font size, weight, and color.

Alterations to the declarations of exported or public entities

  • Added styling for the .rent-item-view-price class:
    • font-size: 2rem;
    • font-weight: 600;
    • color: $gray-text;

public/assets/scss/wl/dashboard/_home.scss: ## Short Summary
Added styling for an error container in the _home.scss file, including properties for display, flex layout, and image styling.

Alterations to the declarations of exported or public entities

  • No changes to declarations of exported or public entities.

public/assets/scss/wl/dashboard/common/_margin.scss: ### Summary

In the file public/assets/scss/wl/dashboard/common/_margin.scss, the change involves correcting the formatting by adding a missing newline after the closing curly brace of the .ml-8 class.


-->
<!-- end of auto-generated comment: raw summary by coderabbit.ai --><!-- This is an auto-generated comment: short summary by coderabbit.ai -->
<!--


### PR Objectives

The pull request titled "Buttons" with the number 251 encompasses a series of updates across various components of a web application. The primary focus of these updates appears to be on enhancing user interface elements, particularly buttons, and improving the functionality related to handling complaints in the customer service module. The changes span across controller functions, model updates, view modifications, and styling adjustments in SCSS files. Although the PR title is succinct, the extensive list of files and the nature of changes suggest a comprehensive effort to refine user interactions and backend processes related to complaint management and display elements within the application.

### AI-generated Summary of Generated Summaries

This pull request introduces a wide range of updates across the application, focusing primarily on enhancing user interface components, particularly buttons, and refining the complaint management system.

**Controller Updates:**
1. **Complaints Handling:**
   - A new function `cancelCustomerComplaint` has been added to the API's `Complaints` controller to handle the cancellation of customer complaints more effectively.
   - The `Complaints.php` controller has seen the deactivation of the `show` function in the `rentComplaints` and `rentComplaint` methods to possibly streamline operations or reduce output verbosity.

2. **Error Handling:**
   - The `_404.php` controller now uses a `view` method for rendering the 404 error page instead of directly echoing an error message, aligning error handling with standard MVC practices.

**Model Enhancements:**
- The `RentComplaintModel` has been updated with a new table name and additional columns to better manage complaint data. New methods such as `getComplaintsByCustomer`, `getRentComplaint`, and `cancelComplaint` have been introduced to enhance data retrieval and manipulation capabilities concerning rent complaints.

**View Layer Modifications:**
1. **Error and Complaint Views:**
   - The `404.view.php` now features a custom error page design, enhancing the user experience during error occurrences.
   - Various customer complaint views have been updated to improve the layout, add new modal functionalities for complaint cancellation, and refine AJAX requests for a smoother user experience.

2. **Button Styling:**
   - Several sections including `guide.php`, `hero.php`, and `rental-service.php` have updated button styles to include a green text color and border, likely to maintain a consistent and appealing visual theme across the application.

3. **SCSS Styling Adjustments:**
   - The `_button.scss` file has seen adjustments in padding, border properties, and box-shadow settings to refine the appearance and interaction of buttons.
   - New styles have been added for the `.rent-item-view-price` class in `_customer.scss`, setting specific font properties for better visibility and aesthetics.

**General Layout and Styling Enhancements:**
- Numerous views have undergone adjustments in HTML class attributes to improve layout and styling, ensuring a more coherent and user-friendly interface. These changes include modifications to element classes, restructuring of HTML elements, and enhancements to the visual presentation of various components like cart items, order details, and rental services.

### Alterations to the Declarations of Exported or Public Entities

**app/controllers/API/Complaints.php:**
- Added: `public function cancelCustomerComplaint(string $a = '', string $b = '', string $c = ''): void`

**app/controllers/Complaints.php:**
- Modified: `public function rentComplaints(string $a = '', string $b = '', string $c = ''): void`
  - Before: `show ($data['complaints']);`
  - After: `// show ($data['complaints']);`
- Modified: `public function rentComplaint(string $a = '', string $b = '', string $c = ''): void`
  - Before: `show($data);`
  - After: `// show($data);`

**app/controllers/_404.php:**
- Modified: `public function index()`
  - Before: `echo "Controller not found";`
  - After: `$this->view('404');`

**app/models/RentComplaint.php:**
- Modified: `protected string $table`
  - Before: `'rent_return_complaints'`
  - After: `'rent_complaint'`
- Added: `'complaint_no', 'created_at'` to `$allowedColumns`
- Added: `public function getComplaintsByCustomer(array $data)`
- Added: `public function getRentComplaint($id)`
- Added: `public function cancelComplaint($id)`

**app/views/customer/components/cart.view.php:**
- Modified: `<h3>` element => `<h6 class="rent-item-view-price">` element
- Modified: `<h4>` element => `<h4 class="rent-item-view-price py-1">` element

**app/views/customer/components/complaint.view.php:**
- Modified: `<h3>Equipment List</h3>` => `<div class="row"><h3>Equipment List</h3></div>`

**app/views/customer/components/complaintlist.view.php:**
- Modified: `<div id="cancel-complaint-modal" class="modal">` => `<!-- <div id="cancel-complaint-modal" class="modal">`
- Modified: `</div>` => `</div> -->`

**app/views/customer/components/item.view.php:**
- Modified: `<h3 class="rental-name">` => `<h4 class="rental-name">`
- Modified: `<h1 class="rental-name">` => `<h3 class="rental-name">`
- Modified: `<h3 id="item-fee" data-fee="...">` => `<div class="row"><h5 id="item-fee" class="rent-item-view-price py-3" data-fee="...">`

**app/views/customer/rent.view.php:**
- Modified: `<div class="location-form-element">` => `<div class="location-form-element mb-3 ml-2">`
- Modified: `<div class="location-button-container">` => `<div class="location-button-container mb-3 ml-2">`

**public/assets/scss/wl/dashboard/_button.scss:**
- Modified: `padding: 10px;` => `padding: 8px 16px;`
- Modified: `border: 2px solid $color-primary;` => `border: 1px solid $color-primary;`
- Modified: `box-shadow: 0px 2px 5px 2px rgba(0, 0, 0, 0.2);` => `box-shadow: 0px 1px 10px 1px rgba(105, 105, 105, 0.5);`

**public/assets/scss/wl/dashboard/_customer.scss:**
- Added: Styling for `.rent-item-view-price` class:
  - `font-size: 2rem;`
  - `font-weight: 600;`
  - `color: $gray-text;`

-->
<!-- end of auto-generated comment: short summary by coderabbit.ai -->

---

<details>

<summary>Recent Review Details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**

<details>
<summary>Commits</summary>
Files that changed from the base of the PR and between 5255221827df9151d1e42ff695ccbb7bf033b84a and cbf24cc9c3c054ba204397d76c412721cb4be929.
</details>


<details>
<summary>Files selected for processing (3)</summary>

* app/models/RentComplaint.php (2 hunks)
* app/views/customer/rent.view.php (1 hunks)
* public/assets/scss/wl/dashboard/_button.scss (6 hunks)

</details>





<details>
<summary>Files skipped from review as they are similar to previous changes (3)</summary>

* app/models/RentComplaint.php
* app/views/customer/rent.view.php
* public/assets/scss/wl/dashboard/_button.scss

</details>





</details><!-- commit_ids_reviewed_start -->

<!-- 5255221827df9151d1e42ff695ccbb7bf033b84a -->
<!-- cbf24cc9c3c054ba204397d76c412721cb4be929 -->

<!-- commit_ids_reviewed_end --><!-- tips_start -->

---

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

<details>
<summary>Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
	- `I pushed a fix in commit <commit_id>.`
	- `Generate unit testing code for this file.`
	- `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
	- `@coderabbitai generate unit testing code for this file.`
	-	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
	- `@coderabbitai generate interesting stats about this repository and render them as a table.`
	- `@coderabbitai show all the console.log statements in this repository.`
	- `@coderabbitai read src/utils.ts and generate unit testing code.`
	- `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (invoked as PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai help` to get help.


Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.

### CodeRabbit Configration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Member

@nsavinda nsavinda left a comment

Choose a reason for hiding this comment

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

Approved

@Zaras00 Zaras00 merged commit a6542ca into dev Apr 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants