-
+
Tour management system
-
+
A tour management system is software designed to organize and manage
tourism-related activities. It helps streamline trip planning,
booking, payment management, customer information, and travel
diff --git a/frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx b/frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx
new file mode 100644
index 0000000000..af0c8428b0
--- /dev/null
+++ b/frontend/plugins/tourism_ui/src/modules/tms/components/PaymentIcon.tsx
@@ -0,0 +1,63 @@
+import React from 'react';
+import {
+ IconCreditCard,
+ IconCashBanknote,
+ IconBuilding,
+ IconPhone,
+ IconBrandVisa,
+ IconBrandMastercard,
+ IconFile,
+} from '@tabler/icons-react';
+
+export const paymentIconOptions = [
+ { value: 'visa', label: 'Visa' },
+ { value: 'mastercard', label: 'Mastercard' },
+ { value: 'cash', label: 'QPay' },
+ { value: 'bank', label: 'SocialPay' },
+ { value: 'credit-card', label: 'Credit Card' },
+ { value: 'mobile', label: 'Mobile Payment' },
+];
+
+interface PaymentIconProps {
+ iconType: string;
+ size?: number;
+ className?: string;
+}
+
+const PaymentIcon: React.FC = ({
+ iconType,
+ size = 16,
+ className = '',
+}) => {
+ const getIcon = () => {
+ switch (iconType) {
+ case 'credit-card':
+ return ;
+ case 'cash':
+ return ;
+ case 'bank':
+ return ;
+ case 'mobile':
+ return ;
+ case 'visa':
+ return (
+
+ );
+ case 'mastercard':
+ return (
+
+ );
+ case 'sign-alt':
+ return ;
+ default:
+ return ;
+ }
+ };
+
+ return getIcon();
+};
+
+export default PaymentIcon;
diff --git a/frontend/plugins/tourism_ui/src/modules/tms/components/Preview.tsx b/frontend/plugins/tourism_ui/src/modules/tms/components/Preview.tsx
deleted file mode 100644
index 53d4896ef9..0000000000
--- a/frontend/plugins/tourism_ui/src/modules/tms/components/Preview.tsx
+++ /dev/null
@@ -1,217 +0,0 @@
-import {
- IconDeviceDesktop,
- IconDeviceMobile,
- IconDeviceTablet,
- IconWifi,
- IconAntennaBars5,
- IconBattery,
-} from '@tabler/icons-react';
-import { Button, Input } from 'erxes-ui';
-import { useState } from 'react';
-import { TmsFormType } from '@/tms/constants/formSchema';
-
-type DeviceType = 'desktop' | 'mobile' | 'tablet';
-
-interface PreviewProps {
- formData?: Partial;
-}
-
-export default function Preview({ formData }: PreviewProps) {
- const [activeDevice, setActiveDevice] = useState('desktop');
-
- const tourName = formData?.name || 'Таны тур оператор';
- const themeColor = formData?.color || '#4F46E5';
- const logoUrl =
- formData?.logo ||
- 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTbvwVAC3F5xurW6mtfMrEoeWvuQpisg17tNg&s';
-
- const renderLoginForm = () => {
- return (
-
-
-

-
-
-
-
- Sign in to your account
-
-
- Enter your email and password below to access your account.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Forgot password?
-
-
-
-
-
-
- );
- };
-
- const renderDeviceFrame = () => {
- switch (activeDevice) {
- case 'desktop':
- return (
-
-
-
-
- {renderLoginForm()}
-
-
-
- );
-
- case 'mobile':
- return (
-
- {/* Status bar */}
-
- {/* Notch */}
-
- {/* Content */}
-
-
-
- {renderLoginForm()}
-
-
-
- {/* Home indicator */}
-
-
- );
-
- case 'tablet':
- return (
-
- {/* Status bar */}
-
- {/* Content */}
-
- {/* Home button */}
-
-
- );
- }
- };
-
- return (
-
-
- {(['desktop', 'mobile', 'tablet'] as DeviceType[]).map((device) => (
-
setActiveDevice(device)}
- >
- {device === 'desktop' && (
-
- )}
- {device === 'mobile' && (
-
- )}
- {device === 'tablet' && (
-
- )}
-
- {device.charAt(0).toUpperCase() + device.slice(1)}
-
-
- ))}
-
-
-
- {renderDeviceFrame()}
-
-
- );
-}
diff --git a/frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx b/frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
index 2f01801ef1..77d39e87b1 100644
--- a/frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
+++ b/frontend/plugins/tourism_ui/src/modules/tms/components/TmsFormFields.tsx
@@ -1,7 +1,19 @@
+'use client';
+
+import { useState } from 'react';
import { Control, useFieldArray } from 'react-hook-form';
-import { Button, Form, Input, Select, Upload } from 'erxes-ui';
+import { Button, Form, Input, Select, Upload, ColorPicker } from 'erxes-ui';
import { TmsFormType } from '@/tms/constants/formSchema';
-import { IconUpload, IconPlus, IconTrash } from '@tabler/icons-react';
+import {
+ IconUpload,
+ IconPlus,
+ IconTrash,
+ IconLoader2,
+} from '@tabler/icons-react';
+import PaymentIcon, { paymentIconOptions } from '@/tms/components/PaymentIcon';
+import { SelectMember } from 'ui-modules';
+import { useQuery } from '@apollo/client';
+import { PAYMENT_LIST } from '@/tms/graphql/queries';
export const TourName = ({ control }: { control: Control }) => {
return (
@@ -11,10 +23,16 @@ export const TourName = ({ control }: { control: Control }) => {
render={({ field }) => (
- Tour Name *
+ Name *
-
+ {
+ field.onChange(e);
+ }}
+ />
@@ -31,20 +49,17 @@ export const SelectColor = ({ control }: { control: Control }) => {
render={({ field }) => (
- Main color *
+ Main color *
-
-
-
+ {
+ field.onChange(value);
+ }}
+ className="w-24"
+ />
@@ -54,6 +69,8 @@ export const SelectColor = ({ control }: { control: Control }) => {
};
export const LogoField = ({ control }: { control: Control }) => {
+ const [isLoading, setIsLoading] = useState(false);
+
return (
}) => {
{
if ('url' in fileInfo) {
@@ -74,28 +90,55 @@ export const LogoField = ({ control }: { control: Control }) => {
}
}}
>
-
-
-
-
-
+ ) : (
+ <>
+ setIsLoading(true)}
+ onAllUploadsComplete={() => setIsLoading(false)}
+ />
+
+
+
+ Upload logo
+
+
+ Max size: 15MB, File type: PNG
+
+
+ >
+ )}
@@ -109,6 +152,8 @@ export const FavIconField = ({
}: {
control: Control;
}) => {
+ const [isLoading, setIsLoading] = useState(false);
+
return (
-
-
-
-
-
-
- Upload favicon
+ {isLoading ? (
+
+ ) : field.value ? (
+
+
+ setIsLoading(true)}
+ onAllUploadsComplete={() => setIsLoading(false)}
+ />
+
+
{
+ field.onChange('');
+ }}
+ >
+
-
-
- Max size: 15MB, File type: PNG
-
-
-
- {field.value && (
-
- )}
-
+
+ ) : (
+ <>
+ setIsLoading(true)}
+ onAllUploadsComplete={() => setIsLoading(false)}
+ />
+
+
+
+ Upload favicon
+
+
+ Max size: 15MB, File type: PNG
+
+
+ >
+ )}
@@ -161,14 +232,7 @@ export const FavIconField = ({
);
};
-const TestGeneralManager = [
- { label: 'Bold Bold', value: '1' },
- { label: 'Bat Bat', value: '2' },
- { label: 'Toroo Toroo', value: '3' },
- { label: 'Temuulen Temuulen', value: '4' },
-];
-
-export const GeneralManeger = ({
+export const GeneralManager = ({
control,
}: {
control: Control;
@@ -176,54 +240,22 @@ export const GeneralManeger = ({
return (
(
- General maneger
+ General Managers
- General maneger can be shown on the top of the post also in the list
+ General manager can be shown on the top of the post also in the list
view
-
+
+
+
+
+
)}
@@ -231,64 +263,25 @@ export const GeneralManeger = ({
);
};
-const TestManegers = [
- { label: 'Bold Bold', value: '1' },
- { label: 'Bat Bat', value: '2' },
- { label: 'Toroo Toroo', value: '3' },
- { label: 'Temuulen Temuulen', value: '4' },
-];
-
-export const Maneger = ({ control }: { control: Control }) => {
+export const Manager = ({ control }: { control: Control }) => {
return (
(
- Manegers
+ Managers
- Maneger can be shown on the top of the post also in the list view
+ Manager can be shown on the top of the post also in the list view
-
+
+
+
+
+
)}
@@ -296,13 +289,11 @@ export const Maneger = ({ control }: { control: Control }) => {
);
};
-const TestPayments = [
- { value: '1', label: 'Visa' },
- { value: '2', label: 'Qpay' },
- { value: '3', label: 'Mastercard' },
-];
-
export const Payments = ({ control }: { control: Control }) => {
+ const { data, loading } = useQuery(PAYMENT_LIST);
+ const payments = data?.payments ?? [];
+ const isEmpty = !loading && payments.length === 0;
+
return (
}) => {
Select payments that you want to use
-
-
-