Getting Started with CQS
Main Features:
-
User Role Handling:
- Redirects users based on role (e.g.,
procurement_manager) viarouter.push.
- Redirects users based on role (e.g.,
-
Procurement Categories & Templates:
- Fetches procurement categories and related templates from external services.
- Handles
selectedProcurementActivityand filters available processes accordingly.
-
Tender Editing:
- Fetches and displays details of an existing tender when an
editTenderParamis provided. - Dynamically updates states like
selectedProcess,selectedProcurementActivity, andparentCategory.
- Fetches and displays details of an existing tender when an
-
Dynamic Process Tabs:
- Based on the procurement process type (
DSSP,CQS,RFQ), it sets thecurrentTabfor the tender process flow. - Displays the relevant components for each process type (
CSQProcess,DSSProcess,RFQProcurementProcess).
- Based on the procurement process type (
-
Data Fetching and State Management:
- Uses multiple
useEffecthooks for:- Fetching procurement categories (
fetchProcurementCategories). - Fetching and updating tender details (
fetchTender). - Updating dynamic fields (
dynamicFieldsTOR,dynamicFieldsEOI). - Updating state based on query parameters (
searchParams).
- Fetching procurement categories (
- Uses multiple
-
Submission Handling:
- Handles final submission of tender data (
submitFinal), including document uploads and routing to the review page.
- Handles final submission of tender data (
-
Error Handling & Loading States:
- Manages loading states (
isLoading,disableBtnLoader) and handles errors gracefully with toast notifications.
- Manages loading states (
-
Procurement Managers & Evaluators:
- Fetches lists of procurement managers and evaluators from the
userServiceand updates state accordingly.
- Fetches lists of procurement managers and evaluators from the
Key Functions:
fetchTender: Fetches details of an edited tender and redirects to a new route.fetchProcurementCategories: Fetches procurement categories and processes, and updates relevant states likeavailableProcurementActivity.submitFinal: Submits the final tender data and related documents.extractParentZero: Extracts procurement activities with aparent_idof"0".nextStep/prevStep: Placeholder functions for handling process steps.fetchProcurementManagersList: Fetches and updates lists of procurement managers and evaluators.
Key Components:
TenderProgressBar: Displays a progress bar for the current tender process.ProcessDecider,CSQProcess,DSSProcess,RFQProcurementProcess: Conditional components for different procurement processes.
Example Usage:
// Example of conditional rendering based on currentTab:{currentTab === 0 && <ProcessDecider {...props} />}{currentTab === 1 && <CSQProcess {...props} />}{currentTab === 2 && <DSSProcess {...props} />}{currentTab === 3 && <RFQProcurementProcess {...props} />}