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

Tenant info screen #1388

Closed
wants to merge 5 commits into from
Closed

Tenant info screen #1388

wants to merge 5 commits into from

Conversation

mithunhegde-egov
Copy link

tenant info screen added. on click of setup from info page routes to create tenant screen.

@mithunhegde-egov mithunhegde-egov requested a review from a team as a code owner September 16, 2024 04:42
Copy link
Contributor

coderabbitai bot commented Sep 16, 2024

Walkthrough

Walkthrough

The changes introduce enhancements to the tenant management functionality within the application. A new propsForSandbox array is added to the SandboxCard component for role-based access to sandbox links. Additionally, a configuration object for tenant management is introduced, along with a new route and component for displaying tenant information. The overall structure is organized to facilitate tenant-related operations, including the management of various modules and their features.

Changes

Files Change Summary
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js Added propsForSandbox array for role-based access control to sandbox links.
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js Introduced a new configuration object for tenant management, including metadata and action arrays for managing organizations.
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js Added a new route for tenant management that integrates the TenantInfocard component.
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js Created TenantInfocard component to display tenant-related information with structured layout and conditional rendering.
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/config/tenantInfoConfig.js Defined tenantInfoConfig object to organize tenant management modules and their features, enhancing configuration capabilities.

Possibly related PRs

🐰 In the garden where changes bloom,
New paths for tenants make room.
Cards of info, links to explore,
Roles defined, access galore!
With each new feature, we hop with glee,
A world of management, wild and free! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0e00242 and e6f1745.

Files selected for processing (2)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js

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 generate interesting stats about this repository and render them as a table.
    -- @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.
Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI o1 for code reviews: OpenAI's new o1 model is being tested for generating code suggestions in code reviews.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

Outside diff range and nitpick comments (1)
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js (1)

79-129: LGTM! The new configuration section for tenant management looks good.

The added configuration section follows the same structure as other sections in the file and enhances the application's capability to manage tenant-related operations. The metadata properties provide relevant information, and the action arrays define the necessary operations for creating, viewing, and editing organizations.

To further improve the code, consider adding type definitions for the configuration object. This will enhance type safety and make the code more maintainable. For example:

interface SetupMasterConfig {
  tenantId: string;
  moduleName: string;
  SetupMaster: {
    header: string;
    subHeader?: string;
    module: string;
    active: boolean;
    description: string;
    masterDescription: string;
    actionText: string;
    features?: {
      id: number;
      name: string;
    }[];
    add_organization?: {
      id: number;
      name: string;
    }[];
    view_organization?: {
      id: number; 
      name: string;
    }[];
    edit_organization?: {
      id: number;
      name: string;  
    }[];
  }[];
}

export const setupMasterConfig: SetupMasterConfig = {
  // ...
};
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 17dff87 and 0e00242.

Files selected for processing (5)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/config/tenantInfoConfig.js (1 hunks)
Additional context used
Path-based instructions (5)
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/config/tenantInfoConfig.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js (1)

Pattern **/*.js: check

Additional comments not posted (7)
micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/components/SandboxCard.js (3)

17-25: LGTM!

The propsForSandbox array is correctly defined with the necessary properties for each sandbox link. The roles property is appropriately set to ROLES.SUPERUSER to restrict access to users with the "SUPERUSER" role.


25-25: LGTM!

The filtering of the propsForSandbox array based on user roles is implemented correctly. The Digit.Utils.didEmployeeHasAtleastOneRole method is used appropriately to check if the user has at least one of the required roles for each link. Links without any specified roles are included by default.


47-47: LGTM!

The spreading of the filtered propsForSandbox array into the propsForModuleCard.links array is a clean and concise way to integrate the sandbox links into the existing module card structure.

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/config/tenantInfoConfig.js (1)

1-80: LGTM! The configuration object is well-structured and organized.

The tenantInfoConfig object follows a consistent and organized structure for defining modules and their associated features. This approach offers several benefits:

  • It facilitates easy management and configuration of tenant-related functionalities.
  • It allows for the setup and activation of various modules within the application.
  • It provides a clear and organized representation of the available modules and their associated features.

The use of the SetupMaster array and the structured module objects within it enhances the maintainability and extensibility of the configuration.

Great job on creating a well-designed configuration object!

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js (2)

14-14: LGTM!

The import statement for the TenantInfocard component is correctly added.


58-58: The new route for the tenant info page looks good!

  • The route path ${path}/tenant-management/info follows the existing pattern and is consistent with other routes.
  • The PrivateRoute component is correctly used to restrict access to authenticated users.
  • The TenantInfocard component is correctly rendered for this route.

This new route enhances the tenant management functionality by providing a dedicated page for tenant information, aligning with the PR objective.

micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.js (1)

1-73: LGTM!

The TenantInfocard component is well-structured, follows best practices, and enhances the user experience by providing a clear and organized presentation of tenant management options. The code is clean, readable, and promotes reusability and maintainability.

Some key observations:

  • Effective utilization of React hooks and integration with external libraries for state management and internationalization.
  • Retrieval of necessary data from the URL's search parameters and the current tenant ID.
  • Clean and readable rendering logic with conditional rendering based on the presence of data in the configuration object.
  • Correct implementation of the button click handler to navigate the user to the desired route for creating a new tenant management entry.

Overall, the component integrates well with the existing application architecture and follows best practices for React development.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 16, 2024
nabeelmd-eGov
nabeelmd-eGov previously approved these changes Sep 16, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mithunhegde-egov can u share the screenshot of this screen ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

info screens should be reusable, but here config is not that generic

Copy link
Author

Choose a reason for hiding this comment

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

Screenshot from 2024-09-17 11-24-09

@nabeelmd-eGov nabeelmd-eGov deleted the tenant-info-screen branch October 23, 2024 11:31
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