operatorfabric-core
operatorfabric-core copied to clipboard
Settings screen : Add a field for "timezone for mails" (#7083)
- In release notes :
- In chapter : Features
- Text : #7083 : Add a timezone selection for email notifications in user settings
Summary by CodeRabbit
-
New Features
- Introduced a timezone selection for email notifications in user settings.
- Enhanced email recap functionality to format dates according to user-specific time zones.
- Added support for remote logging configuration in settings.
-
Bug Fixes
- Improved handling of invalid settings to ensure defaults are applied correctly.
-
Documentation
- Updated configuration guidelines to reflect new settings structure.
-
Tests
- Expanded test coverage for user settings related to timezone management and notifications.
-
Localization
- Added new keys for timezone settings in English, French, and Dutch localization files.
[!CAUTION]
Review failed
The head commit changed during the review from c2283eee0ee1b53dd1d208128112f150b504c0c7 to d29df2efb914534925639076b70ef1200be1fb98.
Walkthrough
The pull request introduces several changes across multiple files, primarily focused on enhancing date and time handling with the addition of timezone support. A new dependency, date-fns-tz, is included in the package.json, and various classes are updated to utilize this library for formatting dates according to user-specific timezones. Additionally, new properties and methods are added to handle timezone settings in user-related classes, and modifications are made to the user interface to allow users to select their preferred timezone for email notifications.
Changes
| File | Change Summary |
|---|---|
node-services/cards-external-diffusion/package.json |
Added new dependency: "date-fns-tz": "3.1.3" in dependencies. |
node-services/cards-external-diffusion/src/domain/application/cardsDiffusionControl.ts |
Updated getFormattedDateAndTimeFromEpochDate method to include timezoneForEmails parameter. |
node-services/cards-external-diffusion/src/domain/application/dailyCardsDiffusionControl.ts |
Updated sendDailyRecap and dailyFormat methods to include timezoneForEmails parameter. |
node-services/cards-external-diffusion/src/domain/application/realTimeCardsDiffusionControl.ts |
Updated multiple methods to accept timezoneForEmails and use formatInTimeZone for date formatting. |
node-services/cards-external-diffusion/src/domain/application/userWithPerimeter.ts |
Added optional property timezoneForEmails to UserWithPerimeters class. |
services/users/src/main/java/org/opfab/users/model/CurrentUserWithPerimeters.java |
Added timezoneForEmails field with getter and setter methods. |
services/users/src/main/java/org/opfab/users/model/UserSettings.java |
Added timezoneForEmails field with getter and setter methods; updated constructor and patch method. |
services/users/src/main/java/org/opfab/users/services/CurrentUserWithPerimetersService.java |
Updated handleUserSettings method to set timezoneForEmails in CurrentUserWithPerimeters. |
services/users/src/main/java/org/opfab/users/services/UserSettingsService.java |
Added condition in patchUserSettings to check for timezoneForEmails updates. |
services/users/src/main/modeling/swagger.yaml |
Added timezoneForEmails property to UserSettings and CurrentUserWithPerimeters definitions. |
services/users/src/test/java/org/opfab/users/services/UserSettingsServiceShould.java |
Added new tests for timezoneForEmails in Patch and Update classes. |
src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc |
Updated configuration format to group settings under settings: { }. |
ui/main/src/app/business/view/settings/settings.view.spec.ts |
Updated tests for saveSettings to include timezoneForEmails. |
ui/main/src/app/business/view/settings/settings.view.ts |
Refactored getSetting method to include timezoneForEmails and validated replayInterval before saving. |
ui/main/src/app/modules/settings/components/settings/settings.component.html |
Added checkbox for remote logging and multi-select for timezone configuration. |
ui/main/src/app/modules/settings/components/settings/settings.component.ts |
Added properties and methods for managing timezone settings in the SettingsComponent. |
ui/main/src/assets/i18n/en.json |
Added localization for timezoneForEmails and updated casing for email. |
ui/main/src/assets/i18n/fr.json |
Added French localization for timezoneForEmails and updated casing for email. |
ui/main/src/assets/i18n/nl.json |
Added Dutch localization for timezoneForEmails and updated casing for email. |
ui/main/tsconfig.json |
Added "es2022" to the lib array in TypeScript configuration. |
Possibly related PRs
- #7253: This PR involves changes to the
dateTimeFormatterservice, which is relevant because the main PR introduces a new dependency (date-fns-tz) that is used for date formatting in theCardsDiffusionControlclass. The changes in both PRs focus on enhancing date formatting capabilities, indicating a potential relationship in how date handling is managed across the codebase.
Suggested reviewers
- quinarygio
Poem
π In the garden where time does sway,
New settings bloom, brightening the day.
With timezones set for emails to send,
Each message now tailored, my dear friend.
So hop along, letβs celebrate this feat,
For every rabbit deserves a timezone treat! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
πͺ§ Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
85.1% Coverage on New Code
0.0% Duplication on New Code