Skip to content

Fix for AMM-1585, AMM-1590, AMM-1591, AMM-1592 - #185

Merged
snehar-nd merged 10 commits into
developfrom
nd/sn/dev
Jul 8, 2025
Merged

Fix for AMM-1585, AMM-1590, AMM-1591, AMM-1592#185
snehar-nd merged 10 commits into
developfrom
nd/sn/dev

Conversation

@snehar-nd

@snehar-nd snehar-nd commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

📋 Description

JIRA ID:
AMM-1591
AMM-1585
AMM-1590
AMM-1592


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

Summary by CodeRabbit

  • Style
    • Updated form fields across multiple components to use a consistent full-width input style for improved layout and appearance.
    • Enhanced spacing for warning icons by adding right margin.
    • Improved layout consistency in diagnosis forms with updated grid classes and margins.
    • Refined cancer referral form layout using flexbox and responsive column classes for better responsiveness and cleaner conditional rendering.

@coderabbitai

coderabbitai Bot commented Jul 8, 2025

Copy link
Copy Markdown

Walkthrough

The changes apply a new CSS class, input-full-width, to all <mat-form-field> elements across several Angular component templates to enforce full-width styling. Layout classes are also adjusted in some components for improved consistency. Additionally, the main stylesheet introduces the .input-full-width class and updates spacing for .mat_warn_circle. The cancer referral component's template was refactored for responsive flexbox layout and cleaner conditional rendering.

Changes

File(s) Change Summary
.../anc-diagnosis/anc-diagnosis.component.html
.../pnc/pnc.component.html
.../quick-consult/quick-consult.component.html
.../history/cancer-history/family-disease-history/family-disease-history.component.html
.../history/cancer-history/obstetric-history/obstetric-history.component.html
.../history/cancer-history/personal-history/personal-history.component.html
Added input-full-width class to all <mat-form-field> elements; removed some inline padding styles in history components.
.../pnc-diagnosis/pnc-diagnosis.component.html Updated container divs with Bootstrap row/column classes; added input-full-width to form fields; added margin classes to buttons.
src/styles.css Added .input-full-width class (width: 100%); updated .mat_warn_circle with margin-right: 10px.
.../refer/cancer-refer/cancer-refer.component.html Refactored layout to use flexbox and responsive column classes; explicitly set form field widths; restructured conditional rendering for referral reason input.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AngularComponent
    participant CSS

    User->>AngularComponent: Loads form component
    AngularComponent->>CSS: Applies .input-full-width to mat-form-field
    CSS-->>AngularComponent: Renders fields at 100% width
    AngularComponent-->>User: Displays updated form layout
Loading

Poem

A hop and a skip, a CSS delight,
Full-width fields now shining bright.
With margin here and columns there,
Our forms look lovely everywhere!
The rabbit cheers this tidy feat—
Consistent style from ear to feet!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c517d2a and fdd17e8.

📒 Files selected for processing (1)
  • src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

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.

5Amogh
5Amogh previously approved these changes Jul 8, 2025
@snehar-nd snehar-nd changed the title Fix for amm-1585, amm-1590, amm-1591 Fix for amm-1585, amm-1590, amm-1591, amm-1592 Jul 8, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html (3)

16-17: Inline style="width:50%" is duplicated – prefer a reusable class

The same hard-coded width: 50% appears four times.
Inline styles make future tweaks painful and override the new input-full-width convention introduced elsewhere in the PR.

Create (or reuse) a semantic utility class, e.g.

.input-half-width { width: 50% !important; }

and replace the inline styles:

-<mat-form-field [style.width]="'50%'">
+<mat-form-field class="input-half-width">

This keeps the stylesheet DRY and consistent with the rest of the PR’s styling goals.

Also applies to: 40-41, 71-72, 107-108


76-77: Boolean attribute should be required not required="true"

HTML boolean attributes are either present or absent. Using required="true" is unnecessary and may confuse linters.

- required="true"
+ required

(The Angular reactive form already enforces the validator.)


100-108: Repeated column markup could be extracted into a reusable component

The three two-column rows share the same div--mat-form-field skeleton. Extracting a small presentational component (e.g., <app-two-column-field>) or an ng-template would cut ~40 lines, ease maintenance, and align with the project’s move toward cleaner templates.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e9d5e3 and c517d2a.

📒 Files selected for processing (4)
  • src/app/app-modules/nurse-doctor/history/cancer-history/family-disease-history/family-disease-history.component.html (4 hunks)
  • src/app/app-modules/nurse-doctor/history/cancer-history/obstetric-history/obstetric-history.component.html (11 hunks)
  • src/app/app-modules/nurse-doctor/history/cancer-history/personal-history/personal-history.component.html (19 hunks)
  • src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html (4 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/app/app-modules/nurse-doctor/history/cancer-history/obstetric-history/obstetric-history.component.html
  • src/app/app-modules/nurse-doctor/history/cancer-history/family-disease-history/family-disease-history.component.html
  • src/app/app-modules/nurse-doctor/history/cancer-history/personal-history/personal-history.component.html
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: devikasuresh20
PR: PSMRI/MMU-UI#159
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html:604-606
Timestamp: 2024-12-04T10:52:54.401Z
Learning: In `src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html`, when implementing conditional logic, prefer to clearly separate conditions for better readability, even if it introduces some redundancy.
Learnt from: devikasuresh20
PR: PSMRI/MMU-UI#153
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.ts:325-337
Timestamp: 2024-11-28T06:19:38.920Z
Learning: In `general-patient-vitals.component.ts`, within the `checkNurseRequirements` method, the BP validation logic is intentionally specific to each flow to ensure clarity. Refactoring this logic is planned for future broader improvement efforts.
src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html (2)
Learnt from: devikasuresh20
PR: PSMRI/MMU-UI#159
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html:604-606
Timestamp: 2024-12-04T10:52:54.401Z
Learning: In `src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html`, when implementing conditional logic, prefer to clearly separate conditions for better readability, even if it introduces some redundancy.
Learnt from: devikasuresh20
PR: PSMRI/MMU-UI#153
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.ts:325-337
Timestamp: 2024-11-28T06:19:38.920Z
Learning: In `general-patient-vitals.component.ts`, within the `checkNurseRequirements` method, the BP validation logic is intentionally specific to each flow to ensure clarity. Refactoring this logic is planned for future broader improvement efforts.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint-and-audit / lint-and-audit
  • GitHub Check: Build

Comment on lines 6 to +8
<div class="">
<div class="col-12 row">
<div class="col-6 tcell">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="display: flex">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 tcell">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Grid columns are missing the .row (or equivalent) wrapper

Bootstrap’s column classes (col-xs-*, col-sm-*, …) rely on being direct children of a .row (or container-*) element to get proper flex behaviour and gutter paddings.
By adding display:flex on the parent and dropping the original .row wrapper, you lose the automatic negative margins and may get broken alignment / horizontal scroll, especially on narrow viewports.

Consider reinstating a .row container or switching to pure Flexbox utilities (d-flex, flex-column, flex-fill, etc.) consistently instead of mixing paradigms.
This also keeps the layout in line with the rest of the module.

🤖 Prompt for AI Agents
In
src/app/app-modules/nurse-doctor/refer/cancer-refer/cancer-refer.component.html
around lines 6 to 8, the Bootstrap grid columns are missing a wrapping .row
container, which breaks the layout and gutter spacing. To fix this, wrap the
column divs inside a div with the class .row instead of using inline
display:flex on the parent. This will restore proper Bootstrap grid behavior and
consistent alignment across viewports.

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2025

Copy link
Copy Markdown

@drtechie drtechie changed the title Fix for amm-1585, amm-1590, amm-1591, amm-1592 Fix for AMM-1585, AMM-1590, AMM-1591, AMM-1592 Jul 8, 2025
@snehar-nd
snehar-nd merged commit 457ae95 into develop Jul 8, 2025
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 10, 2025
1 task
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.

2 participants