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] Task deselect on refresh #8392

Merged
merged 3 commits into from
Oct 13, 2024
Merged

[Fix] Task deselect on refresh #8392

merged 3 commits into from
Oct 13, 2024

Conversation

adkif
Copy link
Contributor

@adkif adkif commented Oct 11, 2024

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


resolves #8378

Summary by CodeRabbit

  • New Features

    • Enhanced handling of asynchronous operations in the Time Tracker component for improved responsiveness.
    • State updates now synchronize more effectively with external timer data.
  • Bug Fixes

    • Added checks to ensure that timer data exists before updating the state, preventing potential errors.
  • Refactor

    • Streamlined code for better readability and maintainability by encapsulating state update logic within a single observable chain.

@adkif adkif requested a review from evereq October 11, 2024 14:51
Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

Walkthrough

The changes in this pull request primarily focus on the TimeTrackerComponent within the time-tracker.component.ts file. Key modifications include enhancements to the handling of the external$ observable, utilizing timeTrackerFormService.setState() to structure state updates. The ngAfterViewInit lifecycle method has been updated to synchronize the component's state with external data. Additionally, the handling of the isOffline$ observable has been improved. Method signatures have been nominally updated, but these do not reflect functional changes.

Changes

File Path Change Summary
packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.component.ts - Enhanced handling of external$ observable with timeTrackerFormService.setState().
- Updated ngAfterViewInit to synchronize state with external data.
- Improved handling of isOffline$ observable.
- Updated method signatures (no functional change).

Assessment against linked issues

Objective Addressed Explanation
The task should remain selected and persist across page refreshes (8378) The changes do not address the task selection persistence issue.

🐰 In the meadow, where timers tick,
A rabbit hops, quick and slick.
With setState now in play,
Our tasks will surely stay!
No more unselects, just pure delight,
As we track our time, everything feels right! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ef0050f and 046e85e.

📒 Files selected for processing (1)
  • packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.component.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.component.ts

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?

❤️ Share
🪧 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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1ce997e and ef0050f.

📒 Files selected for processing (1)
  • packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.component.ts (4 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.component.ts (2)

43-43: Importing 'switchMap' operator is appropriate

The import of switchMap from 'rxjs' is necessary as it is utilized in the updated code.


782-788: Ensure 'arg' contains all necessary properties when setting form state

When calling timeTrackerFormService.setState(), ensure that arg includes all the necessary properties to prevent potential undefined or null reference errors.

Consider adding validation or default values for properties like organizationContactId, organizationTeamId, projectId, taskId, and note.

Copy link

nx-cloud bot commented Oct 11, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 046e85e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx build desktop-ui --prod --base-href ./
nx build gauzy -c=production --prod --verbose
✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

@evereq evereq merged commit 2ef1e4d into develop Oct 13, 2024
17 of 20 checks passed
@evereq evereq deleted the fix/task-deselect-on-refresh branch October 13, 2024 15:00
evereq added a commit that referenced this pull request Oct 13, 2024
* fix: #8339 employee & organization parameters to URLs

* fix: #8339 project parameters to URLs

* fix: #8339 date range picker parameters to URLs

* fix: #8339 project parameters to URLs

* fix: don't merge new config with old default config

* fix: don't merge new config with old default config

* fix: organization controller and module improvement

* feat: add standardWorkHoursPerDay column to organization entity

* feat: #8341 add standardWorkHoursPerDay column migration to organization entity

* feat: #8341 add standardWorkHoursPerDay column migration to organization table

* feat: #8341 add standardWorkHoursPerDay column migration to tenant table

* fix: create/update standard work hours per day

* feat: get task by view query model

* feat: get task by view query DTO

* feat: get tasks by view filter API

* fix: save standard work hours per day for organization

* fix: get tasks by view filters

* fix: remove unused DTO

* chore(deps): add chartjs-plugin-annotation

chore: add chartjs-plugin-annotation package for annotation support in charts

* fix: organization ID filter in query

* feat: add translations for Standard Work Hours

* feat: #8341 added horizontal dotted line

* fix(deepscan): removed unused import

* fix(coderrabitai): improve types and finders

* fix: sprint DELETE role permission

* fix: improve sprints role permissions

* fix: #8340 clear data before loading on report pages

* fix: issue type value using enum

* fix(deepscan): removed unused import

* feat: #8339 bookmark query params builder resolver

* [Feat] Add new workspace's methods to desktop authentication service (#8375)

* feat: add new methods to service

* feat: remove unecessary try-catch blocks and type annotations for return values in AuthService methods.

* [Feat] Create Reusable Component and Add Workspace Links (#8383)

* feat: export social links

* feat: create a shared logo component

* feat: create a shared social links component

* feat: add reusable patterns to constants

* feat: add link to magic workspace signin and use reusable logo, links and switch

* feat: SwitchThemeModule, LogoComponent, and SocialLinksComponent to NgxLoginModule

* fix(cspell): typo spelling :-)

* fix: improvement suggested by CodeRabbit

* fix: improvement suggested by CodeRabbit

* fix: improvement suggested by CodeRabbit

* fix: task type enum swagger

* fix: issue type enum

* feat: #8386 add module and entity for global logging of API

* feat: #8386 add repository and subscriber for global logging of API

* feat: #8386 table migration for "api_call_log" table

* fix: #8386 circular dependency injection in repository

* [Fix] Edit team functionality not working

* feat: #8386 retrieves call logs API

* fix(deepscan): property is accessed without null check

* fix: missing role-permission module

* fix: better encapsulation and reducing coupling between modules

* fix: task view not found update command handler

* [Fix] Filters not working

* fix: #8386 added origin into `api_call_log`  table

* [Feat] Implement magic login (#8387)

* feat: create reusable workspace selection component

* feat: create debounce click directive

* feat: create reusable avatar component

* feat: implement login magic component

* feat: implement login magic workspace component

* feat: implement login workspace component

* feat: reuse shared core styles

* feat: add new component to login

* feat: create authentication routes

* feat: use lazy loading for authentications routes

* fix: add code rabbit suggestions

* fix: apply code rabbit suggestions

* fix: apply code rabbit suggestions

* [Fix] Task deselect on refresh (#8392)

* fix: task deselect on refresh

* fix: add `organizationTeamId` missing property to time tracker API request and spread `arg.timer` into the request object.

* fix: apply code rabbit suggestion

* [Fix] Edit contact for (client,customers,leads) functionality not working  (#8393)

* [Fix] Edit contact for (client,customers,leads) functionality not working

* Remove member deletion

* [Fix] Remote timer logic stop calls (#8394)

* fix: remote timer logic and stopTimer calls

* refactor: remote timer logic

* [Feat] Resource Link Entity (#8397)

* feat: add resource link model and entity

* feat: resource link migration

* [Feat] Resource Link API (#8399)

* feat: add resource link model and entity

* feat: resource link migration

* feat: add resource link service

* feat: resource link commands

* feat: add resource link handlers

* feat: add resource link subscriber

* feat: add resource link controller and DTO

* chore: desktop builds on Windows

---------

Co-authored-by: Rahul R. <rahulrathore576@gmail.com>
Co-authored-by: GloireMutaliko21 <mufunyig@gmail.com>
Co-authored-by: Kifungo A <45813955+adkif@users.noreply.github.com>
Co-authored-by: samuelmbabhazi <samuelmbabhazi@gmail.com>
Co-authored-by: samuel mbabhazi <111171386+samuelmbabhazi@users.noreply.github.com>
Co-authored-by: Gloire Mutaliko (Salva) <86450367+GloireMutaliko21@users.noreply.github.com>
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.

[Fix] Task Selection Becomes Unselected After Refresh
2 participants