Skip to content

Conversation

@lucas-a-pelegrino
Copy link
Contributor

@lucas-a-pelegrino lucas-a-pelegrino commented Apr 3, 2025

Proposed changes (including videos or screenshots)

This PR fixes an issue where the toggle switch for business hours didn't reflect the current status when BH was disabled, making the user unable to reactivate the BH.

Issue(s)

CTZ-34

Steps to test or reproduce

  • Go to Omnichannel Business Hour list
  • Create or Edit a BH
  • Disable the BH
  • Edit it again to see that it still enabled in UI

Further comments


This pull request addresses a bug in the Rocket.Chat repository by updating the EditBusinessHours.tsx file within the apps/meteor/client/views/omnichannel/businessHours directory. The change involves replacing a logical OR (||) with a nullish coalescing operator (??) for the initialization of the 'active' property. This modification enhances type safety and ensures proper handling of falsy values, allowing the active toggle to accurately reflect the current active status. The changes are being merged from the bugfix/CTZ-34 branch into the develop branch.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Apr 3, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Apr 3, 2025

🦋 Changeset detected

Latest commit: 3f04fb7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35698/

Built to branch gh-pages at 2025-04-16 15:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.00%. Comparing base (dc6cf3e) to head (3f04fb7).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35698      +/-   ##
===========================================
+ Coverage    60.98%   61.00%   +0.01%     
===========================================
  Files         2956     2956              
  Lines        70539    70539              
  Branches     16174    16174              
===========================================
+ Hits         43017    43029      +12     
+ Misses       24571    24561      -10     
+ Partials      2951     2949       -2     
Flag Coverage Δ
e2e 57.73% <100.00%> (+0.03%) ⬆️
unit 75.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucas-a-pelegrino lucas-a-pelegrino added this to the 7.6.0 milestone Apr 3, 2025
@lucas-a-pelegrino lucas-a-pelegrino marked this pull request as ready for review April 7, 2025 22:36
@lucas-a-pelegrino lucas-a-pelegrino requested a review from a team as a code owner April 7, 2025 22:36
Copy link
Contributor

@aleksandernsilva aleksandernsilva left a comment

Choose a reason for hiding this comment

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

Tested and toggle is working as expected after the fix. Also tests are covering the expected behavior and failing without the fix.

Just take a look at the following:

  • Test clean up
  • Add a changeset to this PR
  • If possible reference the PR that introduced this issue, it will help us during root cause analysis.

@renatobecker renatobecker added the stat: QA assured Means it has been tested and approved by a company insider label Apr 10, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 10, 2025
@kody-ai
Copy link

kody-ai bot commented Apr 15, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

Co-authored-by: Aleksander Nicacio da Silva <aleksander.silva@rocket.chat>
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Apr 15, 2025
@scuciatto scuciatto added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Apr 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 16, 2025
@ggazzo ggazzo merged commit f72fa30 into develop Apr 17, 2025
43 of 48 checks passed
@ggazzo ggazzo deleted the bugfix/CTZ-34 branch April 17, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants