Skip to content

Conversation

@helenKaryamsetty
Copy link
Member

@helenKaryamsetty helenKaryamsetty commented Jun 13, 2025

πŸ“‹ Description

JIRA ID:


βœ… Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • πŸ”₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • πŸ›  Refactor (change that is neither a fix nor a new feature)
  • βš™οΈ Config change (configuration file or build script updates)
  • πŸ“š Documentation (updates to docs or readme)
  • πŸ§ͺ Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • πŸš€ Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

  • Bug Fixes

    • Improved response handling and user feedback when activating or deactivating user mappings, ensuring success and error messages are shown appropriately.
    • The "Save" button in the "Create Service Point" form no longer resets the form after saving.
  • Chores

    • Updated the Common-UI component reference to the latest version.

@coderabbitai
Copy link

coderabbitai bot commented Jun 13, 2025

Walkthrough

This update changes the commit reference for the Common-UI subproject, modifies the behavior of the "Save" button in the service point form to stop resetting the form after saving, and updates the logic for activating or deactivating user mappings to use session storage and improved response handling.

Changes

File(s) Change Summary
Common-UI (subproject) Updated subproject commit reference from 881c233... to 6412a48....
src/app/app-provider-admin/provider-admin/activities/service-point-master/service-point.component.html Removed form reset (servicePointForm1.reset()) from the "Save" button click handler.
src/app/app-provider-admin/provider-admin/configurations/swymed-user-mapping/swymed-user-mapping.component.ts Changed activateDeactivateMapping to use modifiedBy from session storage and improved response handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ServicePointComponent
    participant SwymedUserMappingComponent
    participant SessionStorage
    participant MappingService

    User->>ServicePointComponent: Clicks "Save" button
    ServicePointComponent->>ServicePointComponent: Calls storeServicePoints()
    %% Form is no longer reset after saving

    User->>SwymedUserMappingComponent: Triggers activateDeactivateMapping(item)
    SwymedUserMappingComponent->>SessionStorage: Gets modifiedBy
    SwymedUserMappingComponent->>MappingService: Calls mappingActivationDeactivation(item, modifiedBy)
    MappingService-->>SwymedUserMappingComponent: Returns response
    alt response.statusCode == 200
        SwymedUserMappingComponent->>User: Shows success alert and refreshes user details
    else response indicates error
        SwymedUserMappingComponent->>User: Shows error alert with message
    end
Loading

Possibly related PRs

Poem

A hop and a skip, the UI’s anew,
No more resets when saving you do!
Mappings now smarter, with session in tow,
Success or error, alerts let you know.
With Common-UI fresh from the patch,
This bunny is happyβ€”what a fine batch!
πŸ‡βœ¨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

πŸ”§ ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: ngx-bootstrap@12.0.0
npm error Found: @angular/animations@16.2.12
npm error node_modules/@angular/animations
npm error dev @angular/animations@"^16.2.0" from the root project
npm error peer @angular/animations@"^16.0.0 || ^17.0.0" from @angular/material@16.2.12
npm error node_modules/@angular/material
npm error dev @angular/material@"^16.2.12" from the root project
npm error 1 more (@angular/platform-browser)
npm error
npm error Could not resolve dependency:
npm error peer @angular/animations@"^17.0.0" from ngx-bootstrap@12.0.0
npm error node_modules/ngx-bootstrap
npm error dev ngx-bootstrap@"^12.0.0" from the root project
npm error
npm error Conflicting peer dependency: @angular/animations@17.3.12
npm error node_modules/@angular/animations
npm error peer @angular/animations@"^17.0.0" from ngx-bootstrap@12.0.0
npm error node_modules/ngx-bootstrap
npm error dev ngx-bootstrap@"^12.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2025-06-13T16_30_50_000Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-13T16_30_50_000Z-debug-0.log

✨ Finishing Touches
  • πŸ“ Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@sonarqubecloud
Copy link

Copy link

@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: 1

πŸ”­ Outside diff range comments (1)
src/app/app-provider-admin/provider-admin/configurations/swymed-user-mapping/swymed-user-mapping.component.ts (1)

351-362: πŸ› οΈ Refactor suggestion

Reuse existing createdBy instead of fetching uname again

modifiedBy is now sourced via sessionstorage.getItem('uname'), but the component already stores the same value in this.createdBy during ngOnInit.
Using a single source of truth avoids inconsistencies (e.g., if the key name changes or the session value is missing) and removes an unnecessary storage hit.

-const modifiedBy: any = this.sessionstorage.getItem('uname');
+const modifiedBy: any = this.createdBy;
🧹 Nitpick comments (1)
src/app/app-provider-admin/provider-admin/configurations/swymed-user-mapping/swymed-user-mapping.component.ts (1)

364-374: Guard against res being undefined before accessing errorMessage

If the backend returns an empty body or a non-JSON payload, res may be undefined, leading to Cannot read property 'errorMessage' of undefined.

-} else {
-  this.dialogService.alert(res.errorMessage, 'error');
+} else if (res && res.errorMessage) {
+  this.dialogService.alert(res.errorMessage, 'error');
+} else {
+  this.dialogService.alert('Operation failed', 'error');
 }
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between cb9bded and cbd9a05.

πŸ“’ Files selected for processing (3)
  • Common-UI (1 hunks)
  • src/app/app-provider-admin/provider-admin/activities/service-point-master/service-point.component.html (1 hunks)
  • src/app/app-provider-admin/provider-admin/configurations/swymed-user-mapping/swymed-user-mapping.component.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
πŸ”‡ Additional comments (1)
src/app/app-provider-admin/provider-admin/activities/service-point-master/service-point.component.html (1)

523-531: Removed redundant reset() – good call

Dropping servicePointForm1.reset() eliminates the double-reset that was wiping user input immediately after a successful storeServicePoints() save.
No functional / UX concerns spotted; the form is already cleared by the add-row handler (addServicePointToList()), so the extra reset here was superfluous.

@@ -1 +1 @@
Subproject commit 881c2339634ed4a292d271d52c4365af496405fd
Subproject commit 6412a482513a89ab2793422fb1cbbbe95d330324
Copy link

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

❓ Verification inconclusive

Verify the new Common-UI submodule commit hash.

Ensure that the updated commit 6412a482513a89ab2793422fb1cbbbe95d330324 exists in the Common-UI repository and contains the intended form-reset and response-handling improvements.

Run the following script to confirm:


🏁 Script executed:

#!/usr/bin/env bash
# Confirm the commit exists in the Common-UI remote
git ls-remote https://github.com/PSMRI/Common-UI.git | grep 6412a482513a89ab2793422fb1cbbbe95d330324

Length of output: 102


Commit Hash Not Found in Common-UI Remote

The submodule reference 6412a482513a89ab2793422fb1cbbbe95d330324 could not be located in the Common-UI repository. Please ensure that:

  • The intended commit has been pushed to the PSMRI/Common-UI remote.
  • The submodule pointer in your .gitmodules (or wherever the submodule is referenced) is updated to a valid, existing commit that includes the form-reset and response-handling improvements.

Tags:

πŸ€– Prompt for AI Agents
In the Common-UI submodule reference at line 1, the commit hash
6412a482513a89ab2793422fb1cbbbe95d330324 does not exist in the remote
repository. Verify that the intended commit has been pushed to the
PSMRI/Common-UI remote repository. Then update the submodule pointer in the
.gitmodules file or wherever the submodule is referenced to point to a valid
commit that includes the required form-reset and response-handling improvements.

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