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

Update for List View in Shifting from Gird LayOut to List Layout #8882

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

AnveshNalimela
Copy link

@AnveshNalimela AnveshNalimela commented Oct 22, 2024

Proposed Changes

-Aligned the components in shifitng and resource page
-Increased the search bar size in list view
-Adjusted the componets
-Changed the font to semibold in Resource card
-Changed the gridlayout from 2 cols to 3 cols to remove extra white space

@ohcnetwork/care-fe-code-reviewers
Before:
{FEF5B5E5-6B5B-4DA0-968E-4AE59C51DC1E}
After:
image

Story points Requesting: 2 points

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

Summary by CodeRabbit

  • New Features

    • Enhanced the ListView component to display detailed patient information, shifting status, and facility details.
    • Added localization support for contact information with the new entry "contact_info": "Contact Info".
  • Bug Fixes

    • Improved rendering logic for shifting cards, simplifying conditional rendering for empty data states.

@AnveshNalimela AnveshNalimela requested a review from a team as a code owner October 22, 2024 16:32
Copy link

netlify bot commented Oct 22, 2024

Deploy Preview for care-ohc failed.

Name Link
🔨 Latest commit 768f494
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/672cc33fad3d9100080439ef

@AnveshNalimela AnveshNalimela changed the title Resloved the UI and Changed GRID 3 cols Alignment of components and Changed GRID layout 3 cols in shifiting Oct 22, 2024
Copy link

👋 Hi, @AnveshNalimela,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Oct 23, 2024
@bodhish
Copy link
Member

bodhish commented Oct 23, 2024

If we are making this change, I would really make it a list ie like a table; than have a grid;

image

CC @nihal467 @gigincg @rithviknishad

@AnveshNalimela
Copy link
Author

Any Changes required if yes. Suggest

@bodhish
Copy link
Member

bodhish commented Oct 27, 2024

@AnveshNalimela Please use the reference UI shared to update the list view.

@AnveshNalimela
Copy link
Author

AnveshNalimela commented Oct 27, 2024

{5BB5DB58-D088-4200-BF7E-200A5B01FFB2}
@bodhish Have a look

@AnveshNalimela AnveshNalimela changed the title Alignment of components and Changed GRID layout 3 cols in shifiting Redesign UI for List View in Shifting Oct 27, 2024
src/Components/Shifting/ListView.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/ListView.tsx Outdated Show resolved Hide resolved
@nihal467
Copy link
Member

nihal467 commented Nov 5, 2024

@AnveshNalimela

image

  • On the mobile view, the heading is kept differently, which is kind of different, i think we can hide them in mobile view

image

  • the list is not properly responsive, in iPad pro, the multiple things are overlapping with each other

image

  • keep the heading left aligned as per design,

Copy link

coderabbitai bot commented Nov 5, 2024

Walkthrough

The pull request introduces significant modifications to the ListView component in src/components/Shifting/ShiftingList.tsx, including adjustments to state management and rendering logic. The useFilters hook's limit option has been removed, and the modalFor state has been redefined. The rendering structure has been enhanced to display patient information and shifting status more comprehensively. Additionally, a new localization entry for contact information has been added to public/locale/en.json, and the .env file has been updated with comments for clarity.

Changes

File Path Change Summary
src/components/Shifting/ShiftingList.tsx Modified ListView component: adjusted useFilters, redefined modalFor state, updated rendering logic, and removed ShiftingBlock.
public/locale/en.json Added a new key-value pair: "contact_info": "Contact Info" for localization support.
.env Added comments for clarity; no changes to environment variables.

Assessment against linked issues

Objective Addressed Explanation
Design the List View in Shifting Page (#8826) The ListView component was significantly altered rather than designed as requested.

🐰 In the code where shifts once danced,
A ListView transformed, it took a new stance.
With patient details shining bright,
And contact info now in sight!
Let's hop along, with changes so grand,
A new path we carve, together we stand! 🐇✨


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

@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 and nitpick comments (4)
src/Locale/ta.json (1)

Line range hint 1-812: Standardize variable placeholder usage

There are inconsistencies in how variable placeholders are used. For example:

  • {{name}} is used in some places
  • {{type}} is used differently in others
  • {{version}} appears without consistent formatting

Consider standardizing all variable placeholders to use the double curly brace format consistently.

src/components/Shifting/ShiftingList.tsx (3)

160-160: Simplify property access using optional chaining

You can simplify null-safe property access by using optional chaining:

- {(shift.origin_facility_object || {}).name}
+ {shift.origin_facility_object?.name}
🧰 Tools
🪛 Biome

[error] 160-160: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


171-171: Simplify property access using optional chaining

Similarly, you can update this expression for better readability:

- {(shift.shifting_approving_facility_object || {}).name}
+ {shift.shifting_approving_facility_object?.name}
🧰 Tools
🪛 Biome

[error] 171-171: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


228-231: Remove commented-out code for cleaner codebase

It's good practice to remove unused code to maintain clarity:

- // show={modalFor === shift.external_id}
- // onClose={() =>
- //   setModalFor({ externalId: undefined, loading: false })
- // }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a65d7ec and fe351b1.

📒 Files selected for processing (7)
  • src/Locale/en.json (1 hunks)
  • src/Locale/hi.json (1 hunks)
  • src/Locale/kn.json (1 hunks)
  • src/Locale/ml.json (1 hunks)
  • src/Locale/ta.json (1 hunks)
  • src/components/Resource/ResourceBoard.tsx (1 hunks)
  • src/components/Shifting/ShiftingList.tsx (6 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/Locale/kn.json
  • src/Locale/ml.json
  • src/components/Resource/ResourceBoard.tsx
🧰 Additional context used
🪛 Biome
src/components/Shifting/ShiftingList.tsx

[error] 160-160: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 171-171: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (6)
src/Locale/hi.json (3)

Line range hint 1-812: JSON structure looks good!

The file follows proper JSON formatting with consistent key-value pairs.


Line range hint 1-812: Special character encoding is properly handled!

All Hindi characters and special characters are correctly encoded in the JSON file.


Line range hint 1-812: Verify alignment with translation policy.

Based on previous review comments ("skip adding translations for other languages"), please confirm if adding this complete Hindi translation file aligns with the current translation policy.

src/Locale/ta.json (2)

Line range hint 1-812: File structure follows JSON standards correctly

The JSON structure is well-formatted with consistent key-value pairs and proper nesting.


Line range hint 1-812: Good translation approach for technical terms

Technical acronyms (PRN, ABDM, CSV etc.) are appropriately kept in English while surrounding context is translated to Tamil, maintaining clarity for users.

src/Locale/en.json (1)

477-477: LGTM! The new localization entry follows conventions.

The added key-value pair "contact_info": "Contact Info" is well-formatted, follows naming conventions, and is properly placed in alphabetical order.

src/Locale/ta.json Outdated Show resolved Hide resolved
src/Locale/ta.json Outdated Show resolved Hide resolved
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 and nitpick comments (2)
src/components/Shifting/ShiftingList.tsx (2)

161-162: Use optional chaining for safer property access.

Replace the object destructuring with optional chaining to handle potential undefined values more elegantly.

-{(shift.origin_facility_object || {}).name}
+{shift.origin_facility_object?.name}

-{(shift.shifting_approving_facility_object || {}).name}
+{shift.shifting_approving_facility_object?.name}

Also applies to: 172-173

🧰 Tools
🪛 Biome

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


94-104: Enhance accessibility for contact information.

The contact information section could benefit from improved accessibility attributes.

 <div className="phone number">
   <dt
     title={t("phone_number")}
+    aria-label={t("phone_number")}
     className="flex items-center text-sm font-medium leading-5 text-secondary-500"
   >
     <CareIcon icon="l-mobile-android" className="mr-2" />
-    <dd className="text-sm font-bold leading-5 text-secondary-900">
+    <dd className="text-sm font-bold leading-5 text-secondary-900" aria-live="polite">
       {shift.patient_object.phone_number || ""}
     </dd>
   </dt>
 </div>

Also applies to: 105-115

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fe351b1 and 9b042b7.

📒 Files selected for processing (2)
  • src/Locale/ta.json (1 hunks)
  • src/components/Shifting/ShiftingList.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Locale/ta.json
🧰 Additional context used
🪛 Biome
src/components/Shifting/ShiftingList.tsx

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 172-172: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (2)
src/components/Shifting/ShiftingList.tsx (2)

307-323: Well-implemented responsive design for list view.

The responsive grid layout with conditional rendering for different screen sizes is well-implemented. The headers are appropriately hidden on mobile views and the layout adjusts nicely between different screen sizes.


83-237: Successfully implemented list view with improved UI.

The implementation effectively addresses the PR objectives:

  • Shifted from grid to list layout with proper alignment
  • Enhanced visibility of shifting status and actions
  • Improved component organization with clear visual hierarchy
  • Responsive design that works well across different screen sizes

The code is well-structured and maintainable.

🧰 Tools
🪛 Biome

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 172-172: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/components/Shifting/ShiftingList.tsx Outdated Show resolved Hide resolved
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 and nitpick comments (3)
src/components/Shifting/ShiftingList.tsx (3)

34-40: LGTM! Consider extracting the initial state.

The state type definition is well-focused. Consider extracting the initial state to a constant for better maintainability.

+const INITIAL_MODAL_STATE = {
+  externalId: undefined,
+  loading: false,
+} as const;

-const [modalFor, setModalFor] = useState<{
-  externalId: string | undefined;
-  loading: boolean;
-}>({
-  externalId: undefined,
-  loading: false,
-});
+const [modalFor, setModalFor] = useState(INITIAL_MODAL_STATE);

161-161: Use optional chaining for better null safety.

The static analysis correctly identified opportunities to use optional chaining for facility object properties.

-{(shift.origin_facility_object || {}).name}
+{shift.origin_facility_object?.name}

-{(shift.shifting_approving_facility_object || {}).name}
+{shift.shifting_approving_facility_object?.name}

Also applies to: 172-172

🧰 Tools
🪛 Biome

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


229-232: Remove commented code.

Remove the commented-out code as it's no longer needed and can cause confusion.

-                  // show={modalFor === shift.external_id}
-                  // onClose={() =>
-                  //   setModalFor({ externalId: undefined, loading: false })
-                  // }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fe351b1 and 9b042b7.

📒 Files selected for processing (2)
  • src/Locale/ta.json (1 hunks)
  • src/components/Shifting/ShiftingList.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Locale/ta.json
🧰 Additional context used
🪛 Biome
src/components/Shifting/ShiftingList.tsx

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 172-172: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (1)
src/components/Shifting/ShiftingList.tsx (1)

307-323: LGTM! Well-structured responsive layout.

The grid layout with responsive classes effectively handles different screen sizes. The mobile-first approach with hidden elements on smaller screens improves the user experience.

src/components/Shifting/ShiftingList.tsx Outdated Show resolved Hide resolved
@AnveshNalimela
Copy link
Author

@nihal467 @rithviknishad Made the changes mentioned and Updated PR and screenshots

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: 0

🧹 Outside diff range and nitpick comments (5)
src/components/Shifting/ShiftingList.tsx (5)

Line range hint 1-31: Consider organizing imports by category.

Consider grouping imports into categories for better maintainability:

  • React and hooks
  • Components
  • Utils and configs
  • Types and models

Line range hint 45-53: Add error handling to transfer completion.

Consider adding try-catch block to handle potential errors during transfer completion and show appropriate error messages to users.

 const handleTransferComplete = async (shift: ShiftingModel) => {
   setModalFor({ ...modalFor, loading: true });
-  await request(routes.completeTransfer, {
-    pathParams: { externalId: shift.external_id },
-  });
-  navigate(
-    `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation`,
-  );
+  try {
+    await request(routes.completeTransfer, {
+      pathParams: { externalId: shift.external_id },
+    });
+    navigate(
+      `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation`,
+    );
+  } catch (error) {
+    // Show error notification
+    setModalFor({ externalId: undefined, loading: false });
+  }
 };

161-162: Use optional chaining for safer object access.

Following the static analysis suggestion, use optional chaining for safer object access:

-                {(shift.origin_facility_object || {}).name}
+                {shift.origin_facility_object?.name}

-                  {(shift.shifting_approving_facility_object || {}).name}
+                  {shift.shifting_approving_facility_object?.name}

Also applies to: 172-173

🧰 Tools
🪛 Biome

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


83-237: Consider extracting ShiftCard component.

The shift card rendering logic is complex and could benefit from being extracted into a separate component for better maintainability and reusability.

Example structure:

interface ShiftCardProps {
  shift: ShiftingModel;
  onViewDetails: (externalId: string) => void;
  onTransferComplete: (shift: ShiftingModel) => void;
  modalFor: { externalId: string | undefined; loading: boolean };
}

const ShiftCard: React.FC<ShiftCardProps> = ({ shift, onViewDetails, onTransferComplete, modalFor }) => {
  // Current rendering logic
};
🧰 Tools
🪛 Biome

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 172-172: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


307-323: Consider accessibility improvements for responsive layout.

While the responsive design looks good, consider:

  1. Adding aria-hidden="true" to elements that are hidden on mobile
  2. Ensuring sufficient color contrast for text elements
  3. Adding screen reader descriptions for icons
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9b042b7 and 2cd8c0f.

📒 Files selected for processing (1)
  • src/components/Shifting/ShiftingList.tsx (6 hunks)
🧰 Additional context used
🪛 Biome
src/components/Shifting/ShiftingList.tsx

[error] 161-161: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 172-172: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (1)
src/components/Shifting/ShiftingList.tsx (1)

33-40: LGTM! Good improvement to state management.

The addition of proper typing for modalFor state and inclusion of loading state improves type safety and user experience.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

👋 Hi, @AnveshNalimela,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2024

@AnveshNalimela can you clear all the merge conflict to get it ready for review

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Nov 6, 2024
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 and nitpick comments (4)
src/components/Shifting/ShiftingList.tsx (4)

Line range hint 50-58: Add error handling to transfer completion.

While the type safety is good, consider adding error handling:

 const handleTransferComplete = async (shift: ShiftingModel) => {
   setModalFor({ ...modalFor, loading: true });
-  await request(routes.completeTransfer, {
-    pathParams: { externalId: shift.external_id },
-  });
-  navigate(
-    `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation`,
-  );
+  try {
+    await request(routes.completeTransfer, {
+      pathParams: { externalId: shift.external_id },
+    });
+    navigate(
+      `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation`,
+    );
+  } catch (error) {
+    // Handle error appropriately
+    setModalFor({ ...modalFor, loading: false });
+  }
 };

83-245: Consider breaking down the complex list item into smaller components.

The current implementation has a lot of nested JSX which makes it harder to maintain. Consider extracting the following into separate components:

  • PatientInfo (lines 89-96)
  • ContactInfo (lines 98-121)
  • ShiftingStatus (lines 123-157)
  • FacilityInfo (lines 159-193)
  • ActionButtons (lines 194-242)

This would improve:

  • Code readability
  • Maintainability
  • Reusability
  • Testing
🧰 Tools
🪛 Biome

[error] 166-166: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 177-177: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


312-328: Enhance accessibility and simplify responsive classes.

  1. Add ARIA labels for better screen reader support:
-<div className="col-span-1 uppercase sm:text-center md:text-center lg:block lg:text-left">
+<div className="col-span-1 uppercase sm:text-center md:text-center lg:block lg:text-left" role="columnheader" aria-label={t("patients")}>
  1. Consider using Tailwind's responsive modifiers more efficiently:
-<div className="col-span-1 hidden text-left uppercase sm:hidden md:hidden lg:block">
+<div className="col-span-1 hidden lg:block text-left uppercase">

268-276: Improve search input accessibility and responsiveness.

The search input container could benefit from better spacing and accessibility:

 <div className="mt-2 flex w-full flex-col items-center justify-between gap-2 pt-2 xl:flex-row">
   <SearchInput
     name="patient_name"
     value={qParams.patient_name}
     onChange={(e) => updateQuery({ [e.name]: e.value })}
     placeholder={t("search_patient")}
+    aria-label={t("search_patient")}
+    className="w-full xl:w-96"
   />
 </div>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 923a3dc and 768f494.

📒 Files selected for processing (2)
  • .env (1 hunks)
  • src/components/Shifting/ShiftingList.tsx (7 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .env
🧰 Additional context used
🪛 Biome
src/components/Shifting/ShiftingList.tsx

[error] 166-166: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 177-177: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (1)
src/components/Shifting/ShiftingList.tsx (1)

38-45: Well-structured state management!

Good job on improving type safety and state management by using a proper TypeScript interface and adding loading state for async operations.

Comment on lines +166 to +167
{(shift.origin_facility_object || {}).name}
</dd>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use optional chaining for safer property access.

As suggested by static analysis, use optional chaining for safer property access:

-{(shift.origin_facility_object || {}).name}
+{shift.origin_facility_object?.name}

-{(shift.shifting_approving_facility_object || {}).name}
+{shift.shifting_approving_facility_object?.name}

Also applies to: 177-178

🧰 Tools
🪛 Biome

[error] 166-166: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@AnveshNalimela
Copy link
Author

@Nihal The deploy failed due to cache issue of apps folder.the build got failed due to import statements. Could on the issue @rithviknishad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy-Failed Deplyment is not showing preview merge conflict pull requests with merge conflict needs review needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Design the List View in Shifting Page
6 participants