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

[front] fix date format (timestamp) in horizontal bars widget (#7921) #8032

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

CelineSebe
Copy link
Member

@CelineSebe CelineSebe commented Aug 14, 2024

Proposed changes

  • change horizontalBarsChartOptions

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@CelineSebe CelineSebe self-assigned this Aug 14, 2024
@CelineSebe CelineSebe added the filigran team use to identify PR from the Filigran team label Aug 14, 2024
@CelineSebe CelineSebe linked an issue Aug 14, 2024 that may be closed by this pull request
@CelineSebe CelineSebe marked this pull request as ready for review August 14, 2024 10:31
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.21%. Comparing base (080858e) to head (94e6c02).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8032      +/-   ##
==========================================
+ Coverage   66.14%   66.21%   +0.06%     
==========================================
  Files         597      597              
  Lines       60375    60457      +82     
  Branches     6190     6193       +3     
==========================================
+ Hits        39937    40031      +94     
+ Misses      20438    20426      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@SarahBocognano SarahBocognano left a comment

Choose a reason for hiding this comment

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

Tested ✅

if (yFormatter && typeof value === 'number') {
return yFormatter(value);
}
if (typeof value === 'string' && value.length === 15) {
Copy link
Member

Choose a reason for hiding this comment

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

What means this value.length === 15 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Timestamp has 15 characters...

Copy link
Member

Choose a reason for hiding this comment

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

In my opinion the fix should be done in the file calling the function horizontalBarsChartOptions, not in this file. We have the possibility already to pass a function yFormatter to format the value. So use this to transform the timestamp in date string when necessary directly in the widget component when the attribute is a date.

@CelineSebe CelineSebe merged commit f44c713 into master Sep 20, 2024
6 checks passed
@CelineSebe CelineSebe deleted the issue/7921 branch September 20, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Date displayed as non-human readable format (timestamp)
4 participants