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

Timezone basic functionality #6492

Open
wants to merge 7 commits into
base: feat/timezone-picker
Choose a base branch
from

Conversation

ahmadshaheer
Copy link
Collaborator

@ahmadshaheer ahmadshaheer commented Nov 20, 2024

Summary

  • a context for managing the current timezone
  • fallback to browser timezone if timezone is not set
  • set the preferred timezone in local storage for now (will work on storing it in preference API)
  • handle the timezone preferences using the state in timezone context

Related Issues / PR's

Part of https://github.com/SigNoz/engineering-pod/issues/2005

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Adds timezone management with context provider, browser fallback, and local storage, updating components to reflect timezone changes.

  • Timezone Management:
    • Introduces TimezoneProvider in providers/Timezone.tsx to manage timezone context.
    • Fallback to browser timezone if no preferred timezone is set.
    • Stores preferred timezone in local storage (LOCALSTORAGE.PREFERRED_TIMEZONE).
  • Component Updates:
    • CustomTimePicker.tsx, CustomTimePickerPopoverContent.tsx, and TimezonePicker.tsx now use useTimezone hook to access timezone context.
    • TimezoneAdaptation.tsx allows clearing timezone override, reverting to browser timezone.
  • UI Changes:
    • Displays active timezone offset in CustomTimePicker and CustomTimePickerPopoverContent.
    • Adds "Clear override" button in TimezoneAdaptation when timezone is overridden.

This description was created by Ellipsis for e012f10. It will automatically update as commits are pushed.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 676e32e in 44 seconds

More details
  • Looked at 396 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/providers/Timezone.tsx:76
  • Draft comment:
    Storing the timezone as a JSON string in localStorage is inconsistent with how it's retrieved. Consider storing it as a plain string instead.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_gm33mh7sTACsIzlq


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

frontend/src/providers/Timezone.tsx Outdated Show resolved Hide resolved
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on e012f10 in 45 seconds

More details
  • Looked at 77 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. frontend/src/providers/Timezone.tsx:34
  • Draft comment:
    Ensure getTimezoneObjectByTimezoneString does not return null or handle the case where it might return null to avoid runtime errors.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. frontend/src/components/CustomTimePicker/timezoneUtils.ts:136
  • Draft comment:
    Ensure getTimezoneObjectByTimezoneString does not return null or handle the case where it might return null to avoid runtime errors.
  • Reason this comment was not posted:
    Marked as duplicate.
3. frontend/src/providers/Timezone.tsx:27
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is not relevant to the changes made in this diff. The file structure mentioned in the comment does not apply to the file being reviewed. Therefore, the comment should be deleted.
    I might be missing some context about the overall project structure, but based on the file path and name, the comment does not seem applicable.
    The file path and name provide enough context to determine that the comment is not relevant to this specific file.
    The comment is not about a change made in this diff and should be deleted.

Workflow ID: wflow_DFcP49jSYbkqMl2K


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

1 participant