Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

fix: wrong dates on last `x` date on omnichannel reports

Open MartinSchoeler opened this issue 1 year ago • 7 comments

Proposed changes (including videos or screenshots)

Fixes dates being incorrect when fetching omnichannel reports, for example currently asking for last month will return the last 30 days, even if the month just started, this fixes

last week last month last 6 months last year

Issue(s)

SUP-703

MartinSchoeler avatar Dec 04 '24 18:12 MartinSchoeler

🦋 Changeset detected

Latest commit: 1131cc4a0251d3b3ef04861e3ee01f9edb20b48d

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

This PR includes changesets to release 35 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/network-broker Patch
@rocket.chat/models 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

changeset-bot[bot] avatar Dec 04 '24 18:12 changeset-bot[bot]

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 7.3.0, but it targets 7.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

dionisio-bot[bot] avatar Dec 04 '24 18:12 dionisio-bot[bot]

PR Preview Action v1.4.8 :---: :rocket: Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34113/ on branch gh-pages at 2024-12-23 22:52 UTC

github-actions[bot] avatar Dec 04 '24 19:12 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.27%. Comparing base (d1d096e) to head (1131cc4). Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           develop   #34113       +/-   ##
============================================
+ Coverage    59.28%   75.27%   +15.98%     
============================================
  Files         2820      517     -2303     
  Lines        67904    22548    -45356     
  Branches     15093     5487     -9606     
============================================
- Hits         40255    16972    -23283     
+ Misses       24827     4914    -19913     
+ Partials      2822      662     -2160     
Flag Coverage Δ
e2e ?
e2e-api ?
unit 75.27% <ø> (ø)

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

codecov[bot] avatar Dec 04 '24 19:12 codecov[bot]

is there any way to test the component? even with unit tests 👀

KevLehman avatar Dec 04 '24 19:12 KevLehman

About tests, we currently mock the return of the server with an object, but the changes I've made would affect the parameters sent to the server and its return, so I don't think we can mock that, we would probably need to find a way to inject data into the db or mock the whole endpoint

@KevLehman @MarcosSpessatto

MartinSchoeler avatar Dec 17 '24 19:12 MartinSchoeler

But maybe we can have some units on the component to validate that the dates will be the right ones, no? 🤔

KevLehman avatar Dec 17 '24 19:12 KevLehman