diff --git a/package.json b/package.json index e362489..1d5fb64 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", + "buildOnly": "vite build", "lint": "eslint .", "preview": "vite preview" }, diff --git a/src/modules/dashboard/pages/step-form/dynamic-form.tsx b/src/modules/dashboard/pages/step-form/dynamic-form.tsx index d551527..fd4de8a 100644 --- a/src/modules/dashboard/pages/step-form/dynamic-form.tsx +++ b/src/modules/dashboard/pages/step-form/dynamic-form.tsx @@ -75,10 +75,10 @@ const DynamicForm: FC = ({ fields, processId, stepId }) => { field.Type === FieldTypes.پول) && typeof value === "number" ) { - if (field && field.MinValue !== undefined && value < field?.MinValue) { + if (field && field.MinValue !== undefined) { return `مقدار باید بزرگتر یا مساوی ${field.MinValue} باشد.`; } - if (field && field.MaxValue !== undefined && value > field?.MaxValue) { + if (field && field.MaxValue !== undefined) { return `مقدار باید کوچکتر یا مساوی ${field.MaxValue} باشد.`; } } diff --git a/src/modules/dashboard/pages/step-form/index.tsx b/src/modules/dashboard/pages/step-form/index.tsx index 00b3c25..c83fc0e 100644 --- a/src/modules/dashboard/pages/step-form/index.tsx +++ b/src/modules/dashboard/pages/step-form/index.tsx @@ -27,7 +27,7 @@ const StepFormPage: FC = () => { useEffect(() => { if (data && data.Fields) { const processedFields: LocalFieldDefinition[] = data.Fields.map((el) => { - const field: LocalFieldDefinition = { + const field: any = { ID: el.ID, Name: el.Name, LatinName: el.LatinName, diff --git a/src/modules/dashboard/pages/steps/index.tsx b/src/modules/dashboard/pages/steps/index.tsx index 2e3a36c..89ec8e4 100644 --- a/src/modules/dashboard/pages/steps/index.tsx +++ b/src/modules/dashboard/pages/steps/index.tsx @@ -10,10 +10,9 @@ const StepsPage: FC = () => { const { campaignId } = useParams<{ campaignId: string }>(); const navigate = useNavigate(); const [steps, setSteps] = useState([]); - const [selectedStepId, setSelectedStepId] = useState(null); const { data, isLoading, error } = useQuery>({ queryKey: ["dynamic-step"], - queryFn: () => getCampaignStepsService(campaignId!), + queryFn: () => getCampaignStepsService(), }); useEffect(() => { @@ -165,11 +164,7 @@ const StepsPage: FC = () => { focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-opacity-50 transition-all duration-300 ease-in-out transform - ${ - selectedStepId === step.stageID - ? "bg-blue-50 border-blue-500 ring-2 ring-blue-500 ring-opacity-75 scale-105" - : "hover:scale-102" - } + `} onClick={() => handleStepClick(step)} tabIndex={0} // Make list item focusable @@ -180,11 +175,7 @@ const StepsPage: FC = () => { w-10 h-10 sm:w-12 sm:h-12 rounded-full font-bold text-lg sm:text-xl mr-4 sm:mr-6 shrink-0 - ${ - selectedStepId === step.stageID - ? "bg-blue-600 text-white" - : "bg-gray-200 text-gray-700" - } + transition-all duration-300 ease-in-out `} > @@ -194,11 +185,7 @@ const StepsPage: FC = () => {

diff --git a/src/modules/dashboard/service/campaigns.service.ts b/src/modules/dashboard/service/campaigns.service.ts index 888e437..ba39381 100644 --- a/src/modules/dashboard/service/campaigns.service.ts +++ b/src/modules/dashboard/service/campaigns.service.ts @@ -324,9 +324,9 @@ export const createCircleService = async ( return res.data; }; -export const getCampaignStepsService = async ( - campaignId: string -): Promise> => { +export const getCampaignStepsService = async (): Promise< + Record +> => { const query = { ProcessName: "run_process", OutputFields: ["*"],