-
Notifications
You must be signed in to change notification settings - Fork 16
removing extra reset #83
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
Conversation
WalkthroughThis 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
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
Possibly related PRs
Poem
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
npm error code ERESOLVE β¨ Finishing Touches
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. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this 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 suggestionReuse existing
createdByinstead of fetchingunameagain
modifiedByis now sourced viasessionstorage.getItem('uname'), but the component already stores the same value inthis.createdByduringngOnInit.
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 againstresbeingundefinedbefore accessingerrorMessageIf the backend returns an empty body or a non-JSON payload,
resmay beundefined, leading toCannot 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
π 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 redundantreset()β good callDropping
servicePointForm1.reset()eliminates the double-reset that was wiping user input immediately after a successfulstoreServicePoints()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 | |||
There was a problem hiding this comment.
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 6412a482513a89ab2793422fb1cbbbe95d330324Length 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-UIremote. - 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.



π Description
JIRA ID:
β Type of Change
βΉοΈ 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
Chores