Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

feat: tourism/tms module#6645

Merged
KhBaterdene merged 2 commits intomainfrom
feat/tourism_api/tms_module
Nov 7, 2025
Merged

feat: tourism/tms module#6645
KhBaterdene merged 2 commits intomainfrom
feat/tourism_api/tms_module

Conversation

@tsebaa0310
Copy link
Collaborator

@tsebaa0310 tsebaa0310 commented Nov 7, 2025

Summary by Sourcery

Enhance the TMS branch UI and streamline related data operations

Enhancements:

  • Add BranchImage component with loading spinner and error fallback for branch logos
  • Replace manual Avatar rendering with MembersInline.Avatar in BranchCard
  • Remove deprecated fields (description, paymentTypes, departmentId, and user/manager details) from GraphQL mutations and queries
  • Initialize CreateTmsForm with non-null defaults and enforce array types for member and payment fields
  • Enable multiple-selection mode for GeneralManager and Manager fields in TMS form

Summary by CodeRabbit

  • New Features

    • Multiple selection enabled for General Manager and Manager form fields.
    • Improved branch image handling with lazy-loading visuals, spinner, and fallback icon.
    • Updated branch member avatar display for inline member lists.
  • Bug Fixes

    • More defensive form initialization to handle missing or undefined values.
  • Chores

    • Branch-related data requests simplified to reduce returned fields and payload size.

Important

Enhance TMS module with improved UI components, form handling, and streamlined GraphQL operations.

  • UI Enhancements:
    • Add BranchImage component in BranchCard.tsx with loading spinner and error fallback for branch logos.
    • Replace manual Avatar rendering with MembersInline.Avatar in BranchCard.tsx.
  • Form Handling:
    • Initialize CreateTmsForm in CreateTmsForm.tsx with non-null defaults and enforce array types for member and payment fields.
    • Enable multiple-selection mode for GeneralManager and Manager fields in TmsFormFields.tsx.
  • GraphQL Operations:
    • Remove deprecated fields (description, paymentTypes, departmentId, and user/manager details) from CREATE_BRANCH and EDIT_BRANCH mutations in mutation.ts.
    • Update GET_BRANCH_LIST and BRANCH_LIST_DETAIL queries in queries.ts to remove deprecated fields.

This description was created by Ellipsis for 6d9f624. You can customize this summary. It will automatically update as commits are pushed.

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 7, 2025

Reviewer's Guide

This PR enhances the tourism/tms module by refactoring the branch card UI (adding a loading spinner and MembersInline avatars), streamlining GraphQL operations to remove unused fields, hardening form initialization with safe defaults, enabling multi-select on member fields, and updating hook interfaces accordingly.

Entity relationship diagram for streamlined Branch GraphQL types

erDiagram
    BRANCH {
      string _id
      string createdAt
      string userId
      string name
      string[] generalManagerIds
      string[] managerIds
      string[] paymentIds
      string token
      string erxesAppToken
      JSON permissionConfig
      JSON uiOptions
    }
    BRANCH ||--o{ GENERAL_MANAGER : generalManagerIds
    BRANCH ||--o{ MANAGER : managerIds
    BRANCH ||--o{ PAYMENT : paymentIds
Loading

Class diagram for updated BranchCard and BranchImage components

classDiagram
    class BranchCard {
      +branch: IBranch
      +onEdit: () => void
      +duplicateLoading: boolean
    }
    class BranchImage {
      +logo?: string
      +name?: string
      +imageLoading: boolean
      +imageError: boolean
    }
    BranchCard --> BranchImage : uses
Loading

Class diagram for updated MembersInline usage in BranchCard

classDiagram
    class MembersInline {
      +Provider(memberIds: string[])
      +Avatar(size: string)
    }
    BranchCard --> MembersInline : uses
Loading

File-Level Changes

Change Details Files
BranchCard UI refactor with image loader and MembersInline avatars
  • Imported IconLoader2 and useState
  • Created BranchImage component for loading/error handling
  • Replaced inline and fallback in BranchCard with BranchImage
  • Swapped Avatar usage for MembersInline.Provider and MembersInline.Avatar
components/BranchCard.tsx
Simplify GraphQL mutations and queries by removing unused fields
  • Removed description, paymentTypes, departmentId args and response fields in CREATE_BRANCH and EDIT_BRANCH
  • Stripped nested user, managers, generalManagers and other deprecated fields from queries
graphql/mutation.ts
graphql/queries.ts
Harden form default values in CreateTmsForm
  • Provided fallback literals for name, color, logo, favIcon, payment, token
  • Ensured generalManager, managers, otherPayments use Array.isArray guards
components/CreateTmsForm.tsx
Enable multiple selection for member fields in TmsFormFields
  • Added mode="multiple" to SelectMember.FormItem in GeneralManager
  • Added mode="multiple" to SelectMember.FormItem in Manager
components/TmsFormFields.tsx
Update CreateBranch hook interface to remove deprecated fields
  • Removed description and departmentId from ICreateBranchVariables interface
hooks/CreateBranch.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Refactors branch UI and form fields, adds a BranchImage component with lazy-load/fallback and MembersInline avatar usage, makes form initial values defensive, enables multi-select for manager fields, and removes several fields from branch GraphQL queries/mutations and related types.

Changes

Cohort / File(s) Change Summary
Branch UI refactor
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
Adds an internal BranchImage component (loading state, spinner, error fallback), replaces direct Avatar with MembersInline.Provider + MembersInline.Avatar, adjusts container markup/classes for rounded/overflow handling and lazy image rendering
Form initialization & fields
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx, frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
Initializes form defaults defensively (strings fall back to '', color defaults to #4F46E5, arrays normalize to []); adds mode="multiple" to SelectMember.FormItem for GeneralManager and Manager fields
GraphQL queries & mutations
frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts, frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts
Removes several input variables and response fields (e.g., description, paymentTypes, departmentId, user/manager nested fields, createdAt, various IDs/tokens) from CREATE_BRANCH, EDIT_BRANCH, GET_BRANCH_LIST, and BRANCH_LIST_DETAIL
Hook / types update
frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts
Removes optional fields description?: string and departmentId?: string from ICreateBranchVariables interface

Sequence Diagram(s)

sequenceDiagram
  participant BranchCard
  participant BranchImage
  participant ImageServer as Image resource
  participant MembersInline

  rect rgb(230,245,255)
    BranchCard->>BranchImage: render with `logo` prop
    BranchImage->>ImageServer: request image (lazy)
    alt image loads successfully
      ImageServer-->>BranchImage: 200 + image
      BranchImage-->>BranchCard: render image (loaded)
    else image fails / missing
      ImageServer--xBranchImage: error / 404
      BranchImage-->>BranchCard: render fallback (placeholder)
    end
  end

  rect rgb(245,255,235)
    BranchCard->>MembersInline: provide members list
    MembersInline-->>BranchCard: render Avatars (inline)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • BranchImage loading/error state and its CSS/layout integration inside the rounded container.
    • Places elsewhere in the codebase that may still reference removed GraphQL fields (queries, responses, or type assumptions).
    • Form defaults aligning with backend validation and expected types.

Possibly related PRs

  • fix: update tourism #6624 — Backend schema/resolver changes touching manager/generalManager fields; likely coordinated with these frontend removals of manager/user nested fields.

Poem

🐰 I nibbled code by moonlight's beam,
A branch now loads with spinner gleam,
Avatars hop in tidy rows,
Defaults set where wild wind blows,
Slimmed queries hum—oh what a dream! 🎋

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat: tourism/tms module' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes. Consider a more specific title that highlights the primary change, such as 'feat: enhance TMS branch UI with image loading and simplify GraphQL fields' or focus on the main feature being added.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/tourism_api/tms_module

📜 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 39a34f2 and 6d9f624.

📒 Files selected for processing (1)
  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
🧠 Learnings (4)
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to **/*.tsx : Implement lazy loading for images

Applied to files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to **/*.{ts,tsx} : Always use absolute paths for imports

Applied to files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to {components,utils,contexts,hooks,types}/**/*.{ts,tsx} : Organize code under directories: components, utils, contexts, hooks, types

Applied to files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to **/*.tsx : Include explicit width and height (or sizes) when rendering images

Applied to files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (4)
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (4)

6-6: Past review comment addressed.

The ActionMenu import now correctly uses an absolute path per coding guidelines.


17-53: Well-implemented image component with proper lazy loading.

The BranchImage component correctly addresses the past review comment by including loading="lazy" and explicit dimensions. The loading and error states provide good UX, and the implementation follows the functional programming patterns from the guidelines.


82-84: Clean integration of BranchImage component.

The logo rendering correctly utilizes the new BranchImage component with proper prop passing and container styling.


101-103: LGTM: MembersInline compound component pattern.

The replacement of direct Avatar usage with MembersInline.Provider/Avatar follows good composition patterns and maintains the intended functionality.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider using a shared GraphQL fragment for branch fields across CREATE_BRANCH, EDIT_BRANCH, and GET_BRANCH_LIST to reduce duplication and ensure selection sets stay in sync.
  • The defaultValues in CreateTmsForm include repetitive array type checks—consider normalizing formData earlier or extracting a helper to simplify that logic.
  • The new BranchImage component is useful—consider moving it to a shared UI folder or adding configurable props (e.g. className or size) for reuse elsewhere.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider using a shared GraphQL fragment for branch fields across CREATE_BRANCH, EDIT_BRANCH, and GET_BRANCH_LIST to reduce duplication and ensure selection sets stay in sync.
- The defaultValues in CreateTmsForm include repetitive array type checks—consider normalizing formData earlier or extracting a helper to simplify that logic.
- The new BranchImage component is useful—consider moving it to a shared UI folder or adding configurable props (e.g. className or size) for reuse elsewhere.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 39a34f2 in 55 seconds. Click for details.
  • Reviewed 364 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx:17
  • Draft comment:
    Good use of a new BranchImage component to handle loading and error states. Verify that the alt text fallback meets accessibility requirements.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
2. frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx:98
  • Draft comment:
    Using MembersInline.Provider for avatars is concise; ensure branch.userId is always defined.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
3. frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx:47
  • Draft comment:
    Default values now include fallbacks (e.g. '' and '#4F46E5') to prevent undefined issues. Confirm these defaults align with backend expectations.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
4. frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx:272
  • Draft comment:
    Added mode="multiple" to the GeneralManager field to enable multi-selection. Ensure the form data is always an array.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
5. frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx:300
  • Draft comment:
    Added mode="multiple" to the Manager field for multi-select support. Confirm the expected array type for this field.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
6. frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts:5
  • Draft comment:
    Deprecated fields (description, paymentTypes, departmentId) have been removed from mutations. Ensure these changes match the backend schema.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 30% <= threshold 50% The comment is asking the author to ensure that the changes match the backend schema, which is a form of asking for confirmation or verification. This violates the rule against asking the PR author to confirm or ensure things. However, it does point out that deprecated fields have been removed, which could be useful information if it were rephrased as a suggestion or observation rather than a request for confirmation.
7. frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts:23
  • Draft comment:
    User details and extra fields have been removed from branch queries. Verify that UI components depending on this data are updated accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that UI components are updated, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue with the code.
8. frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts:9
  • Draft comment:
    Removed 'description' and 'departmentId' fields from CreateBranch variables to align with the updated mutation. Confirm that form data handling remains consistent.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to confirm that the form data handling remains consistent after removing certain fields. This falls under asking the author to ensure behavior is intended, which is against the rules.

Workflow ID: wflow_dc90R0BCni9buII4

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb3be1 and 39a34f2.

📒 Files selected for processing (6)
  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (4 hunks)
  • frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (1 hunks)
  • frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (2 hunks)
  • frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (0 hunks)
  • frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (0 hunks)
  • frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts (0 hunks)
💤 Files with no reviewable changes (3)
  • frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts
  • frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts
  • frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Write concise, technical TypeScript code
Use functional and declarative programming patterns; avoid classes
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Avoid console logs
Always use absolute paths for imports
Use TypeScript for all code (no .js/.jsx)
Prefer interfaces over types for object shapes
Avoid enums; use maps instead
Use the function keyword for pure functions
Avoid unnecessary curly braces in simple conditionals; use concise syntax

Files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx
  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
  • frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use declarative JSX
Use Shadcn UI, Radix UI, and Tailwind for components and styling
Implement responsive, mobile-first design with Tailwind CSS
Minimize useEffect and setState usage
Wrap client components in React.Suspense with a fallback
Use dynamic loading for non-critical components
Include explicit width and height (or sizes) when rendering images
Implement lazy loading for images
Limit 'use client': favor server components and Next.js SSR
Use 'use client' only for Web API access in small components
Do not use 'use client' components for data fetching or state management

Files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx
  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
  • frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
🧠 Learnings (1)
📚 Learning: 2025-10-07T04:35:24.836Z
Learnt from: CR
Repo: erxes/erxes PR: 0
File: .cursorrules:0-0
Timestamp: 2025-10-07T04:35:24.836Z
Learning: Applies to **/*.tsx : Implement lazy loading for images

Applied to files:

  • frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
⏰ 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: Sourcery review
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (1)

254-284: LGTM! Multi-select mode properly enables multiple manager selection.

The addition of mode="multiple" to both GeneralManager and Manager components is consistent with their plural field names and array-based default values, enabling proper multi-select behavior.

Also applies to: 286-311

frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (1)

46-60: LGTM! Defensive initialization properly guards against undefined formData.

The defensive checks ensure safe fallback values:

  • Array.isArray() checks prevent runtime errors when passing non-arrays to multi-select fields
  • String fallbacks with || '' provide sensible defaults

This pattern is consistent with the useEffect handling at lines 76-102.

frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (2)

79-81: LGTM!

The BranchImage component integration is well-implemented with proper optional chaining for the logo property and appropriate container styling.


98-100: Resolve: userId is guaranteed to be defined.

The IBranch.userId field is defined as a required, non-optional string type in frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (line 15). TypeScript's type system ensures that branch.userId is always a string, making the code at lines 98-100 safe and correct as written. No defensive handling is needed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 6d9f624 in 51 seconds. Click for details.
  • Reviewed 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx:6
  • Draft comment:
    Changed import path for ActionMenu. Ensure the alias '@/tms/components/ActionMenu' is correctly configured in tsconfig and build settings.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx:42
  • Draft comment:
    Added 'loading', 'width', and 'height' attributes for the element. Verify that fixed dimensions (290x150) align with responsive design requirements.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_DrZAu5HCm84oXM4M

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

@KhBaterdene KhBaterdene merged commit ef29382 into main Nov 7, 2025
9 of 10 checks passed
@KhBaterdene KhBaterdene deleted the feat/tourism_api/tms_module branch November 7, 2025 04:57
This was referenced Nov 7, 2025
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