-
Notifications
You must be signed in to change notification settings - Fork 3
new tourism ui #268
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
base: main
Are you sure you want to change the base?
new tourism ui #268
Conversation
Reviewer's GuideThis PR overhauls the tourism UI by refactoring the branch management screens into reusable components and dialogs, rebuilding the TMS form as a multistep wizard with live preview/edit support, and upgrading GraphQL operations and hooks to support pagination, detail fetching, and mutations with refetch logic. Sequence diagram for branch duplication and deletion with confirmation dialogssequenceDiagram
actor User
participant BranchList as BranchList
participant ConfirmationDialog as ConfirmationDialog
participant useBranchDuplicate as useBranchDuplicate
participant useBranchRemove as useBranchRemove
participant toast as Toast
participant refetch as Refetch
User->>BranchList: Clicks 'Duplicate' or 'Delete' on a branch
BranchList->>ConfirmationDialog: Opens dialog (duplicate/delete)
User->>ConfirmationDialog: Confirms action
alt Duplicate
ConfirmationDialog->>useBranchDuplicate: duplicateBranch()
useBranchDuplicate-->>Toast: Show success/failure
useBranchDuplicate-->>Refetch: Refetch branch list
else Delete
ConfirmationDialog->>useBranchRemove: removeBranchById()
useBranchRemove-->>Toast: Show success/failure
useBranchRemove-->>Refetch: Refetch branch list
end
Class diagram for updated TmsFormType and related form fieldsclassDiagram
class TmsFormType {
+string name
+string color
+string? logo
+string? favIcon
+string[]? generalManager
+string[]? managers
+string? payment
+string? token
+OtherPayment[] otherPayments
}
class OtherPayment {
+string type
+string title
+string icon
+string? config
}
TmsFormType "1" o-- "*" OtherPayment : otherPayments
Class diagram for new and refactored TMS branch management hooks and componentsclassDiagram
class BranchList {
+list: IBranch[]
+totalCount: number
+pageInfo: PageInfo
+refetch()
}
class useBranchList
class useBranchDetail
class useBranchEdit
class useBranchDuplicate
class useBranchRemove
class BranchCard
class ConfirmationDialog
class ActionMenu
class AddPaymentDialog
class TmsInformationFields
class currentStepAtom
useBranchList <|-- BranchList
useBranchDetail <|-- BranchCard
useBranchEdit <|-- BranchCard
useBranchDuplicate <|-- BranchCard
useBranchRemove <|-- BranchCard
BranchCard o-- ActionMenu
BranchCard o-- ConfirmationDialog
BranchCard o-- AddPaymentDialog
TmsInformationFields o-- currentStepAtom
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
""" WalkthroughThis update introduces significant enhancements and refactoring to the Tourism Management System (TMS) module. Key changes include new and refactored React components for branch management, payment dialogs, and confirmation modals; improved form validation and UI consistency; new and updated GraphQL queries and mutations with stronger typing; and the addition of cursor-based pagination. Several hooks were added or refactored for branch operations, and configuration, state management, and routing were updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BranchList
participant BranchCard
participant ConfirmationDialog
participant useBranchDuplicate
participant useBranchEdit
participant useBranchRemove
participant useBranchDetail
participant GraphQL
User->>BranchList: View branches
BranchList->>BranchCard: Render each branch (with actions)
User->>BranchCard: Click "Duplicate" or "Delete"
BranchCard->>ConfirmationDialog: Open dialog for confirmation
User->>ConfirmationDialog: Confirm action
alt Duplicate
ConfirmationDialog->>useBranchDuplicate: duplicateBranch()
useBranchDuplicate->>GraphQL: CREATE_BRANCH mutation
GraphQL-->>useBranchDuplicate: Response
useBranchDuplicate-->>BranchList: Refetch list
else Delete
ConfirmationDialog->>useBranchRemove: removeBranchById()
useBranchRemove->>GraphQL: REMOVE_BRANCH mutation
GraphQL-->>useBranchRemove: Response
useBranchRemove-->>BranchList: Refetch list
end
sequenceDiagram
participant User
participant CreateTmsForm
participant useBranchCreate
participant useBranchEdit
participant useBranchDetail
participant GraphQL
User->>CreateTmsForm: Open form (create or edit)
alt Edit mode
CreateTmsForm->>useBranchDetail: Fetch branch details
useBranchDetail->>GraphQL: BRANCH_LIST_DETAIL query
GraphQL-->>useBranchDetail: Branch data
useBranchDetail-->>CreateTmsForm: Populate form
end
User->>CreateTmsForm: Submit form
alt Create
CreateTmsForm->>useBranchCreate: createBranch()
useBranchCreate->>GraphQL: CREATE_BRANCH mutation
GraphQL-->>useBranchCreate: Response
else Edit
CreateTmsForm->>useBranchEdit: editBranch()
useBranchEdit->>GraphQL: EDIT_BRANCH mutation
GraphQL-->>useBranchEdit: Response
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150 minutes Possibly related PRs
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tsebaa0310 - I've reviewed your changes - here's some feedback:
- Extract the repeated default pagination limit (currently hard-coded as 10) into a shared constant or configuration instead of sprinkling magic numbers across multiple hooks.
- Using a global jotai atom for
currentStepin TmsInformationFields risks leaking step state across multiple form instances—consider switching to component-local state to keep the wizard step encapsulated.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the repeated default pagination limit (currently hard-coded as 10) into a shared constant or configuration instead of sprinkling magic numbers across multiple hooks.
- Using a global jotai atom for `currentStep` in TmsInformationFields risks leaking step state across multiple form instances—consider switching to component-local state to keep the wizard step encapsulated.
## Individual Comments
### Comment 1
<location> `frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx:32` </location>
<code_context>
}
};
- useEffect(() => {
- const handleClickOutside = (event: MouseEvent) => {
- if (menuRef.current && !menuRef.current.contains(event.target as Node)) {
</code_context>
<issue_to_address>
Resetting currentStep on isOpen may cause unexpected step jumps.
Resetting currentStep to 1 on every isOpen change may cause the stepper to restart unexpectedly if isOpen is toggled often. Confirm if this behavior is intentional.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| useEffect(() => { | ||
| if (isOpen) setCurrentStep(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (bug_risk): Resetting currentStep on isOpen may cause unexpected step jumps.
Resetting currentStep to 1 on every isOpen change may cause the stepper to restart unexpectedly if isOpen is toggled often. Confirm if this behavior is intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 3f37e04 in 2 minutes and 22 seconds. Click for details.
- Reviewed
3007lines of code in32files - Skipped
1files when reviewing. - Skipped posting
6draft 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/AddPaymentDialog.tsx:9
- Draft comment:
Remove or address the TODO comment before production. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the TODO indicates incomplete functionality, commenting on TODOs is not particularly actionable or helpful. The author likely knows they need to implement the functionality. This seems more like a work-in-progress marker than a code issue. The rules state we should only keep comments that require clear code changes. The TODO could indicate a serious issue if this code is meant for immediate production deployment. The missing functionality could be a critical oversight. Without more context about the PR's purpose or deployment timeline, we can't assume this is a critical issue. The TODO likely serves as a reminder for planned work. Delete the comment. Pointing out TODOs is not actionable feedback and the author is likely aware of the pending work.
2. frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts:18
- Draft comment:
Consider removing legacy fields 'user1Ids' and 'user2Ids' if they are no longer used. - Reason this comment was not posted:
Comment was on unchanged code.
3. frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx:85
- Draft comment:
Consider abstracting the debouncing logic into a custom hook to simplify the component. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The debouncing logic is relatively straightforward and contained. While extracting it to a hook could improve reusability, the current implementation is clear and the debouncing logic is specific to this URL preview use case. The suggestion is valid but not critical enough to warrant a comment. The debouncing pattern is common in React and having it as a reusable hook could benefit other parts of the codebase. The current implementation could be duplicated elsewhere. While reusability is good, this is a specialized use case for URL preview. The current implementation is clean and the benefit of extraction is not significant enough to justify a comment. While the suggestion is technically valid, it's not important enough to warrant a comment. The current implementation is clear and functional.
4. frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx:310
- Draft comment:
There's an extra space before the question mark in the description text. Consider changing "What is erxes app token ?" to "What is erxes app token?". - Reason this comment was not posted:
Comment was on unchanged code.
5. frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx:142
- Draft comment:
There's an inconsistency in the phrasing of the step descriptions: for step 1 it uses "Set up your TMS information" (two words) while for steps 2 and 3 it uses "Setup your permission/payments" (one word). Consider making the wording consistent across all steps. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment is about UI text consistency, not about logic. The rules specifically state "Do NOT comment on any pure frontend UI or styling changes, only logic." While text consistency is good, this is a UI concern that should be handled by the frontend team or style guide. Text inconsistencies could potentially confuse users and maintaining consistent language is part of good software engineering practice. While text consistency is important, the rules explicitly tell us to trust the author on UI decisions and to only focus on logic issues. This is a UI text change that doesn't affect functionality. The comment should be deleted as it violates the rule about not commenting on UI changes.
6. frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts:24
- Draft comment:
Typo suggestion: In the UI options, the property 'favIcon' might be intended to be 'favicon' (all lowercase), which is the common convention. Please confirm if this camel-casing is intentional. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment points out a common convention, this is likely an API interface that needs to match a backend contract. The casing could be intentional to match the API. Without seeing the backend code, we can't be sure this is actually wrong. The comment is also asking for confirmation rather than making a clear assertion. The casing could be causing real issues if it needs to match some standard browser or framework convention. Maybe this isn't just about style. Even if there is a standard convention, this interface likely needs to match an existing API contract. Making assumptions about naming without seeing the full context could lead to breaking changes. Delete the comment. It's speculative, asks for confirmation rather than making a clear assertion, and could be intentionally matching an API contract we can't see.
Workflow ID: wflow_3t9JTA2cjg1CEWJM
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| <PmsFormFieldsLayout> | ||
| <Heading>Logo and favicon</Heading> | ||
| <div className="xl:grid grid-cols-3"> | ||
| <div className="grid-cols-3 xl:grid"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding the 'grid' class before 'grid-cols-3' to ensure the container is set to display grid.
| <div className="grid-cols-3 xl:grid"> | |
| <div className="grid grid-cols-3 xl:grid"> |
| type="button" | ||
| className="absolute top-2 right-2 p-0 w-5 h-5 rounded-full opacity-80 transition-opacity hover:opacity-100" | ||
| onClick={() => { | ||
| console.log('LogoField - Delete button clicked'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove debug console.log statements from the LogoField delete handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 16
🔭 Outside diff range comments (3)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsx (1)
49-49: Remove console.log statement.The console.log usage violates the coding guidelines which specify "Avoid console logs." Please replace this with proper event handling or remove it entirely.
- onChange={(values: MultiSelectOption[]) => console.log(values)} + onChange={(values: MultiSelectOption[]) => field.onChange(values)}frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx (1)
19-70: Add missing key prop to mapped elements.Each element in the map should have a unique key prop for optimal React rendering performance.
- {fields.map((field, index) => ( - <div className="flex items-end gap-6"> + {fields.map((field, index) => ( + <div key={field.id || index} className="flex items-end gap-6">frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (1)
226-226: Use named export for componentAccording to the coding guidelines, favor named exports for components.
-export default CreateTmsForm; +export { CreateTmsForm };
🧹 Nitpick comments (12)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (1)
11-18: Consider making refetch variables configurable.The hardcoded
limit: 10in refetchQueries might not align with the current pagination state. Consider accepting pagination parameters to ensure consistency with the current list view.-export const useBranchRemove = () => { +export const useBranchRemove = (refetchVariables?: { limit?: number }) => { const [removeBranch, { loading }] = useMutation< IBranchRemoveResponse, IBranchRemoveVariables >(REMOVE_BRANCH, { refetchQueries: [ { query: GET_BRANCH_LIST, variables: { - limit: 10, + limit: refetchVariables?.limit ?? 10, }, }, ],frontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsx (1)
9-10: Address the TODO comment - critical functionality missing.The component lacks essential form functionality including state management, validation, and submission handling.
Do you want me to generate a complete implementation with form handling, validation, and submission logic?
frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx (2)
27-31: Consider removing React.FC type annotation.Modern React TypeScript practices favor direct function typing over React.FC for better type inference and flexibility.
-const PaymentIcon: React.FC<PaymentIconProps> = ({ +function PaymentIcon({ iconType, size = 16, className = '', -}) => { +}: PaymentIconProps) {
44-44: Use theme-based colors instead of hardcoded Tailwind classes.Consider using CSS custom properties or theme variables for brand colors to maintain consistency with the design system.
case 'visa': return ( - <IconBrandVisa size={size} className={`text-blue-600 ${className}`} /> + <IconBrandVisa size={size} className={`text-primary ${className}`} /> ); case 'mastercard': return ( <IconBrandMastercard size={size} - className={`text-red-600 ${className}`} + className={`text-destructive ${className}`} /> );Also applies to: 48-51
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
56-61: Implement missing "Visit website" functionality.The "Visit website" action is rendered but has no click handler, making it non-functional.
Would you like me to help implement the visit website functionality or should this be tracked in a separate issue?
- <div className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted"> + <div + className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted" + onClick={onVisitWebsite} + >frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.ts (1)
48-50: Consider making the refetch limit dynamic.The hardcoded limit of 10 might not match the actual limit used in components, potentially causing UI inconsistencies.
- variables: { - limit: 10, - }, + variables: { + limit: 10, // TODO: Make this configurable or match component usage + },frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (1)
90-97: Consider using CSS classes instead of inline styles.The button uses inline styles for backgroundColor which could be replaced with CSS custom properties or classes for better maintainability.
- <button - type="button" - disabled - className="px-4 py-1.5 mt-5.5 w-full text-sm text-white rounded-md sm:text-base" - style={{ backgroundColor: themeColor }} - > + <button + type="button" + disabled + className="px-4 py-1.5 mt-5.5 w-full text-sm text-white rounded-md sm:text-base" + style={{ '--button-bg': themeColor, backgroundColor: 'var(--button-bg)' } as React.CSSProperties} + >frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (2)
1-6: Consider using absolute import for erxes-ui components.The import on line 5 uses a bare module specifier. If
erxes-uiis an internal library, consider using an absolute path like@/libs/erxes-uifor consistency with other imports.
87-87: Add missing semicolon for consistency.-} +};frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx (1)
17-34: Consider avoiding useEffect for better adherence to coding guidelines.The coding guidelines specify to minimize
useEffect. The reset logic could be handled differently:-import { useEffect } from 'react'; export const TmsInformationFields = ({ form, onOpenChange, onSubmit, isOpen, }: { form: UseFormReturn<TmsFormType>; onOpenChange?: (open: boolean) => void; onSubmit?: (data: TmsFormType) => void; isOpen?: boolean; }) => { - const [currentStep, setCurrentStep] = useAtom(currentStepAtom); - - useEffect(() => { - if (isOpen) setCurrentStep(1); - }, [isOpen, setCurrentStep]); + const [currentStep, setCurrentStep] = useAtom(currentStepAtom); + + // Reset step when opening - handle in parent component or through atom reset + if (isOpen && currentStep !== 1) { + setCurrentStep(1); + }Alternatively, handle the reset in the parent component that controls
isOpen.frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts (1)
39-48: Consider making the refetch limit configurable.The hardcoded limit of 10 in refetchQueries might not match the actual list size displayed to users. Consider:
-export const useCreateBranch = () => { +export const useCreateBranch = (refetchLimit = 10) => { const [createBranchMutation, { loading, error }] = useMutation< CreateBranchResponse, ICreateBranchVariables >(CREATE_BRANCH, { refetchQueries: [ { query: GET_BRANCH_LIST, variables: { - limit: 10, + limit: refetchLimit, }, }, ], });This allows callers to specify the appropriate limit based on their UI needs.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts (1)
17-17: Consider using a more specific type for paymentTypesThe
paymentTypesfield usesany[]which reduces type safety. Consider defining a proper interface for payment types.- paymentTypes?: any[]; + paymentTypes?: Array<{ type: string; [key: string]: unknown }>;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
frontend/plugins/tourism_ui/src/assets/images/tourism-empty-state.jpgis excluded by!**/*.jpg
📒 Files selected for processing (32)
frontend/plugins/tourism_ui/src/config.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx(2 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx(2 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsx(2 hunks)frontend/plugins/tourism_ui/src/modules/tms/Main.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/Settings.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/Preview.tsx(0 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx(19 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx(2 hunks)frontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts(3 hunks)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts(2 hunks)frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts(3 hunks)frontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.ts(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts(1 hunks)frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx(1 hunks)frontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsx(1 hunks)frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx(1 hunks)
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx}: Use functional and declarative programming patterns; avoid classes.
Use TypeScript for all code; prefer interfaces over types.
Avoid enums; use maps instead.
Files:
frontend/plugins/tourism_ui/src/modules/tms/types/branch.tsfrontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.tsfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.tsfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.tsfrontend/plugins/tourism_ui/src/config.tsfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.tsfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.tsfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.tsfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.tsfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.tsfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.tsfrontend/plugins/tourism_ui/src/modules/tms/graphql/queries.tsfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Avoid console logs.
Always use absolute paths when importing.
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
Use absolute path when import.
Files:
frontend/plugins/tourism_ui/src/modules/tms/types/branch.tsfrontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.tsfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.tsfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.tsfrontend/plugins/tourism_ui/src/config.tsfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.tsfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.tsfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.tsfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.tsfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.tsfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.tsfrontend/plugins/tourism_ui/src/modules/tms/graphql/queries.tsfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{tsx,jsx}: Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
**/*.{tsx,jsx}: Structure files: exported component, subcomponents, helpers, static content, types.
Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.tsx
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.tsx: Use functional components with TypeScript interfaces.
Minimize 'useEffect', and 'setState'.
Wrap client components in Suspense with fallback.
Use dynamic loading for non-critical components.
Limit 'use client': Favor server components and Next.js SSR. Use only for Web API access in small components. Avoid for data fetching or state management.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{webp,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
Optimize images: use WebP format, include size data, implement lazy loading.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
🧠 Learnings (24)
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx (6)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use absolute path when import.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use absolute paths when importing.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use absolute path when import.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use absolute paths when importing.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
frontend/plugins/tourism_ui/src/modules/tms/Settings.tsx (9)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use declarative JSX.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use declarative JSX.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
frontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.ts (1)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
frontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/Main.tsx (11)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Follow Next.js docs for Data Fetching, Rendering, and Routing.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx} : Use functional and declarative programming patterns; avoid classes.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx} : Use functional and declarative programming patterns; avoid classes.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.ts (1)
Learnt from: Wlkr123
PR: #238
File: frontend/core-ui/src/modules/automations/utils/AutomationFormDefinitions.tsx:28-43
Timestamp: 2025-06-24T05:29:39.065Z
Learning: In automation form validation, the user prefers user-friendly error messages that use business terminology (like "segment") rather than technical field names (like "contentId") to improve user experience and understanding.
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx (3)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx (1)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx (6)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (7)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
🧬 Code Graph Analysis (8)
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx (1)
frontend/libs/erxes-ui/src/components/sheet.tsx (1)
Sheet(176-186)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts (3)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
BRANCH_LIST_DETAIL(55-84)backend/core-api/src/modules/organization/structure/graphql/resolvers/queries/branches.ts (1)
branchDetail(59-61)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (3)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (2)
IBranchRemoveResponse(34-36)IBranchRemoveVariables(30-32)frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (1)
REMOVE_BRANCH(115-119)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (3)
frontend/libs/erxes-ui/src/utils/core.ts (1)
readImage(4-46)frontend/libs/erxes-ui/src/components/select.tsx (1)
Select(147-158)frontend/libs/erxes-ui/src/components/input.tsx (1)
Input(93-95)
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
frontend/libs/erxes-ui/src/components/popover.tsx (1)
Popover(50-55)
frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts (2)
frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (1)
CREATE_BRANCH(3-56)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts (2)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts (1)
useBranchList(20-36)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (1)
useBranchRemove(6-37)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.ts (1)
useBranchDuplicate(40-67)frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/libs/erxes-ui/src/hooks/use-toast.tsx (1)
toast(140-167)frontend/libs/erxes-ui/src/components/spinner.tsx (1)
Spinner(41-52)frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx (1)
EmptyList(3-32)frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (1)
BranchCard(16-87)frontend/libs/erxes-ui/src/components/sheet.tsx (1)
Sheet(176-186)frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx (1)
ConfirmationDialog(13-83)
🪛 Biome (1.9.4)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx
[error] 20-20: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
💤 Files with no reviewable changes (1)
- frontend/plugins/tourism_ui/src/modules/tms/components/Preview.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx}: Use functional and declarative programming patterns; avoid classes.
Use TypeScript for all code; prefer interfaces over types.
Avoid enums; use maps instead.
Files:
frontend/plugins/tourism_ui/src/modules/tms/types/branch.tsfrontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.tsfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.tsfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.tsfrontend/plugins/tourism_ui/src/config.tsfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.tsfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.tsfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.tsfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.tsfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.tsfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.tsfrontend/plugins/tourism_ui/src/modules/tms/graphql/queries.tsfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Avoid console logs.
Always use absolute paths when importing.
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
Use absolute path when import.
Files:
frontend/plugins/tourism_ui/src/modules/tms/types/branch.tsfrontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.tsfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.tsfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.tsfrontend/plugins/tourism_ui/src/config.tsfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.tsfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.tsfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.tsfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.tsfrontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.tsfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.tsfrontend/plugins/tourism_ui/src/modules/tms/graphql/queries.tsfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{tsx,jsx}: Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
**/*.{tsx,jsx}: Structure files: exported component, subcomponents, helpers, static content, types.
Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.tsx
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.tsx: Use functional components with TypeScript interfaces.
Minimize 'useEffect', and 'setState'.
Wrap client components in Suspense with fallback.
Use dynamic loading for non-critical components.
Limit 'use client': Favor server components and Next.js SSR. Use only for Web API access in small components. Avoid for data fetching or state management.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
**/*.{webp,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
Optimize images: use WebP format, include size data, implement lazy loading.
Files:
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsxfrontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/Settings.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/Main.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsxfrontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
🧠 Learnings (24)
frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx (6)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use absolute path when import.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use absolute paths when importing.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use absolute path when import.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use absolute paths when importing.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
frontend/plugins/tourism_ui/src/modules/tms/Settings.tsx (9)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use declarative JSX.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use declarative JSX.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
frontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.ts (1)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
frontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/Main.tsx (11)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Follow Next.js docs for Data Fetching, Rendering, and Routing.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{ts,tsx} : Use functional and declarative programming patterns; avoid classes.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{ts,tsx} : Use functional and declarative programming patterns; avoid classes.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (4)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
frontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.ts (1)
Learnt from: Wlkr123
PR: #238
File: frontend/core-ui/src/modules/automations/utils/AutomationFormDefinitions.tsx:28-43
Timestamp: 2025-06-24T05:29:39.065Z
Learning: In automation form validation, the user prefers user-friendly error messages that use business terminology (like "segment") rather than technical field names (like "contentId") to improve user experience and understanding.
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx (3)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx (1)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx (6)
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (7)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.697Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.192Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
🧬 Code Graph Analysis (8)
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx (1)
frontend/libs/erxes-ui/src/components/sheet.tsx (1)
Sheet(176-186)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts (3)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
BRANCH_LIST_DETAIL(55-84)backend/core-api/src/modules/organization/structure/graphql/resolvers/queries/branches.ts (1)
branchDetail(59-61)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (3)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (2)
IBranchRemoveResponse(34-36)IBranchRemoveVariables(30-32)frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (1)
REMOVE_BRANCH(115-119)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (3)
frontend/libs/erxes-ui/src/utils/core.ts (1)
readImage(4-46)frontend/libs/erxes-ui/src/components/select.tsx (1)
Select(147-158)frontend/libs/erxes-ui/src/components/input.tsx (1)
Input(93-95)
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
frontend/libs/erxes-ui/src/components/popover.tsx (1)
Popover(50-55)
frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts (2)
frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (1)
CREATE_BRANCH(3-56)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts (2)
frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
GET_BRANCH_LIST(3-53)
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts (1)
useBranchList(20-36)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (1)
useBranchRemove(6-37)frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.ts (1)
useBranchDuplicate(40-67)frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
IBranch(11-28)frontend/libs/erxes-ui/src/hooks/use-toast.tsx (1)
toast(140-167)frontend/libs/erxes-ui/src/components/spinner.tsx (1)
Spinner(41-52)frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx (1)
EmptyList(3-32)frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (1)
BranchCard(16-87)frontend/libs/erxes-ui/src/components/sheet.tsx (1)
Sheet(176-186)frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx (1)
ConfirmationDialog(13-83)
🪛 Biome (1.9.4)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx
[error] 20-20: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
⏰ 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 (45)
frontend/plugins/tourism_ui/src/modules/tms/Settings.tsx (1)
1-9: Convert to a typed, named functional component and drop ineffective Tailwind classCurrent implementation violates several repo guidelines:
•.tsxcomponents should be typed and use thefunctionkeyword.
• Prefer named exports over a default export.
•justify-centerhas no effect on an<h1>that is not a flex/grid container.Proposed fix:
-import React from 'react'; // not required with the new JSX runtime but kept for clarity -const Settings = () => { +import { type FC } from 'react'; + +export function Settings(): JSX.Element { return ( - <div> - <h1 className="text-center justify-center">Tms Settings</h1> + <div className="flex justify-center"> + <h1 className="text-center">Tms Settings</h1> </div> ); -}; - -export default Settings; +}This aligns with the coding guidelines (typed
function, named export, Tailwind classes that actually apply).
[ suggest_essential_refactor ]frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx (1)
5-5: Confirm alias resolution for PmsCreateSheet importPlease verify that
~/modules/pms/components/CreatePmsSheetis a supported path alias in your TypeScript/Next.js configuration. If it isn’t—or to keep imports consistent with the rest of the plugin—you may want to switch back to the@alias:Location:
- frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx (line 5)
Suggested change:
- import { PmsCreateSheet } from '~/modules/pms/components/CreatePmsSheet'; + import { PmsCreateSheet } from '@/pms/components/CreatePmsSheet';frontend/plugins/tourism_ui/src/modules/tms/states/tmsInformationFieldsAtoms.ts (1)
1-4: LGTM! Clean state management implementation.The Jotai atom implementation is well-structured and follows functional programming patterns. It provides a clear, focused solution for step management in the multi-step UI flow.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/payments/payments.tsx (1)
74-75: LGTM! Consistent CSS class ordering.The CSS class reorderings improve consistency across the codebase and follow Tailwind best practices for class organization.
Also applies to: 119-119
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/general/Discount.tsx (1)
20-21: LGTM! Consistent CSS class ordering.The CSS class reorderings improve consistency and follow Tailwind best practices.
Also applies to: 65-65
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx (1)
12-12: LGTM! Good responsive design improvements.The addition of responsive grid classes and consistent class ordering improves the mobile-first responsive design approach as specified in the coding guidelines.
Also applies to: 29-29
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx (1)
39-39: Good styling improvement.Replacing the custom border color
border-[#F4F4F5]with the standardborderutility class improves consistency with the design system and enhances theme compatibility.frontend/plugins/tourism_ui/src/modules/tms/types/branch.ts (1)
20-21: Well-structured type additions.The new
generalManagerIdsandmanagerIdsproperties are properly typed as string arrays and follow the existing naming conventions. These additions align with the coordinated changes in GraphQL operations mentioned in the summary.frontend/plugins/tourism_ui/src/config.ts (1)
13-13: Improved configuration property naming.The rename from
hasRelatedWidgettohasWidgetsprovides better clarity and suggests a more generalized widget system. The change is applied consistently across both pms and tms modules.Also applies to: 20-20
frontend/plugins/tourism_ui/src/modules/tms/Main.tsx (2)
10-14: Excellent use of lazy loading pattern.The lazy-loaded PreviewPage component follows best practices with proper dynamic import and destructuring. The implementation correctly uses Suspense wrapper and maintains consistency with existing patterns.
21-21: Clean route addition.The new PreviewPage route is properly integrated into the existing routing structure without affecting other routes.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts (1)
31-33: Improved error handling in catch block.The simplified catch block without the error parameter is cleaner and follows best practices since the error is already handled by the onError callback.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDetail.ts (1)
13-26: Well-implemented detail fetching hook.The hook follows best practices with proper TypeScript interfaces, conditional query execution, and appropriate fetch policy for detail views. The structured return makes it easy to use in components.
frontend/plugins/tourism_ui/src/modules/tms/components/EmptyList.tsx (3)
6-6: Improved theming with CSS custom properties.The update to use theme-based colors (
bg-background,text-foreground,text-muted-foreground) improves consistency and makes the component theme-aware.Also applies to: 16-16, 20-20
9-9: Better asset management with local image.Using a local asset path instead of an external URL improves reliability and performance.
1-1: Import Path Strategy ConfirmedThe import uses the
~alias, which is an absolute path import and aligns with our guideline to always use absolute imports. No changes are needed here.Likely an incorrect or invalid review comment.
frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx (2)
12-19: Well-structured payment options configuration.The
paymentIconOptionsarray provides a clean mapping of payment types to labels, making it reusable across components.
32-61: Clean icon selection logic with good fallback.The switch statement provides clear icon mapping with a sensible default fallback to credit card icon for unknown types.
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
10-15: Well-structured interface definition.The props interface is properly typed and follows the functional component guidelines.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchDuplicate.ts (1)
6-38: Well-structured type definitions.The interfaces are comprehensive and properly typed, providing good type safety for the mutation variables.
frontend/plugins/tourism_ui/src/modules/tms/components/ConfirmationDialog.tsx (4)
4-11: Excellent interface design with clear typing.The props interface is well-structured with descriptive names and proper typing for the confirmation dialog functionality.
21-22: Good pattern for conditional logic.Using boolean flags derived from the type prop makes the conditional rendering more readable and maintainable.
28-43: Excellent visual differentiation for action types.The dynamic icon and styling based on action type provides clear visual cues to users about the nature of the action (copy vs. destructive delete).
66-78: Well-implemented loading states and button variants.The button properly handles loading states and uses appropriate variants (destructive for delete) with clear loading text feedback.
frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchList.ts (3)
5-10: Well-defined pagination interface.The PageInfo interface follows standard cursor-based pagination patterns and provides comprehensive pagination state information.
20-29: Good hook configuration with sensible defaults.The configurable limit parameter with a reasonable default and network-only fetch policy ensures fresh data retrieval.
31-35: Proper data extraction with safe fallbacks.The data extraction properly handles nested structure with appropriate fallback values to prevent runtime errors.
frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx (2)
8-15: Good SSR-safe parameter extraction.The component properly handles server-side rendering by checking for window availability before accessing URL parameters.
27-34: Good image fallback handling.The image error handling with onError fallback provides a good user experience when logo images fail to load.
frontend/plugins/tourism_ui/src/modules/tms/constants/formSchema.ts (1)
1-25: LGTM! Good improvements to field validation and naming.The changes improve the schema by:
- Fixing the typo in field names (
generalManagerandmanagers)- Making the error message more generic and consistent
- Adding proper validation for required fields in
otherPaymentsThese changes enhance data integrity and provide better user feedback.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (1)
8-87: Well-structured component following best practices!The component correctly:
- Uses functional component with TypeScript interface
- Implements responsive design with Tailwind CSS
- Handles edge cases with fallback values
- Follows the coding guidelines for TSX files
frontend/plugins/tourism_ui/src/modules/tms/components/TmsInformationFields.tsx (3)
36-82: Excellent implementation of step transitions!The use of absolute positioning with opacity transitions provides a smooth user experience without layout shifts. The component structure is clean and maintainable.
84-109: Good validation strategy for multi-step form.The validation approach correctly:
- Validates required fields before allowing progression
- Skips validation on step 2 as those fields are optional
- Validates payment fields on final save
111-191: Well-designed UI with excellent user experience!The component features:
- Smooth animations and transitions
- Clear step indicators with visual progress
- Responsive design following mobile-first approach
- Proper use of Tailwind CSS utilities
frontend/plugins/tourism_ui/src/modules/tms/hooks/CreateBranch.ts (1)
10-33: Excellent type safety improvements!The interface changes:
- Align with the corrected field names in the schema
- Replace generic
anytypes with structured objects- Provide better IDE support and compile-time checking
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (4)
1-26: Clean state management approach!The component correctly:
- Uses separate state variables for different concerns
- Follows functional component patterns
- Avoids useEffect as per guidelines
70-92: Well-implemented delete handler with proper error handling!The function correctly:
- Checks the success boolean from the hook
- Provides appropriate user feedback
- Handles errors gracefully
- Refetches data on success
94-123: Excellent UI structure with comprehensive state handling!The component properly handles:
- Loading state with spinner
- Error state with descriptive message
- Empty state with dedicated component
- Responsive grid layout for branch cards
124-177: Well-structured dialog management!The dialogs are properly implemented with:
- Conditional rendering based on state
- Proper callback handling
- Loading state management
- Clean prop passing
Note: The escape key prevention on line 134-136 ensures users don't accidentally close the edit form. Make sure this is the intended UX.
frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx (2)
165-173: Improve error handling for refetchGood error handling implementation for the refetch operation. The try-catch block properly handles potential errors.
88-88: Remove console.log statementsThe coding guidelines specify to avoid console logs.
- console.log('LogoField - Delete button clicked');⛔ Skipped due to learnings
Learnt from: CR PR: erxes/erxes-next#0 File: .cursorrules:0-0 Timestamp: 2025-07-21T06:09:41.192Z Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid console logs.frontend/plugins/tourism_ui/src/modules/tms/graphql/queries.ts (1)
3-84: Well-structured GraphQL queries with cursor-based paginationThe refactored queries properly implement cursor-based pagination and include comprehensive field selections. The capitalization of query names (BmsBranchList, BmsBranchDetail) follows GraphQL naming conventions.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (2)
196-226: Good refactoring of manager componentsThe renaming from
GeneralManegerandManegertoGeneralManagerandManagercorrects the typos and improves code quality. The integration withSelectMember.FormItemprovides better UI consistency.
273-277: Handle array type properly for payment fieldGood defensive programming by checking if the value is an array before accessing it.
frontend/plugins/tourism_ui/src/modules/tms/graphql/mutation.ts (1)
3-119: Well-structured GraphQL mutations with improved field namingThe refactored mutations properly implement the new field structure with
generalManagerIdsandmanagerIds, improving clarity over the genericuser1Idsanduser2Ids. The comprehensive field selections in the return types ensure data consistency with the queries.
| <button className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1"> | ||
| Action | ||
| <IconChevronDown size={18} stroke={2} /> | ||
| </button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance button accessibility.
The action trigger button lacks proper accessibility attributes and focus styling for keyboard navigation.
- <button className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1">
+ <button
+ className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1 hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring"
+ aria-label="Open action menu"
+ >📝 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.
| <button className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1"> | |
| Action | |
| <IconChevronDown size={18} stroke={2} /> | |
| </button> | |
| <button | |
| className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1 hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring" | |
| aria-label="Open action menu" | |
| > | |
| Action | |
| <IconChevronDown size={18} stroke={2} /> | |
| </button> |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx around
lines 26 to 29, the button element lacks accessibility attributes and focus
styles. Add appropriate ARIA attributes such as aria-haspopup and aria-expanded
to indicate the button's role and state. Also, include focus-visible styling to
ensure keyboard users can see when the button is focused, improving keyboard
navigation accessibility.
| <form className="space-y-4"> | ||
| <div className="grid gap-4"> | ||
| <div className="space-y-2"> | ||
| <Label className="text-sm font-medium"> | ||
| Payment Name <span className="text-destructive">*</span> | ||
| </Label> | ||
| <Input | ||
| placeholder="e.g., Visa, Mastercard, QPay" | ||
| className="h-9" | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="space-y-2"> | ||
| <Label className="text-sm font-medium"> | ||
| Payment Value <span className="text-destructive">*</span> | ||
| </Label> | ||
| <Input | ||
| placeholder="e.g., visa, mastercard, qpay" | ||
| className="h-9" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <Dialog.Footer> | ||
| <Button type="button" variant="outline"> | ||
| Cancel | ||
| </Button> | ||
| <Button type="button">Add Payment Method</Button> | ||
| </Dialog.Footer> | ||
| </form> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement controlled form inputs and submission handling.
The form lacks state management, validation, and submission logic. The inputs are uncontrolled and the buttons have no functionality.
+import { useState } from 'react';
+
+interface PaymentFormData {
+ name: string;
+ value: string;
+}
export const AddPaymentDialog = () => {
const [open, setOpen] = useState(false);
+ const [formData, setFormData] = useState<PaymentFormData>({
+ name: '',
+ value: '',
+ });
+
+ const handleInputChange = (field: keyof PaymentFormData, value: string) => {
+ setFormData(prev => ({ ...prev, [field]: value }));
+ };
+
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ // TODO: Implement payment creation logic
+ console.log('Payment data:', formData);
+ setOpen(false);
+ setFormData({ name: '', value: '' });
+ };
+
+ const handleCancel = () => {
+ setOpen(false);
+ setFormData({ name: '', value: '' });
+ };
- <form className="space-y-4">
+ <form className="space-y-4" onSubmit={handleSubmit}>
<div className="grid gap-4">
<div className="space-y-2">
<Label className="text-sm font-medium">
Payment Name <span className="text-destructive">*</span>
</Label>
<Input
placeholder="e.g., Visa, Mastercard, QPay"
className="h-9"
+ value={formData.name}
+ onChange={(e) => handleInputChange('name', e.target.value)}
+ required
/>
</div>
<div className="space-y-2">
<Label className="text-sm font-medium">
Payment Value <span className="text-destructive">*</span>
</Label>
<Input
placeholder="e.g., visa, mastercard, qpay"
className="h-9"
+ value={formData.value}
+ onChange={(e) => handleInputChange('value', e.target.value)}
+ required
/>
</div>
</div>
<Dialog.Footer>
- <Button type="button" variant="outline">
+ <Button type="button" variant="outline" onClick={handleCancel}>
Cancel
</Button>
- <Button type="button">Add Payment Method</Button>
+ <Button type="submit">Add Payment Method</Button>
</Dialog.Footer>
</form>📝 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.
| <form className="space-y-4"> | |
| <div className="grid gap-4"> | |
| <div className="space-y-2"> | |
| <Label className="text-sm font-medium"> | |
| Payment Name <span className="text-destructive">*</span> | |
| </Label> | |
| <Input | |
| placeholder="e.g., Visa, Mastercard, QPay" | |
| className="h-9" | |
| /> | |
| </div> | |
| <div className="space-y-2"> | |
| <Label className="text-sm font-medium"> | |
| Payment Value <span className="text-destructive">*</span> | |
| </Label> | |
| <Input | |
| placeholder="e.g., visa, mastercard, qpay" | |
| className="h-9" | |
| /> | |
| </div> | |
| </div> | |
| <Dialog.Footer> | |
| <Button type="button" variant="outline"> | |
| Cancel | |
| </Button> | |
| <Button type="button">Add Payment Method</Button> | |
| </Dialog.Footer> | |
| </form> | |
| <form className="space-y-4" onSubmit={handleSubmit}> | |
| <div className="grid gap-4"> | |
| <div className="space-y-2"> | |
| <Label className="text-sm font-medium"> | |
| Payment Name <span className="text-destructive">*</span> | |
| </Label> | |
| <Input | |
| placeholder="e.g., Visa, Mastercard, QPay" | |
| className="h-9" | |
| value={formData.name} | |
| onChange={(e) => handleInputChange('name', e.target.value)} | |
| required | |
| /> | |
| </div> | |
| <div className="space-y-2"> | |
| <Label className="text-sm font-medium"> | |
| Payment Value <span className="text-destructive">*</span> | |
| </Label> | |
| <Input | |
| placeholder="e.g., visa, mastercard, qpay" | |
| className="h-9" | |
| value={formData.value} | |
| onChange={(e) => handleInputChange('value', e.target.value)} | |
| required | |
| /> | |
| </div> | |
| </div> | |
| <Dialog.Footer> | |
| <Button type="button" variant="outline" onClick={handleCancel}> | |
| Cancel | |
| </Button> | |
| <Button type="submit">Add Payment Method</Button> | |
| </Dialog.Footer> | |
| </form> |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/AddPaymentDialog.tsx
around lines 39 to 68, the form inputs are uncontrolled and there is no
submission handling or validation. To fix this, add React state hooks to manage
the values of the Payment Name and Payment Value inputs, making them controlled
components. Implement onChange handlers to update state on user input. Add form
submission logic with validation to ensure required fields are filled before
processing. Also, update the Cancel and Add Payment Method buttons to handle
form reset and submission respectively.
| const handleDuplicateBranch = async (branch: IBranch) => { | ||
| setDuplicateDialogOpen(null); | ||
|
|
||
| try { | ||
| await duplicateBranch({ | ||
| variables: { | ||
| name: `${branch.name} (Copy)`, | ||
| description: branch.description, | ||
| generalManagerIds: branch.generalManagerIds || [], | ||
| managerIds: branch.managerIds || [], | ||
| paymentIds: branch.paymentIds || [], | ||
| paymentTypes: (branch.paymentTypes || []).map((name) => ({ | ||
| id: name, | ||
| name: name, | ||
| })), | ||
| erxesAppToken: branch.erxesAppToken, | ||
| permissionConfig: branch.permissionConfig || [], | ||
| uiOptions: branch.uiOptions || {}, | ||
| }, | ||
| onCompleted: async () => { | ||
| toast({ | ||
| title: 'Branch duplicated successfully', | ||
| }); | ||
| await refetch(); | ||
| }, | ||
| onError: (error) => { | ||
| toast({ | ||
| title: 'Failed to duplicate branch', | ||
| description: error.message, | ||
| variant: 'destructive', | ||
| }); | ||
| }, | ||
| }); | ||
| } catch (error) { | ||
| toast({ | ||
| title: 'Failed to duplicate branch', | ||
| description: error?.message || 'Unknown error occurred', | ||
| variant: 'destructive', | ||
| }); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify error handling to avoid duplicate messages.
The function has redundant error handling with both onError callback and try-catch block, which could show duplicate error toasts.
const handleDuplicateBranch = async (branch: IBranch) => {
setDuplicateDialogOpen(null);
try {
await duplicateBranch({
variables: {
name: `${branch.name} (Copy)`,
description: branch.description,
generalManagerIds: branch.generalManagerIds || [],
managerIds: branch.managerIds || [],
paymentIds: branch.paymentIds || [],
paymentTypes: (branch.paymentTypes || []).map((name) => ({
id: name,
name: name,
})),
erxesAppToken: branch.erxesAppToken,
permissionConfig: branch.permissionConfig || [],
uiOptions: branch.uiOptions || {},
},
onCompleted: async () => {
toast({
title: 'Branch duplicated successfully',
});
await refetch();
},
- onError: (error) => {
- toast({
- title: 'Failed to duplicate branch',
- description: error.message,
- variant: 'destructive',
- });
- },
});
} catch (error) {
toast({
title: 'Failed to duplicate branch',
description: error?.message || 'Unknown error occurred',
variant: 'destructive',
});
}
};📝 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.
| const handleDuplicateBranch = async (branch: IBranch) => { | |
| setDuplicateDialogOpen(null); | |
| try { | |
| await duplicateBranch({ | |
| variables: { | |
| name: `${branch.name} (Copy)`, | |
| description: branch.description, | |
| generalManagerIds: branch.generalManagerIds || [], | |
| managerIds: branch.managerIds || [], | |
| paymentIds: branch.paymentIds || [], | |
| paymentTypes: (branch.paymentTypes || []).map((name) => ({ | |
| id: name, | |
| name: name, | |
| })), | |
| erxesAppToken: branch.erxesAppToken, | |
| permissionConfig: branch.permissionConfig || [], | |
| uiOptions: branch.uiOptions || {}, | |
| }, | |
| onCompleted: async () => { | |
| toast({ | |
| title: 'Branch duplicated successfully', | |
| }); | |
| await refetch(); | |
| }, | |
| onError: (error) => { | |
| toast({ | |
| title: 'Failed to duplicate branch', | |
| description: error.message, | |
| variant: 'destructive', | |
| }); | |
| }, | |
| }); | |
| } catch (error) { | |
| toast({ | |
| title: 'Failed to duplicate branch', | |
| description: error?.message || 'Unknown error occurred', | |
| variant: 'destructive', | |
| }); | |
| } | |
| }; | |
| const handleDuplicateBranch = async (branch: IBranch) => { | |
| setDuplicateDialogOpen(null); | |
| try { | |
| await duplicateBranch({ | |
| variables: { | |
| name: `${branch.name} (Copy)`, | |
| description: branch.description, | |
| generalManagerIds: branch.generalManagerIds || [], | |
| managerIds: branch.managerIds || [], | |
| paymentIds: branch.paymentIds || [], | |
| paymentTypes: (branch.paymentTypes || []).map((name) => ({ | |
| id: name, | |
| name: name, | |
| })), | |
| erxesAppToken: branch.erxesAppToken, | |
| permissionConfig: branch.permissionConfig || [], | |
| uiOptions: branch.uiOptions || {}, | |
| }, | |
| onCompleted: async () => { | |
| toast({ | |
| title: 'Branch duplicated successfully', | |
| }); | |
| await refetch(); | |
| }, | |
| }); | |
| } catch (error) { | |
| toast({ | |
| title: 'Failed to duplicate branch', | |
| description: error?.message || 'Unknown error occurred', | |
| variant: 'destructive', | |
| }); | |
| } | |
| }; |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx between
lines 28 and 68, the handleDuplicateBranch function has redundant error handling
using both the onError callback inside duplicateBranch and a surrounding
try-catch block, which can cause duplicate error toasts. To fix this, remove the
onError callback from the duplicateBranch call and keep the try-catch block for
error handling, or vice versa, so that error toasts are shown only once.
| import { TmsCreateSheetHeader } from '@/tms/components/CreateTmsSheet'; | ||
|
|
||
| import { Sheet, Form, useToast } from 'erxes-ui'; | ||
| import { Sheet, Form, useToast, Preview, Separator } from 'erxes-ui'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use absolute import for erxes-ui
Maintain consistency with absolute imports.
-import { Sheet, Form, useToast, Preview, Separator } from 'erxes-ui';
+import { Sheet, Form, useToast, Preview, Separator } from '@/erxes-ui';🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx at
line 3, the import statement for 'erxes-ui' uses a relative or non-absolute
path. Change this import to use an absolute import path as per the project's
conventions to maintain consistency across the codebase.
| import { TmsInformationFields } from '@/tms/components/TmsInformationFields'; | ||
| import Preview from '@/tms/components/Preview'; | ||
| import { useCreateBranch } from '../hooks/CreateBranch'; | ||
| import { useBranchEdit } from '../hooks/BranchEdit'; | ||
| import { useBranchDetail } from '../hooks/BranchDetail'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use absolute paths for local imports
-import { TmsInformationFields } from '@/tms/components/TmsInformationFields';
-import { useCreateBranch } from '../hooks/CreateBranch';
-import { useBranchEdit } from '../hooks/BranchEdit';
-import { useBranchDetail } from '../hooks/BranchDetail';
+import { TmsInformationFields } from '@/tms/components/TmsInformationFields';
+import { useCreateBranch } from '@/tms/hooks/CreateBranch';
+import { useBranchEdit } from '@/tms/hooks/BranchEdit';
+import { useBranchDetail } from '@/tms/hooks/BranchDetail';📝 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.
| import { TmsInformationFields } from '@/tms/components/TmsInformationFields'; | |
| import Preview from '@/tms/components/Preview'; | |
| import { useCreateBranch } from '../hooks/CreateBranch'; | |
| import { useBranchEdit } from '../hooks/BranchEdit'; | |
| import { useBranchDetail } from '../hooks/BranchDetail'; | |
| import { TmsInformationFields } from '@/tms/components/TmsInformationFields'; | |
| import { useCreateBranch } from '@/tms/hooks/CreateBranch'; | |
| import { useBranchEdit } from '@/tms/hooks/BranchEdit'; | |
| import { useBranchDetail } from '@/tms/hooks/BranchDetail'; |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsForm.tsx
around lines 8 to 11, the imports for useCreateBranch, useBranchEdit, and
useBranchDetail use relative paths. Change these to use absolute paths based on
the project’s root or configured base URL to improve clarity and maintainability
of imports.
| import { useMutation } from '@apollo/client'; | ||
| import { EDIT_BRANCH } from '../graphql/mutation'; | ||
| import { GET_BRANCH_LIST } from '../graphql/queries'; | ||
| import { IBranch } from '../types/branch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use absolute path for type import
-import { IBranch } from '../types/branch';
+import { IBranch } from '@/tms/types/branch';🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts at line 4,
the import statement for IBranch uses a relative path. Change this to use the
absolute path based on the project's configured module resolution to improve
clarity and maintainability. Update the import to reference the full absolute
path to the branch type instead of '../types/branch'.
| onError: (error) => { | ||
| // Replace with proper error logging service | ||
| console.error('Branch edit failed:', error); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console.error as per coding guidelines
The coding guidelines specify to avoid console logs. Replace with proper error logging service or remove the console statement.
onError: (error) => {
- // Replace with proper error logging service
- console.error('Branch edit failed:', error);
+ // Error is handled by the caller's onError callback
},🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchEdit.ts around lines
44 to 47, the onError handler uses console.error which violates coding
guidelines. Replace the console.error call with the project's standard error
logging service or remove the console statement entirely if no logging service
is available.
| onError: (error) => { | ||
| console.error('Error removing branch:', error); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console.error to comply with coding guidelines.
The coding guidelines specify "Avoid console logs." Replace the console.error with proper error handling or remove it since the error is already propagated through Apollo Client's error handling.
- onError: (error) => {
- console.error('Error removing branch:', error);
- },
+ onError: () => {
+ // Error handling is managed by Apollo Client
+ },📝 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.
| onError: (error) => { | |
| console.error('Error removing branch:', error); | |
| }, | |
| onError: () => { | |
| // Error handling is managed by Apollo Client | |
| }, |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/hooks/BranchRemove.ts around
lines 19 to 21, remove the console.error statement inside the onError callback
to comply with coding guidelines that prohibit console logs. Since Apollo Client
already handles error propagation, either remove the entire onError handler or
replace it with a no-op or alternative error handling mechanism that does not
use console logging.
| import { TmsCreateSheet } from '~/modules/tms/components/CreateTmsSheet'; | ||
| import { BranchList } from '@/tms/components/BranchList'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Inconsistent import path conventions.
Line 5 uses a relative path with tilde (~/modules/tms/components/CreateTmsSheet) while line 6 uses an alias path (@/tms/components/BranchList). According to the coding guidelines, absolute paths should be used consistently for all imports.
Standardize the import paths:
-import { TmsCreateSheet } from '~/modules/tms/components/CreateTmsSheet';
-import { BranchList } from '@/tms/components/BranchList';
+import { TmsCreateSheet } from '@/tms/components/CreateTmsSheet';
+import { BranchList } from '@/tms/components/BranchList';📝 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.
| import { TmsCreateSheet } from '~/modules/tms/components/CreateTmsSheet'; | |
| import { BranchList } from '@/tms/components/BranchList'; | |
| import { TmsCreateSheet } from '@/tms/components/CreateTmsSheet'; | |
| import { BranchList } from '@/tms/components/BranchList'; |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/pages/tms/IndexPage.tsx at lines 5-6, the
import paths are inconsistent, mixing a tilde-based relative path and an alias
path. To fix this, update the import on line 5 to use the same alias path style
as line 6, ensuring all imports use absolute alias paths consistently according
to the coding guidelines.
| const PreviewPage = () => { | ||
| const [urlParams, setUrlParams] = useState<URLSearchParams | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (typeof window !== 'undefined') { | ||
| setUrlParams(new URLSearchParams(window.location.search)); | ||
| } | ||
| }, []); | ||
|
|
||
| const tourName = urlParams?.get('name') || 'Таны тур оператор'; | ||
| const themeColor = urlParams?.get('color') || '#4F46E5'; | ||
| const logoParam = urlParams?.get('logo'); | ||
| const logoUrl = logoParam ? readImage(logoParam) : 'https://placehold.co/150x150'; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col justify-center items-center p-4 min-h-screen md:flex-row md:p-6"> | ||
| <div className="p-4 w-full max-w-md sm:max-w-lg md:w-1/2"> | ||
| <div className="p-4 mx-auto rounded-lg border shadow-md sm:p-6 bg-background"> | ||
| <div className="flex justify-center mb-4 sm:mb-6"> | ||
| <img | ||
| src={logoUrl} | ||
| alt="Company Logo" | ||
| className="object-contain w-auto h-12 sm:h-16 md:h-20" | ||
| onError={(e) => | ||
| (e.currentTarget.src = 'https://placehold.co/150x150') | ||
| } | ||
| /> | ||
| </div> | ||
| <h2 className="mb-2 text-lg font-semibold text-center sm:text-xl text-foreground"> | ||
| Sign in to your account | ||
| </h2> | ||
| <p className="mb-4 text-sm text-center sm:mb-6 sm:text-base text-muted-foreground"> | ||
| Enter your email and password below to access your account. | ||
| </p> | ||
| <form className="space-y-3 sm:space-y-4"> | ||
|
|
||
| <Select> | ||
| <Select.Trigger className="w-full"> | ||
| <Select.Value placeholder="Select a branch" /> | ||
| </Select.Trigger> | ||
| <Select.Content> | ||
| <Select.Group> | ||
| <Select.Item value={tourName}>{tourName}</Select.Item> | ||
| </Select.Group> | ||
| </Select.Content> | ||
| </Select> | ||
|
|
||
| <div> | ||
| <label | ||
| htmlFor="email" | ||
| className="block mb-1.5 text-sm font-medium text-foreground sm:text-base" | ||
| > | ||
| </label> | ||
| <Input | ||
| id="email" | ||
| type="email" | ||
| value="[email protected]" | ||
| disabled | ||
| className="px-3 py-2 w-full text-sm rounded-md border bg-background text-foreground sm:text-base" | ||
| /> | ||
| </div> | ||
| <div> | ||
| <div className="flex justify-between items-center mb-1"> | ||
| <label | ||
| htmlFor="password" | ||
| className="block text-sm font-medium text-foreground sm:text-base mb-1.5" | ||
| > | ||
| Password | ||
| </label> | ||
| <p className="text-sm sm:text-base text-primary"> | ||
| Forgot password? | ||
| </p> | ||
| </div> | ||
| <Input | ||
| id="password" | ||
| type="password" | ||
| value="••••••••" | ||
| disabled | ||
| className="px-3 py-2 w-full text-sm rounded-md border bg-background text-foreground sm:text-base" | ||
| /> | ||
| </div> | ||
| <button | ||
| type="button" | ||
| disabled | ||
| className="px-4 py-1.5 mt-5.5 w-full text-sm text-white rounded-md sm:text-base" | ||
| style={{ backgroundColor: themeColor }} | ||
| > | ||
| Sign in | ||
| </button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default PreviewPage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Suspense wrapper as required by coding guidelines.
The coding guidelines specify that client components should be wrapped in Suspense with fallback. This component uses client-side features like window access and should be wrapped.
+import { Suspense } from 'react';
+
+const PreviewPageContent = () => {
const [urlParams, setUrlParams] = useState<URLSearchParams | null>(null);
// ... rest of component logic
+};
+
+const PreviewPage = () => {
+ return (
+ <Suspense fallback={<div>Loading preview...</div>}>
+ <PreviewPageContent />
+ </Suspense>
+ );
+};Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx around lines 8 to
105, the PreviewPage component uses client-side features like window access and
must be wrapped in a Suspense component with a fallback UI as per coding
guidelines. To fix this, import Suspense from React and wrap the PreviewPage
component export with Suspense, providing an appropriate fallback element such
as a loading spinner or placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed b05a318 in 1 minute and 56 seconds. Click for details.
- Reviewed
742lines of code in16files - Skipped
0files when reviewing. - Skipped posting
1draft 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/pms/components/pmsSheet/CreatePmsForm.tsx:91
- Draft comment:
Verify field naming consistency for check-in and check-out fields in the mutation payload. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_3BA1DYBvO8F89Mym
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| </DropdownMenu.Trigger> | ||
| <DropdownMenu.Content className="min-w-[150px]"> | ||
| {dropdownItems.map((item) => ( | ||
| <DropdownMenu.Item className="flex gap-2 items-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a unique key prop in the dropdownItems.map iteration to avoid React warnings.
| <DropdownMenu.Item className="flex gap-2 items-center"> | |
| <DropdownMenu.Item key={item.label} className="flex gap-2 items-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eniig zuger dawthgu hiisen ni deer baikh
| align="end" | ||
| > | ||
| {dropdownItems.map((item) => ( | ||
| <div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a key prop for items rendered inside the map over dropdownItems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx (1)
20-31: Remove unused hardcoded options.The
optionsarray is no longer used since the component now usesSelectProduct. This is dead code that should be removed.- const options: MultiSelectOption[] = [ - { value: 'apple', label: 'Apple' }, - { value: 'banana', label: 'Banana' }, - { value: 'orange', label: 'Orange' }, - { value: 'grape', label: 'Grape' }, - { value: 'strawberry', label: 'Strawberry' }, - { value: 'watermelon', label: 'Watermelon' }, - { value: 'kiwi', label: 'Kiwi' }, - { value: 'mango', label: 'Mango' }, - { value: 'pineapple', label: 'Pineapple' }, - { value: 'peach', label: 'Peach' }, - ];
♻️ Duplicate comments (6)
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
48-51: Enhance button accessibility.The action trigger button lacks proper accessibility attributes and focus styling for keyboard navigation, similar to the issue identified in past reviews.
- <button className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1"> + <button + className="flex items-center leading-[100%] text-foreground font-inter gap-1 text-sm font-medium rounded-md px-1 hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring" + aria-label="Open action menu" + aria-haspopup="true" + >frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (3)
28-68: Duplicate error handling creates redundant error messagesThis function has both
onErrorcallback and try-catch block, which could show duplicate error toasts to users.Remove either the
onErrorcallback or the try-catch block to prevent duplicate error handling:const handleDuplicateBranch = async (branch: IBranch) => { setDuplicateDialogOpen(null); try { await duplicateBranch({ variables: { name: `${branch.name} (Copy)`, description: branch.description, generalManagerIds: branch.generalManagerIds || [], managerIds: branch.managerIds || [], paymentIds: branch.paymentIds || [], paymentTypes: (branch.paymentTypes || []).map((name) => ({ id: name, name: name, })), erxesAppToken: branch.erxesAppToken, permissionConfig: branch.permissionConfig || [], uiOptions: branch.uiOptions || {}, }, onCompleted: async () => { toast({ title: 'Branch duplicated successfully', }); await refetch(); }, - onError: (error) => { - toast({ - title: 'Failed to duplicate branch', - description: error.message, - variant: 'destructive', - }); - }, }); } catch (error) { toast({ title: 'Failed to duplicate branch', description: error?.message || 'Unknown error occurred', variant: 'destructive', }); } };
28-68: Simplify error handling to avoid duplicate messages.The function has redundant error handling with both
onErrorcallback and try-catch block, which could show duplicate error toasts.- onError: (error) => { - toast({ - title: 'Failed to duplicate branch', - description: error.message, - variant: 'destructive', - }); - },
28-68: Duplicate error handling causing potential double error messages.The
handleDuplicateBranchfunction has redundant error handling with bothonErrorcallback and try-catch block, which could result in duplicate error toasts being displayed to users.Apply this fix to remove the redundant error handling:
const handleDuplicateBranch = async (branch: IBranch) => { setDuplicateDialogOpen(null); try { await duplicateBranch({ variables: { name: `${branch.name} (Copy)`, description: branch.description, generalManagerIds: branch.generalManagerIds || [], managerIds: branch.managerIds || [], paymentIds: branch.paymentIds || [], paymentTypes: (branch.paymentTypes || []).map((name) => ({ id: name, name: name, })), erxesAppToken: branch.erxesAppToken, permissionConfig: branch.permissionConfig || [], uiOptions: branch.uiOptions || {}, }, onCompleted: async () => { toast({ title: 'Branch duplicated successfully', }); await refetch(); }, - onError: (error) => { - toast({ - title: 'Failed to duplicate branch', - description: error.message, - variant: 'destructive', - }); - }, }); } catch (error) { toast({ title: 'Failed to duplicate branch', - description: error?.message || 'Unknown error occurred', + description: error?.message || 'Unknown error occurred', variant: 'destructive', }); } };frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (2)
2-2: Use absolute import path for erxes-ui.The import statement uses a relative path pattern that should be absolute as per coding guidelines.
-import { Button, Form, Input, Select, Upload, ColorPicker } from 'erxes-ui'; +import { Button, Form, Input, Select, Upload, ColorPicker } from '@/erxes-ui';
5-7: Use absolute paths for local imports.The imports for PaymentIcon, AddPaymentDialog, and SelectMember should use absolute paths for consistency.
-import PaymentIcon, { paymentIconOptions } from './PaymentIcon'; -import AddPaymentDialog from './AddPaymentDialog'; -import { SelectMember } from 'ui-modules'; +import PaymentIcon, { paymentIconOptions } from '@/tms/components/PaymentIcon'; +import AddPaymentDialog from '@/tms/components/AddPaymentDialog'; +import { SelectMember } from '@/ui-modules';
🧹 Nitpick comments (4)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx (2)
13-13: Remove unused import.
SelectCategoryis imported but not used in this component.-import { SelectCategory, SelectProduct } from 'ui-modules'; +import { SelectProduct } from 'ui-modules';
44-82: Consider replacing hardcoded test data.The Board, Pipeline, and Stage fields still use hardcoded test arrays. Consider if these should also be replaced with proper data sources or specialized components for consistency.
frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx (1)
79-79: Use named export for consistency.According to the coding guidelines, components should use named exports instead of default exports.
-export default BranchCard; +export { BranchCard };frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (1)
18-22: Consider consolidating related state with useReducer.Multiple related boolean states for dialogs could be consolidated using a single state object or useReducer for better maintainability.
- const [editingBranch, setEditingBranch] = useState<string | null>(null); - const [deleteDialogOpen, setDeleteDialogOpen] = useState<string | null>(null); - const [duplicateDialogOpen, setDuplicateDialogOpen] = useState<string | null>( - null, - ); + const [dialogState, setDialogState] = useState<{ + editing: string | null; + deleting: string | null; + duplicating: string | null; + }>({ + editing: null, + deleting: null, + duplicating: null, + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
backend/plugins/tourism_api/src/modules/bms/graphql/schemas/bmsbranch.ts(0 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsx(6 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx(3 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx(3 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsForm.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsFormContent.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx(1 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx(2 hunks)frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx(19 hunks)frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx(2 hunks)frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx(1 hunks)
💤 Files with no reviewable changes (1)
- backend/plugins/tourism_api/src/modules/bms/graphql/schemas/bmsbranch.ts
✅ Files skipped from review due to trivial changes (2)
- frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsForm.tsx
- frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsFormContent.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
- frontend/plugins/tourism_ui/src/pages/pms/IndexPage.tsx
- frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/appearance/appearance.tsx
- frontend/plugins/tourism_ui/src/pages/tms/PreviewPage.tsx
- frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx
- frontend/plugins/tourism_ui/src/modules/tms/components/CreateTmsSheet.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx}: Use functional and declarative programming patterns; avoid classes.
Use TypeScript for all code; prefer interfaces over types.
Avoid enums; use maps instead.
Files:
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Avoid console logs.
Always use absolute paths when importing.
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
**/*.{ts,tsx,js,jsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use the "function" keyword for pure functions.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
Use absolute path when import.
Files:
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
**/*.{tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.{tsx,jsx}: Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
**/*.{tsx,jsx}: Structure files: exported component, subcomponents, helpers, static content, types.
Favor named exports for components.
Use declarative JSX.
Use Shadcn UI, Radix, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.
Files:
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
**/*.tsx
📄 CodeRabbit Inference Engine (.cursorrules)
**/*.tsx: Use functional components with TypeScript interfaces.
Minimize 'useEffect', and 'setState'.
Wrap client components in Suspense with fallback.
Use dynamic loading for non-critical components.
Limit 'use client': Favor server components and Next.js SSR. Use only for Web API access in small components. Avoid for data fetching or state management.
Files:
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
**/*.{webp,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursorrules)
Optimize images: use WebP format, include size data, implement lazy loading.
Files:
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsxfrontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsxfrontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
🧠 Learnings (8)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Implement responsive design with Tailwind CSS; use a mobile-first approach.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsx (6)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{ts,tsx} : Avoid enums; use maps instead.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{ts,tsx} : Avoid enums; use maps instead.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx (1)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx (8)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Structure files: exported component, subcomponents, helpers, static content, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use dynamic loading for non-critical components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (14)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Favor named exports for components.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{tsx,jsx} : Use Shadcn UI, Radix, and Tailwind for components and styling.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Structure files: exported component, utils, contexts, hooks, types.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Minimize 'useEffect', and 'setState'.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid console logs.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use absolute paths when importing.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use absolute path when import.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (2)
Learnt from: CR
PR: erxes/erxes-next#0
File: .cursorrules:0-0
Timestamp: 2025-07-21T06:09:41.203Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
Learnt from: CR
PR: erxes/erxes-next#0
File: .windsurfrules:0-0
Timestamp: 2025-07-21T06:10:08.710Z
Learning: Applies to **/*.tsx : Use functional components with TypeScript interfaces.
🧬 Code Graph Analysis (6)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsx (1)
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (1)
BranchCard(16-86)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsx (3)
frontend/plugins/tourism_ui/src/modules/pms/states/sheetStates.tsx (1)
sheetOpenState(3-3)frontend/plugins/tourism_ui/src/modules/pms/states/stepStates.tsx (1)
stepState(3-3)frontend/libs/erxes-ui/src/components/sheet.tsx (1)
Sheet(176-186)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsx (2)
frontend/libs/ui-modules/src/modules/team-members/components/SelectMember.tsx (1)
SelectMember(364-373)frontend/libs/erxes-ui/src/components/form.tsx (1)
Form(167-175)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx (1)
frontend/libs/ui-modules/src/modules/products/components/SelectProduct.tsx (1)
SelectProduct(348-358)
frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx (4)
frontend/plugins/tourism_ui/src/modules/tms/components/BranchCard.tsx (1)
BranchCard(16-86)frontend/libs/erxes-ui/src/components/dropdown-menu.tsx (1)
DropdownMenu(171-186)frontend/libs/erxes-ui/src/lib/utils.ts (1)
cn(4-6)frontend/libs/erxes-ui/src/components/avatar.tsx (1)
Avatar(72-75)
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (1)
frontend/libs/erxes-ui/src/components/popover.tsx (1)
Popover(50-55)
🪛 Biome (2.1.2)
frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx
[error] 50-50: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx
[error] 59-62: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
⏰ 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 (41)
frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsx (3)
12-12: Good addition of step state setter.Adding the
setCurrentStepsetter from thestepStateatom is appropriate for the new functionality.
14-17: Excellent implementation of handleOpenChange with step reset.The
handleOpenChangefunction properly handles both setting the sheet's open state and resetting the current step to 1. This ensures users always start from the first step when reopening the sheet, which provides a consistent user experience for the multi-step form workflow.
20-20: Proper integration of the new change handler.The
onOpenChangeprop now correctly uses the newhandleOpenChangefunction instead of directly setting the open state, enabling the step reset functionality.frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/admins/admins.tsx (3)
7-7: LGTM on SelectMember integration.Good refactoring to use the specialized
SelectMembercomponent fromui-modulesinstead of generic selector components. This improves consistency and functionality.
20-24: Excellent consistency in form field implementation.All admin role fields consistently use the
SelectMembercomponent with proper form control integration. Themode="multiple"setting is correctly applied for multi-selection scenarios.Also applies to: 37-41, 54-58, 71-75, 88-92
98-100: Clarify the commented button's purpose.The "Add team member" button is commented out. Please clarify if this is intentional for this release or if it should be removed entirely.
frontend/plugins/tourism_ui/src/modules/pms/components/pmsFormFields/pipelineConfig/pipelineConfig.tsx (1)
122-126: LGTM on SelectProduct integration.Good refactoring to use the specialized
SelectProductcomponent for room and extra product categories. This provides better functionality and consistency.Also applies to: 139-143
frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx (2)
34-37: "Visit website" action has no click handler.The "Visit website" menu item doesn't have an
onClickhandler. Please verify if this is intentional or if a handler should be added.
17-22: LGTM on component structure and props.Good implementation with proper TypeScript interface, clear prop handling, and consistent callback patterns for the action handlers.
frontend/plugins/tourism_ui/src/modules/tms/components/BranchList.tsx (10)
1-11: LGTM - Clean import structureThe imports follow absolute path conventions and are well-organized. All TypeScript types and components are properly imported.
12-17: Good hook usage patternThe component properly uses custom hooks with descriptive variable names following the auxiliary verb pattern (loading, error). The functional component structure aligns with coding guidelines.
18-26: Clean state management implementationThe state variables use descriptive names and proper TypeScript typing. The helper function follows the functional programming approach required by the guidelines.
70-92: Proper error handling implementationThe delete function uses consistent error handling with a single try-catch block and appropriate success/failure messaging.
94-103: Clean conditional rendering patternThe early returns for loading and error states follow React best practices and avoid unnecessary nesting. The error display includes helpful error messages.
105-181: Excellent responsive design and component compositionThe JSX structure follows coding guidelines perfectly:
- Mobile-first responsive design with Tailwind CSS
- Proper use of Shadcn UI components (Sheet)
- Clean component composition with BranchCard and ConfirmationDialog
- Well-structured event handling patterns
70-92: LGTM!Clean error handling implementation with proper success/failure feedback and refetch logic.
105-181: LGTM!Well-structured JSX with proper responsive design, clean component composition, and good separation of concerns between the main list, edit sheet, and confirmation dialogs.
105-122: LGTM! Well-structured grid layout with responsive design.The grid layout properly implements responsive design using Tailwind's mobile-first approach with appropriate breakpoints and follows the component guidelines.
124-153: Sheet implementation follows proper patterns.The Sheet component for editing branches is properly implemented with controlled state and proper cleanup handlers. The integration with CreateTmsForm follows the established patterns.
frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx (22)
2-2: Import path follows external library conventionThe import from 'erxes-ui' appears to be from an external library, so the current path is appropriate. Previous comment about absolute paths was likely incorrect for external dependencies.
9-27: Well-structured form field componentThe TourName component follows coding guidelines with proper TypeScript interfaces, functional component pattern, and good accessibility practices with the required field indicator.
29-54: Clean ColorPicker integrationThe SelectColor component properly integrates the ColorPicker with correct value handling and maintains consistency with other form field components.
56-118: Well-implemented upload field with conditional renderingThe LogoField component properly handles upload states with conditional rendering for preview/upload modes and clean delete functionality. Previous console.log issues appear to have been resolved.
120-188: Consistent upload field implementationThe FavIconField follows the same solid pattern as LogoField with appropriate styling variations for favicon handling. Clean conditional rendering and proper delete functionality.
190-219: Good spelling correction and component integrationThe GeneralManager component properly addresses the spelling correction from "GeneralManeger" and integrates well with the SelectMember component for consistent member selection UI.
221-245: Consistent manager selection with proper namingThe Manager component follows the same pattern as GeneralManager with corrected spelling and appropriate plural field naming ("managers").
253-294: Robust payment selection with modular add functionalityThe Payments component handles both array and string values gracefully and integrates the AddPaymentDialog component for better modularity and user experience.
296-313: Clean token input fieldThe Token component provides a clear input field with helpful description and appropriate visual styling with border separation.
315-355: Well-structured dynamic form field setupThe OtherPayments component uses useFieldArray appropriately for dynamic payment methods and provides comprehensive configuration guidance in the description.
357-483: Excellent dynamic form implementation with PaymentIcon integrationThe dynamic payment fields are well-implemented with:
- Proper field array mapping and unique keys
- Great integration of the PaymentIcon component for visual icon selection
- Consistent styling and clean remove functionality
- Good user experience for managing dynamic payment methods
40-48: LGTM!ColorPicker implementation is correct with proper value binding and change handling.
76-92: LGTM!Well-implemented image preview with delete functionality. Good UX with proper button positioning and clear visual feedback.
146-162: LGTM!Consistent implementation with LogoField. Good use of different icons (IconX vs IconTrash) to differentiate the delete actions.
190-245: LGTM!Excellent typo corrections from "GeneralManeger" to "GeneralManager" and "Maneger" to "Manager". The consistent use of SelectMember.FormItem improves code reusability.
267-272: LGTM!Good defensive programming to handle both array and string values. This makes the component more robust.
417-442: LGTM!Excellent integration of PaymentIcon component for both the selected value display and dropdown options. This enhances UX with clear visual indicators.
76-112: Well-implemented upload field with preview and delete functionality.The LogoField component properly implements upload functionality with conditional rendering for preview/upload states and includes proper delete handling. The UI follows Tailwind patterns consistently.
146-181: FavIconField follows consistent upload pattern.The favicon upload implementation is consistent with the logo field pattern and includes proper preview and delete functionality with appropriate styling.
190-219: Good integration with SelectMember component.The GeneralManager field properly integrates with the SelectMember.FormItem component, following the established patterns for member selection.
264-288: Payment selection properly handles both array and string values.The payment field correctly handles value transformation and integrates well with the AddPaymentDialog component for enhanced UX.
417-442: Excellent PaymentIcon integration with proper display logic.The icon selection properly integrates with the PaymentIcon component, showing both icon and label in the Select.Value and Select.Item components. The implementation follows good UX patterns.
| import BranchCard from '~/modules/pms/components/ui/branchCard'; | ||
|
|
||
| const PmsBranchList = () => { | ||
| return ( | ||
| <div className="h-full grid lg:grid-cols-3 xl:grid-cols-4 gap-4 p-5"> | ||
| <BranchCard /> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default PmsBranchList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component renders single card instead of a list.
The component name PmsBranchList suggests it should render multiple branch cards, but it only renders a single BranchCard without any props or data. This seems inconsistent with the expected list functionality.
Consider implementing proper list functionality:
-const PmsBranchList = () => {
+interface PmsBranchListProps {
+ branches?: Branch[];
+}
+
+const PmsBranchList = ({ branches = [] }: PmsBranchListProps) => {
return (
<div className="h-full grid lg:grid-cols-3 xl:grid-cols-4 gap-4 p-5">
- <BranchCard />
+ {branches.map((branch) => (
+ <BranchCard key={branch._id} branch={branch} />
+ ))}
</div>
);
};Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/pms/components/pmsBranchList.tsx
lines 1 to 10, the PmsBranchList component currently renders only a single
BranchCard, which contradicts its name implying a list. To fix this, modify the
component to accept an array of branch data as props or fetch it internally,
then map over this array to render multiple BranchCard components, passing
appropriate props to each card to display distinct branch information.
| import { steps } from '../../constants/steps.constants'; | ||
| import { useAtom, useSetAtom } from 'jotai'; | ||
| import { stepState } from '../states/stepStates'; | ||
| import { sheetOpenState } from '../states/sheetStates'; | ||
| import { stepState } from '../../states/stepStates'; | ||
| import { sheetOpenState } from '../../states/sheetStates'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Import paths changed from absolute to relative - verify consistency with coding guidelines.
The import paths have been updated from alias-based imports to relative paths. However, the coding guidelines specify "Always use absolute paths when importing." Please ensure this change aligns with the project's import strategy.
🏁 Script executed:
#!/bin/bash
# Description: Check if other similar components in the codebase use relative or absolute imports
# Expected: Verify the import pattern consistency across the tourism_ui module
echo "Checking import patterns in similar PMS components..."
rg -A 3 "from.*states/" frontend/plugins/tourism_ui/src/modules/pms/
echo -e "\nChecking import patterns in TMS components for comparison..."
rg -A 3 "from.*states/" frontend/plugins/tourism_ui/src/modules/tms/
echo -e "\nChecking if there's a tsconfig.json or similar that defines path aliases..."
fd "tsconfig.json" . --exec cat {} \; | jq '.compilerOptions.paths // empty'Length of output: 7885
Use absolute alias imports instead of relative paths
The imports in CreatePmsSheet.tsx (lines 5–8) currently use relative paths (../../…), but our coding guidelines mandate absolute alias imports. Please update them to match patterns used elsewhere in tourism_ui:
• Replace
import { steps } from '../../constants/steps.constants';
with
import { steps } from '@/pms/constants/steps.constants';
• Replace
import { stepState } from '../../states/stepStates';
with
import { stepState } from '@/pms/states/stepStates';
• Replace
import { sheetOpenState } from '../../states/sheetStates';
with
import { sheetOpenState } from '@/pms/states/sheetStates';
• Ensure any other local imports in this module use @/… (or ~/modules/…) aliases rather than relative paths for consistency.
🤖 Prompt for AI Agents
In
frontend/plugins/tourism_ui/src/modules/pms/components/pmsSheet/CreatePmsSheet.tsx
lines 5 to 8, replace all relative import paths starting with ../../ with
absolute alias imports using @/pms/ as the base path. Specifically, update
imports for steps, stepState, and sheetOpenState to use
'@/pms/constants/steps.constants', '@/pms/states/stepStates', and
'@/pms/states/sheetStates' respectively. Also, review the entire file for any
other local imports and convert them to use the @/ or ~/modules/ alias format to
maintain consistency with project coding guidelines.
| const BranchCard = () => { | ||
| const [open, setOpen] = useState<boolean>(false); | ||
|
|
||
| const dropdownItems = [ | ||
| { | ||
| label: 'Manage', | ||
| icon: <IconEdit className="size-4" stroke={2} />, | ||
| //onClick: () => ... | ||
| }, | ||
| { | ||
| label: 'Duplicate', | ||
| icon: <IconCopy className="size-4" />, | ||
| }, | ||
| { | ||
| label: 'Delete', | ||
| icon: <IconTrash className="size-4" />, | ||
| }, | ||
| ]; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Component should accept props for dynamic content.
The component currently uses hardcoded content (title, image, date) and doesn't accept any props. This limits reusability and doesn't follow the pattern seen in the TMS BranchCard component.
Consider adding a proper interface and props:
+interface BranchCardProps {
+ branch?: {
+ name: string;
+ createdAt: string;
+ logo?: string;
+ user?: {
+ avatar?: string;
+ name?: string;
+ };
+ };
+ onEdit?: () => void;
+ onDuplicate?: () => void;
+ onDelete?: () => void;
+}
+
-const BranchCard = () => {
+const BranchCard = ({ branch, onEdit, onDuplicate, onDelete }: BranchCardProps) => {📝 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.
| const BranchCard = () => { | |
| const [open, setOpen] = useState<boolean>(false); | |
| const dropdownItems = [ | |
| { | |
| label: 'Manage', | |
| icon: <IconEdit className="size-4" stroke={2} />, | |
| //onClick: () => ... | |
| }, | |
| { | |
| label: 'Duplicate', | |
| icon: <IconCopy className="size-4" />, | |
| }, | |
| { | |
| label: 'Delete', | |
| icon: <IconTrash className="size-4" />, | |
| }, | |
| ]; | |
| interface BranchCardProps { | |
| branch?: { | |
| name: string; | |
| createdAt: string; | |
| logo?: string; | |
| user?: { | |
| avatar?: string; | |
| name?: string; | |
| }; | |
| }; | |
| onEdit?: () => void; | |
| onDuplicate?: () => void; | |
| onDelete?: () => void; | |
| } | |
| const BranchCard = ({ branch, onEdit, onDuplicate, onDelete }: BranchCardProps) => { | |
| const [open, setOpen] = useState<boolean>(false); | |
| const dropdownItems = [ | |
| { | |
| label: 'Manage', | |
| icon: <IconEdit className="size-4" stroke={2} />, | |
| //onClick: onEdit | |
| }, | |
| { | |
| label: 'Duplicate', | |
| icon: <IconCopy className="size-4" />, | |
| //onClick: onDuplicate | |
| }, | |
| { | |
| label: 'Delete', | |
| icon: <IconTrash className="size-4" />, | |
| //onClick: onDelete | |
| }, | |
| ]; | |
| // …rest of component |
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx
around lines 14 to 32, the BranchCard component uses hardcoded content and does
not accept any props, limiting its reusability. Define a TypeScript interface
for the expected props (e.g., title, image, date) and update the component to
accept these props. Replace the hardcoded values with the corresponding prop
values to make the component dynamic and reusable.
| return ( | ||
| <div className="h-fit rounded-md max-w-2xl shadow-md border"> | ||
| <div className="p-3 flex justify-between gap-4"> | ||
| <h3>New pms branch</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace hardcoded content with dynamic data.
The component contains hardcoded content that should be replaced with props-based data for proper functionality.
- <h3>New pms branch</h3>
+ <h3>{branch?.name || 'Unnamed Branch'}</h3>
<img
- src="https://particle.scitech.org.au/wp-content/uploads/2022/12/GettyImages-1203853320-scaled.jpg"
+ src={branch?.logo || 'https://placehold.co/150x150'}
- alt=""
+ alt={branch?.name || 'Branch logo'}
className="w-full h-full"
/>
- Created on: Jan 25, 2025
+ Created on: {branch?.createdAt ? new Date(branch.createdAt).toLocaleDateString() : 'N/A'}Also applies to: 59-63, 69-69
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx at
lines 36, 59-63, and 69, replace the hardcoded text content with dynamic data
passed via props. Modify the component to accept relevant props and use them to
render the branch name and other details instead of static strings, ensuring the
component displays variable data correctly.
| {dropdownItems.map((item) => ( | ||
| <DropdownMenu.Item className="flex gap-2 items-center"> | ||
| {item.icon} {item.label} | ||
| </DropdownMenu.Item> | ||
| ))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing key prop for mapped items.
The static analysis tool correctly identified a missing key prop in the mapped dropdown items, which is required for React's reconciliation process.
{dropdownItems.map((item) => (
<DropdownMenu.Item
+ key={item.label}
className="flex gap-2 items-center"
>
{item.icon} {item.label}
</DropdownMenu.Item>
))}📝 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.
| {dropdownItems.map((item) => ( | |
| <DropdownMenu.Item className="flex gap-2 items-center"> | |
| {item.icon} {item.label} | |
| </DropdownMenu.Item> | |
| ))} | |
| {dropdownItems.map((item) => ( | |
| <DropdownMenu.Item | |
| key={item.label} | |
| className="flex gap-2 items-center" | |
| > | |
| {item.icon} {item.label} | |
| </DropdownMenu.Item> | |
| ))} |
🧰 Tools
🪛 Biome (2.1.2)
[error] 50-50: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/pms/components/ui/branchCard.tsx
around lines 49 to 53, the mapped DropdownMenu.Item elements lack a unique key
prop, which is necessary for React to efficiently track list items. Add a key
prop to each DropdownMenu.Item using a unique identifier from the item object,
such as item.id or a unique string, to resolve this issue.
| {dropdownItems.map((item) => ( | ||
| <div | ||
| className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted" | ||
| onClick={item.onClick} | ||
| > | ||
| {item.icon} | ||
| <p className="text-sm font-medium leading-[100%] font-inter"> | ||
| {item.label} | ||
| </p> | ||
| </div> | ||
| ))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing key prop for mapped items.
The static analysis tool correctly identified a missing key prop in the mapped dropdown items.
{dropdownItems.map((item) => (
<div
+ key={item.label}
className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted"
onClick={item.onClick}
>📝 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.
| {dropdownItems.map((item) => ( | |
| <div | |
| className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted" | |
| onClick={item.onClick} | |
| > | |
| {item.icon} | |
| <p className="text-sm font-medium leading-[100%] font-inter"> | |
| {item.label} | |
| </p> | |
| </div> | |
| ))} | |
| {dropdownItems.map((item) => ( | |
| <div | |
| key={item.label} | |
| className="flex gap-3 items-center px-4 py-2 w-full text-left rounded-md cursor-pointer hover:bg-muted" | |
| onClick={item.onClick} | |
| > | |
| {item.icon} | |
| <p className="text-sm font-medium leading-[100%] font-inter"> | |
| {item.label} | |
| </p> | |
| </div> | |
| ))} |
🧰 Tools
🪛 Biome (2.1.2)
[error] 59-62: Missing key property for this element in iterable.
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
(lint/correctness/useJsxKeyInIterable)
🤖 Prompt for AI Agents
In frontend/plugins/tourism_ui/src/modules/tms/components/ActionMenu.tsx around
lines 58 to 68, the mapped dropdown items lack a unique key prop, which is
required for React to efficiently track list elements. Add a unique key prop to
the outermost div inside the map function, ideally using a unique identifier
from each item such as an id or a unique label, to resolve the warning and
improve rendering performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eniig ustgah empty state iig icon ashiglaj shiideh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ene hediig false bolgoh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~modules/ -> @/ bolgoh
| variant={'destructive'} | ||
| size={'icon'} | ||
| className="h-8 w-8" | ||
| className="w-8 h-8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
size-8 gej class baigaa
| </DropdownMenu.Trigger> | ||
| <DropdownMenu.Content className="min-w-[150px]"> | ||
| {dropdownItems.map((item) => ( | ||
| <DropdownMenu.Item className="flex gap-2 items-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eniig zuger dawthgu hiisen ni deer baikh
| setEditingBranch(branchId); | ||
| }; | ||
|
|
||
| const handleDuplicateBranch = async (branch: IBranch) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ene async, trycatch baikh shaardlaggu onComplete, onError ooroo asuudalaa shiidej baigaa
| toast({ | ||
| title: 'Branch deleted successfully', | ||
| }); | ||
| await refetch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eniig refetchQueries ashiglaj shiideh
| </Sheet.View> | ||
| </Sheet> | ||
|
|
||
| <ConfirmationDialog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alert dialog geed component baigaag ashiglah
| ); | ||
|
|
||
| const list = data?.bmsBranchList || []; | ||
| const list = data?.bmsBranchList?.list || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {list, totalCount, pageInfo} = data?. bmsBranchList || {}
| </div> | ||
| </div> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary by Sourcery
Revamp the tourism plugin UI by overhauling form fields, branch listing, and CRUD flows, introducing new components, pagination, and preview functionality.
New Features:
Enhancements:
Important
Revamp tourism plugin UI with new features, improved forms, and enhanced data handling.
BranchList.tsxandConfirmationDialog.tsx.CreateTmsForm.tsxandCreateTmsSheet.tsx.PreviewPage.tsx.TmsInformationFields.tsx.BranchCard,ActionMenu,ConfirmationDialog,PaymentIcon.queries.tsandBranchList.ts.TmsFormFields.tsx.formSchema.ts.This description was created by
for b05a318. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Style
Chores