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

Fix asset uptime for phases of day #5894

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Jul 21, 2023

WHAT

🤖 Generated by Copilot at 23bbbe2

Improved the UI and functionality of the Uptime component for assets. Fixed bugs, refactored code, and optimized data filtering and caching.

Proposed Changes

image
image

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

HOW

🤖 Generated by Copilot at 23bbbe2

  • Modify the STATUS_COLORS object to use more descriptive and consistent keys for the asset status values (link)
  • Fix the statusToCarryOver variable to use the last record of the previous day instead of the first record (link)
  • Add the recordsInPeriodCache object to store the filtered records for each hour of the day and improve performance (link)
  • Assign the recordsInPeriod variable from the recordsInPeriodCache object if it exists, or from the original filtering logic otherwise (link)
  • Introduce the previousLatestRecord variable to store the last record of the previous hour and use it for checking the status transition at the end of the hour (link)
  • Update the logic for pushing the status color at the end of the hour to use the previousLatestRecord variable and the status property of the record, and change the default value to "Not Monitored" (link)
  • Change the status color for the "down" status to "Down" (link)
  • Change the status color for the "maintenance" status to "Under Maintenance" (link)
  • Change the status color for the "operational" status to "Operational" (link)
  • Change the status colors for the default case to "Not Monitored" (link)

@Ashesh3 Ashesh3 requested a review from a team July 21, 2023 12:57
@Ashesh3 Ashesh3 requested a review from a team as a code owner July 21, 2023 12:57
@Ashesh3 Ashesh3 requested a review from bodhish July 21, 2023 12:57
@vercel
Copy link

vercel bot commented Jul 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 21, 2023 0:57am

@netlify
Copy link

netlify bot commented Jul 21, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 23bbbe2
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64ba809e498b4a0008d1a595
😎 Deploy Preview https://deploy-preview-5894--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

LGTM

@github-actions github-actions bot added the cypress failed pull request with cypress test failure label Jul 21, 2023
@khavinshankar khavinshankar merged commit e3216ce into develop Jul 21, 2023
32 of 33 checks passed
@khavinshankar khavinshankar deleted the fix-asset-uptime-v3 branch July 21, 2023 13:32
@github-actions
Copy link

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cypress failed pull request with cypress test failure tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Availability history is malfunctioning
4 participants