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

Redesign: Departments page root view #10411

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

Conversation

DonXavierdev
Copy link
Contributor

@DonXavierdev DonXavierdev commented Feb 5, 2025

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

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
    • Improved localization with new language entries for more intuitive prompts and user guidance.
    • Redesigned the organization management interface with an interactive, expandable table view and filtering functionality for a clearer hierarchical display of departments and teams.

@DonXavierdev DonXavierdev requested a review from a team as a code owner February 5, 2025 09:57
Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

This pull request introduces enhancements to both the localization data and the facility organization view. The localization file has new keys added to support enhanced user prompts and actions. The organization component has been refactored from a card-based layout to an expandable table layout, featuring state management for row expansion, toggle functionality, and a filtering input for organization names. These changes align with the redesign requirements for the facility department section.

Changes

File(s) Change Summary
public/locale/en.json Added new localization keys for department/team actions (e.g., add_department_or_team, click, expand_all, filter_by_department_or_team_name, see_details, etc.).
src/pages/Facility/.../FacilityOrganizationIndex.tsx Replaced card layout with an expandable table layout; added state (expandedRows) and functions (toggleRow, getChildren); introduced OrganizationRow and filtering.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Index as FacilityOrganizationIndex
    participant Row as OrganizationRow

    User->>Index: Clicks on a row
    Index->>Index: toggleRow(rowId) updates expandedRows
    Index->>Index: getChildren(parentId) retrieves child organizations
    Index->>Row: Renders expanded child rows
    User->>Index: Enters filter text
    Index->>User: Displays filtered organizations
Loading

Assessment against linked issues

Objective Addressed Explanation
Redesign the root view of facility department section (#10374)

Possibly related PRs

Suggested labels

needs review

Suggested reviewers

  • rithviknishad

Poem

I hopped through the lines of code today,
New keys and rows led my merry way.
Expanding views with a joyful leap,
In a table where secrets gently keep.
A rabbit’s cheer in every display! 🐇✨

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

netlify bot commented Feb 5, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit ceb6af3
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67a518215b22d90008c19274
😎 Deploy Preview https://deploy-preview-10411--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

🧹 Nitpick comments (2)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (2)

93-98: Consider memoizing helper functions for better performance.

The getChildren function could benefit from memoization using useMemo to prevent unnecessary filtering on each render, especially with large datasets.

-const getChildren = (parentId: string) => {
+const getChildren = useMemo(() => (parentId: string) => {
   return data.results.filter((org) => org.parent?.id === parentId);
-};
+}, [data.results]);

99-236: Clean up unnecessary Fragment wrapper.

The Fragment wrapper around the buttons is redundant as it contains only one child element.

-              <>
                {children.length > 0 ? (
                  <>
                    <Button>...</Button>
                    <Button>...</Button>
                  </>
                ) : (
                  <Button>...</Button>
                )}
-              </>

Well-implemented recursive component structure!

The OrganizationRow component effectively handles the hierarchical display of organizations with proper TypeScript types and clean recursion.

🧰 Tools
🪛 Biome (1.9.4)

[error] 173-216: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9273d and a72e33a.

📒 Files selected for processing (2)
  • public/locale/en.json (6 hunks)
  • src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (4 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx

[error] 173-216: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)
🔇 Additional comments (2)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (1)

1-48: Well-structured state management for the table layout!

The addition of expandedRows state and table-related imports aligns well with the redesign from cards to an expandable table layout.

public/locale/en.json (1)

293-294: Well-structured localization keys!

The new translation keys are properly organized and follow the established naming conventions:

  • add_department_or_team
  • click
  • expand_all
  • filter_by_department_or_team_name
  • to_create_a_new_one
  • to_open_manage_users_or_create_more_departments_teams_within_it

Also applies to: 565-566, 948-949, 1019-1020, 2035-2036

Comment on lines +246 to +251
<div className="w-60">
<Input
className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
placeholder={t("filter_by_department_or_team_name")}
></Input>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Implement the filter functionality for the search input.

The search input is present but lacks an onChange handler to filter the organizations.

 <Input
   className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
   placeholder={t("filter_by_department_or_team_name")}
+  onChange={(e) => {
+    const searchTerm = e.target.value.toLowerCase();
+    setFilteredResults(
+      data.results.filter(org => 
+        org.name.toLowerCase().includes(searchTerm)
+      )
+    );
+  }}
 ></Input>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="w-60">
<Input
className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
placeholder={t("filter_by_department_or_team_name")}
></Input>
</div>
<div className="w-60">
<Input
className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
placeholder={t("filter_by_department_or_team_name")}
onChange={(e) => {
const searchTerm = e.target.value.toLowerCase();
setFilteredResults(
data.results.filter(org =>
org.name.toLowerCase().includes(searchTerm)
)
);
}}
></Input>
</div>

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

♻️ Duplicate comments (1)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (1)

248-253: ⚠️ Potential issue

Implement the filter functionality for the search input.

The search input is present but lacks an onChange handler to filter the organizations.

Apply this diff to implement the filtering:

+const [filteredResults, setFilteredResults] = useState(data?.results || []);
 <Input
   className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
   placeholder={t("filter_by_department_or_team_name")}
+  onChange={(e) => {
+    const searchTerm = e.target.value.toLowerCase();
+    setFilteredResults(
+      data.results.filter(org => 
+        org.name.toLowerCase().includes(searchTerm)
+      )
+    );
+  }}
 />

Then update the data source in the table:

-          {data.results
+          {filteredResults
🧹 Nitpick comments (2)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (2)

175-218: Remove unnecessary Fragment wrapper.

The Fragment (<>...</>) is redundant here as it contains conditional rendering.

Apply this diff to simplify the code:

-            {isTopLevel && (
-              <>
-                {children.length > 0 ? (
+            {isTopLevel && children.length > 0 ? (
🧰 Tools
🪛 Biome (1.9.4)

[error] 175-218: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)


101-238: Consider performance optimizations for the OrganizationRow component.

The component could benefit from performance optimizations:

  1. Memoize the component to prevent unnecessary re-renders
  2. Extract toggleAllChildren to the parent component

Apply this diff to optimize the component:

-const OrganizationRow = ({
+const OrganizationRow = React.memo(({
   org,
   expandedRows,
   toggleRow,
   getChildren,
   indent,
 }) => {
   // ... component implementation
-};
+});
🧰 Tools
🪛 Biome (1.9.4)

[error] 175-218: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a72e33a and 2a9f12e.

📒 Files selected for processing (1)
  • src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (4 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx

[error] 175-218: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: OSSAR-Scan
  • GitHub Check: cypress-run (1)
🔇 Additional comments (1)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (1)

42-42: Consider implementing proper pagination.

Setting a high LIMIT (1000) without proper pagination could lead to performance issues with large datasets. Consider implementing server-side pagination with a reasonable page size.

Let's check if there are any existing pagination implementations in the codebase:

@DonXavierdev
Copy link
Contributor Author

@nihal467 Review required

toggleChildren(child.id, expand);
});
};
const shouldExpand = !children.some(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const shouldExpand = !children.some(
const shouldExpand = !children.every(

If user has expanded some and then clicks expand all, it should still expand rather than collapsing.

icon="l-plus"
className="h-4 w-4 sm:h-2 sm:w-2"
/>
{t("expand_all")}
Copy link
Contributor

Choose a reason for hiding this comment

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

display collapse all if everything is expanded

</TableRow>
</TableHeader>
<TableBody>
{data.results
Copy link
Contributor

Choose a reason for hiding this comment

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

For readability - do the filtering earlier and set to a diff variable and use that here.


import Page from "@/components/Common/Page";
import { CardGridSkeleton } from "@/components/Common/SkeletonLoading";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { FacilityOrganization } from "@/types/facilityOrganization/facilityOrganization";

import CreateFacilityOrganizationSheet from "./components/CreateFacilityOrganizationSheet";
Copy link
Contributor

Choose a reason for hiding this comment

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

absolute import

@@ -2027,6 +2032,8 @@
"titrate_dosage": "Titrate Dosage",
"to": "to",
"to_be_conducted": "To be conducted",
"to_create_a_new_one": "to create a new one",
"to_open_manage_users_or_create_more_departments_teams_within_it": "to open manage users or create more departments/teams within it",
Copy link
Contributor

Choose a reason for hiding this comment

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

minor thing, but let's shorten this key 😄

<>
<Button
variant="outline"
className="h-7 shadow-gray-400 border-gray-400 sm:p-2 sm:text-sm text-xs p-1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's override styles, instead write a new variant if necessary.

In this case, white variant fits (not same as figma, but bit more subtle).

Copy link
Contributor

Choose a reason for hiding this comment

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

try xs or sm size for expand/collapse button.

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

github-actions bot commented Feb 6, 2025

Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @DonXavierdev

See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts

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

🧹 Nitpick comments (2)
public/locale/en.json (2)

569-569: Generic "click" Key Consideration
The key "click" (with the value "Click") is very generic. In a large-scale system or where similar actions occur in different contexts, consider using a more descriptive or namespaced key (e.g. "departments_click" if it’s specific to the Departments page) to avoid potential collisions and enhance clarity in translations.


1040-1040: Verbose Filter Key for Departments/Teams
The key "filter_by_department_or_team_name" and its value "Filter by department or team name" are descriptive, but they are on the verbose side. If this key is used frequently in the interface, consider shortening it (for example, "filter_department_team") to simplify usage while still conveying the essential meaning.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2a9f12e and 28b8449.

📒 Files selected for processing (1)
  • public/locale/en.json (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test
  • GitHub Check: OSSAR-Scan
  • GitHub Check: CodeQL-Build
🔇 Additional comments (5)
public/locale/en.json (5)

293-293: Key Naming Consistency for Department/Team Addition
The new key "add_department_or_team" with the value "Add Department/Team" has been introduced. Note that there was previous feedback suggesting to shorten this key. Please confirm if this revised key meets the design conventions and naming consistency for the localization keys.


965-965: "Expand All" Localization Entry
The newly added key "expand_all" with the value "Expand All" clearly supports the functionality for expanding UI sections. The wording is concise and self-explanatory.


1899-1899: Clear "See Details" Localization Entry
The key "see_details" with the value "See Details" is clear and directly communicates its intended action to the user. This addition is straightforward and aligns with the redesigned UI’s needs.


2090-2090: "to_create_a_new_one" Text Verification
The fragment "to create a new one" appears to be used as helper text. Please verify that its grammatical structure and context are correct when it gets concatenated with surrounding text in the UI. Ensuring consistency in style (capitalization and punctuation, if needed) will help maintain clarity.


2091-2091: Lengthy Helper Text for Department/Team Management
The new key "to_open_manage_users_or_create_more_departments_teams_within_it" and its value "to open manage users or create more departments/teams within it" are quite descriptive. Please confirm that the phrasing fits well within the UI context (e.g., tooltips or guidance text) and consider simplifying it if possible. A shorter alternative might enhance readability and ease of translation.

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

🧹 Nitpick comments (5)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (4)

95-100: Consider memoizing helper functions for performance.

The getChildren function could benefit from memoization to avoid unnecessary recalculations, especially with large datasets.

+const memoizedGetChildren = useMemo(() => 
+  (parentId: string) => TableData.filter((org) => org.parent?.id === parentId),
+  [TableData]
+);

176-211: Remove unnecessary Fragment wrapper.

The Fragment is redundant as it contains only one child.

-              <>
                {children.length > 0 ? (
                  <>
                    <Button
                      variant="white"
                      size={"sm"}
                      onClick={toggleAllChildren}
                    >
                      <CareIcon
                        icon={allExpanded ? "l-minus" : "l-plus"}
                        className="h-4 w-4 sm:h-2 sm:w-2"
                      />
                      {t(allExpanded ? "collapse_all" : "expand_all")}
                    </Button>
                    <Button variant="white" size={"sm"} asChild>
                      <Link
                        href={`/departments/${org.id}`}
                        className="text-[#030712] flex items-center"
                      >
                        <CareIcon icon="l-eye" className="h-4 w-4" />
                        {t("see_details")}
                      </Link>
                    </Button>
                  </>
                ) : (
                  <Button variant="white" size={"sm"} asChild>
                    <Link
                      href={`/departments/${org.id}`}
                      className="text-[#030712] flex items-center"
                    >
                      <CareIcon icon="l-eye" className="h-4 w-4" />
                      {t("see_details")}
                    </Link>
                  </Button>
                )}
-              </>
🧰 Tools
🪛 Biome (1.9.4)

[error] 176-211: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)


101-231: Consider using TypeScript interfaces for props.

Define a proper interface for the OrganizationRow component props to improve type safety and documentation.

+interface Organization {
+  id: string;
+  name: string;
+  parent?: { id: string };
+  org_type: string;
+}

+interface OrganizationRowProps {
+  org: Organization;
+  expandedRows: Record<string, boolean>;
+  toggleRow: (id: string) => void;
+  getChildren: (parentId: string) => Organization[];
+  indent: number;
+}

-const OrganizationRow = ({
+const OrganizationRow: React.FC<OrganizationRowProps> = ({
   org,
   expandedRows,
   toggleRow,
   getChildren,
   indent,
-}: {
-  org: {
-    id: string;
-    name: string;
-    parent?: { id: string };
-    org_type: string;
-  };
-  expandedRows: Record<string, boolean>;
-  toggleRow: (id: string) => void;
-  getChildren: (parentId: string) => {
-    id: string;
-    name: string;
-    parent?: { id: string };
-    org_type: string;
-  }[];
-  indent: number;
-})
🧰 Tools
🪛 Biome (1.9.4)

[error] 176-211: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)


268-294: Enhance table accessibility.

Add ARIA labels and roles to improve accessibility for screen readers.

-<Table className="border rounded-lg w-full overflow-hidden">
+<Table 
+  className="border rounded-lg w-full overflow-hidden"
+  aria-label="Organizations table"
+>
   <TableHeader>
     <TableRow>
-      <TableHead className="w-[80%] border text-[#374151] bg-[#f3f4f6]">
+      <TableHead 
+        className="w-[80%] border text-[#374151] bg-[#f3f4f6]"
+        aria-sort="none"
+      >
         {t("name")}
       </TableHead>
-      <TableHead className="bg-[#f3f4f6] text-[#374151]">
+      <TableHead 
+        className="bg-[#f3f4f6] text-[#374151]"
+        aria-sort="none"
+      >
         {t("category")}
       </TableHead>
     </TableRow>
   </TableHeader>
public/locale/en.json (1)

1041-1041: Consider shortening the translation key.

The key filter_by_department_or_team_name is quite long. Consider using a shorter key like filter_departments while maintaining clarity.

-  "filter_by_department_or_team_name": "Filter by department or team name",
+  "filter_departments": "Filter by department or team name",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28b8449 and ceb6af3.

📒 Files selected for processing (2)
  • public/locale/en.json (6 hunks)
  • src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (4 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx

[error] 176-211: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

🔇 Additional comments (2)
src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx (2)

251-267: LGTM! Well-structured informational section.

The info section is well-implemented with clear instructions and proper visual hierarchy.


241-246: ⚠️ Potential issue

Implement the filter functionality for the search input.

The search input is present but lacks an onChange handler to filter the organizations.

 <Input
   className="px-2 placeholder:text-xs placeholder:text-[#4B5563]"
   placeholder={t("filter_by_department_or_team_name")}
+  onChange={(e) => {
+    const searchTerm = e.target.value.toLowerCase();
+    setFilteredResults(
+      TableData.filter(org => 
+        org.name.toLowerCase().includes(searchTerm)
+      )
+    );
+  }}
 ></Input>

Likely invalid or redundant comment.

@github-actions github-actions bot removed the merge conflict pull requests with merge conflict label Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @DonXavierdev

See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required merge conflict pull requests with merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redesign the root view of facility department section
2 participants