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

side bar #1384

Merged
merged 4 commits into from
Sep 12, 2024
Merged

side bar #1384

merged 4 commits into from
Sep 12, 2024

Conversation

mithunhegde-egov
Copy link

@mithunhegde-egov mithunhegde-egov commented Sep 12, 2024

employee side bar checks added for navigation.

@mithunhegde-egov mithunhegde-egov requested a review from a team as a code owner September 12, 2024 08:13
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

Walkthrough

The changes introduced in this pull request enhance navigation functionality within a multi-root tenant environment. Key modifications include the implementation of logic to dynamically adjust URLs in the EmployeeSideBar.js component and updates to the Jurisdiction component to better handle tenant-specific boundaries. These adjustments ensure that the application correctly reflects the current tenant context and improves the responsiveness of the UI to tenant changes.

Changes

File Change Summary
micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js Introduced isMultiRootTenant variable and modified navigateToRespectiveURL to adjust URLs for multi-root tenant context. Minor formatting adjustments made.
micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js Adjusted useEffect dependency on subTenantList and modified optionKey prop to dynamically determine its value based on multi-root tenant condition.

Possibly related PRs

🐇 In the land of code, where rabbits play,
New paths are forged, come what may.
With tenants aplenty, we hop and we bound,
Adjusting our routes, new logic we've found.
So let’s celebrate with a joyful cheer,
For navigation's bright future is finally here! 🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 815f9fa and 6530440.

Files selected for processing (2)
  • micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js (3 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js (2 hunks)
Additional context used
Path-based instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js (1)

Pattern **/*.js: check

Additional comments not posted (5)
micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/EmployeeSideBar.js (3)

11-11: LGTM!

The introduction of the isMultiRootTenant constant aligns with the PR objective of handling navigation URLs based on multi-root tenant environment. The usage of the constant is correct.


14-14: LGTM!

Retrieving the current tenant ID using Digit.ULBService.getCurrentTenantId() aligns with the PR objective of handling navigation URLs based on multi-root tenant environment. The usage of the tenant ID is correct.


89-103: LGTM!

The modifications to the navigateToRespectiveURL function align with the PR objective of handling navigation URLs based on multi-root tenant environment. The logic for adjusting the navigation URL is correct and handles both multi-root tenant and non-multi-root tenant scenarios appropriately. The code changes are well-structured and easy to understand.

micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js (2)

197-197: LGTM!

The change to the useEffect hook's dependency on subTenantList enhances the control flow by ensuring that the selection of boundaries is contingent upon the presence of a multi-root tenant. This potentially improves the component's responsiveness to tenant changes and aligns with the PR objective of adding an employee side bar.


280-280: LGTM!

The modification to the optionKey prop allows for more flexible handling of options based on the tenant context. It dynamically determines the value based on the multi-root tenant condition, which could affect how data is displayed or interacted with in the UI. This change aligns with the PR objective of adding an employee side bar and enhances the component's adaptability to different tenant configurations.

@@ -2,13 +2,16 @@ import React, { useRef, useEffect, useState } from "react";
import { Sidebar, Loader } from "@egovernments/digit-ui-components";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";
import { update } from "lodash";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused import.

The update function imported from the lodash library is not used anywhere in the file. Please remove this import to avoid unnecessary bundle size and potential performance issues.

Apply this diff to remove the unused import:

-import { update } from "lodash";
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
import { update } from "lodash";

nabeelmd-eGov
nabeelmd-eGov previously approved these changes Sep 12, 2024
else{
updatedUrl = DIGIT_UI_CONTEXTS?.every((e) => url?.indexOf(`/${e}`) === -1) ? hostUrl + "/employee/" + url : hostUrl + url;
}
window.location.href = updatedUrl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

we shouldnt do this within sandbox app
history ,push is recommended

Copy link
Contributor

Choose a reason for hiding this comment

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

@mithunhegde-egov the logic should be written for else section this section is working fine

const { t } = useTranslation();
const history = useHistory();
const tenantId = Digit.ULBService.getCurrentTenantId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

use stateid not current tenant id

Copy link
Contributor

Choose a reason for hiding this comment

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

@jagankumar-egov
Copy link
Collaborator

@mithunhegde-egov please check

@jagankumar-egov jagankumar-egov merged commit 082e71c into develop Sep 12, 2024
2 checks passed
@jagankumar-egov jagankumar-egov deleted the sandbox-sidebar branch September 12, 2024 10:04
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.

3 participants