Commit Graph

208 Commits

Author SHA1 Message Date
AmirReza Jamali a8d95d5f92 feat(contact-us): Add filtering functionality to contact us list table
- Enable Contact Us navigation menu item in sidebar with visible flag set to true
- Create TContacts type schema with Zod validation for API responses
- Add type safety to contactUsService.getAllContactUs() with return type annotation
- Implement contact list table rendering with proper data mapping
- Display contact information columns: full name, email, status, phone, created date
- Add date formatting using unixToDate utility for created_at timestamps
- Update useContactUsListPresenter to return properly structured contacts data
- Refactor table columns array to include all contact detail fields
- Follows established pattern from recent filtering feature implementations
2025-11-23 13:17:00 +03:30
AmirReza Jamali cf3a931cef fix(customers): improve type safety in assign to company modal
- Add ChangeEvent import for proper TypeScript typing
- Remove unused register function from useForm hook
- Refactor onChange handler with explicit ChangeEvent<HTMLSelectElement> type annotation
- Extract target value into variable for improved readability
- Ensure consistent form field updates between setValue and setCompanies calls
- Improve type safety and reduce potential runtime errors in form handling
2025-11-23 11:40:40 +03:30
AmirReza Jamali 88807b6b42 fix(customers): improve form field binding in assign to company modal
- Remove unused FormErrorMessages import
- Add watch and setValue hooks from useForm for better form state management
- Implement useEffect to properly initialize company_ids field with default values
- Replace register-based validation with controlled component pattern
- Move onChange handler from register to Select component onChange prop
- Add selectedCompanyId state tracking using watch hook
- Change required validation from register config to component prop
- Improve form field synchronization between react-hook-form and component state
2025-11-23 11:16:32 +03:30
AmirReza Jamali b9b05b438a fix(notifications): ensure schedule_at field has default value on submit
- Add default value of 0 for schedule_at field when not provided
- Restructure credentials object to explicitly set schedule_at before mutation
- Prevent undefined values from being sent to the API when schedule_at is empty
2025-11-23 11:10:25 +03:30
AmirReza Jamali a348124d50 fix(customers): improve form field value binding and import organization
- Reorganize imports in alphabetical order for better maintainability
- Add value binding to role select field using watch hook for proper form state synchronization
- Add value binding to type select field using watch hook for consistent form behavior
- Ensure form fields properly reflect current values during editing and user interaction
2025-11-23 11:06:39 +03:30
Sina Nakhostin f8b9fac8e0 Merge pull request 'feat(cms): Add filtering functionality to CMS list table' (#51) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/51
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-23 10:58:44 +03:30
AmirReza Jamali 410ca5a737 feat(cms): Add filtering functionality to CMS list table
- Create CmsListFilters component with search and key filter fields
- Add filter modal to CMS table with open/close functionality
- Implement useForm hook integration for filter form management
- Update useCmsTablePresenter to handle filter state and search logic
- Modify useGetCmsList query hook to accept and pass filter parameters
- Update cms-service.getCms method to support query parameters
- Add URL-based query string management for filter persistence
- Integrate filter button in ListHeader component
- Add isMutating state tracking for loading indicator during search
2025-11-23 10:51:55 +03:30
Sina Nakhostin 12017dc746 Merge pull request 'table-filter' (#50) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/50
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-22 16:39:17 +03:30
AmirReza Jamali e13527fe81 feat(company-categories): Add filtering functionality to category list table
- Create CompanyCategoryListFilters component with search and published status filters
- Integrate ListHeader component to replace inline create button
- Add filter modal with form handling and submission logic
- Implement useForm hook for filter form state management
- Add search parameter synchronization with URL query params
- Support clearing individual filter fields and resetting filters
- Add loading state indicator during filter search operations
- Maintain consistency with existing filtering patterns used in companies and tenders tables
2025-11-22 15:54:31 +03:30
AmirReza Jamali 62981e83e9 feat(companies): Add filtering functionality to company list table
- Create CompanyListFilters component with form fields for name, email, phone, currency, and employee count
- Integrate filter modal into CompaniesTable component with open/close state management
- Update useCompanyListPresenter hook to handle filter form state and search parameters
- Replace inline create button with ListHeader component for consistent UI patterns
- Add support for URL-based query parameters to persist filter state
- Implement form reset and filter clearing functionality
- Add isMutating state tracking for loading indicators during filter searches
- Update constants/enums to support currency filtering optionsfor
2025-11-22 15:48:34 +03:30
AmirReza Jamali 7005ab67b7 feat(customers): Add filtering functionality to customer list table
- Create new CustomerListFilters component with status, role, and type filter options
- Integrate filter modal into customer list table with open/close functionality
- Add filter form handling with react-hook-form for managing filter state
- Implement search functionality triggered by filter form submission
- Add EmptyListWrapper component to display message when no customers found
- Replace inline create button with reusable ListHeader component
- Add clearable select fields for better filter UX
- Update customer table to safely handle optional customer properties
- Add new CustomerStatus and CustomerType enums to support filtering options
- Improve table organization with proper imports and component structure
2025-11-22 15:22:44 +03:30
AmirReza Jamali 1407d93704 feat(tenders): Add filtering functionality to tender list table
- Create new TenderListFilters component with title, status, and country code filter fields
- Add filter modal to TendersTable component with open/close state management
- Implement useForm hook in useTenderListPresenter for filter form handling
- Add ListHeader component with filter button to tender table
- Replace debounced search with URL search params-based filtering
- Integrate filter form submission with tender query parameters
- Add isMutating state tracking for loading indicator during filter operations
- Remove deprecated useDebounce hook and search state from presenter
- Improve filter UX with modal dialog and clear button functionality
2025-11-22 15:14:19 +03:30
AmirReza Jamali 62f3b49ed4 feat: add HTML sanitization for notification messages
Implement sanitizeHtmlWithStyles utility to safely render HTML content in notification messages while removing dangerous tags and attributes. Update NotificationDetailsCard to use dangerouslySetInnerHTML with sanitization for message display.
2025-11-15 13:28:30 +03:30
Sina Nakhostin f960d79307 Merge pull request 'fix: add null checks for document and firebase messaging to prevent SSR errors' (#49) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/49
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-15 12:32:34 +03:30
AmirReza Jamali 1d1027fab4 fix: add null checks for document and firebase messaging to prevent SSR errors
Added defensive programming by adding null checks for document object before accessing its properties and methods across multiple components (MultiSelect, ConfirmationModal, Dropdown, Modal). Also implemented lazy initialization for Firebase messaging to prevent SSR-related errors and ensure messaging is only initialized on the client side. These changes improve server-side rendering compatibility and prevent potential runtime errors.
2025-11-15 12:22:30 +03:30
Sina Nakhostin 04a8d4634a Merge pull request 'fixing build issue' (#48) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/48
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-15 10:32:56 +03:30
AmirReza Jamali 5e60a292f5 fixing build issue 2025-11-15 10:31:05 +03:30
Sina Nakhostin 940cf3f8ae Merge pull request 'refactor(marketing): Update form field names to use snake_case for consistency' (#47) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/47
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-11 13:54:40 +03:30
AmirReza Jamali 6bd44e78a0 refactor(marketing): Update form field names to use snake_case for consistency 2025-11-11 13:00:50 +03:30
Sina Nakhostin db1ccab2f1 Merge pull request 'table-filter' (#46) from table-filter into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/46
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-11-11 11:55:22 +03:30
AmirReza Jamali e75932d249 refactor(sidebar): Remove commented out Contact Us navigation item
- Commented out the "Contact Us" navigation item in sidebar data
- Removed unused navigation entry to clean up sidebar configuration
- Maintains existing navigation structure while reducing clutter
2025-11-11 10:52:45 +03:30
AmirReza Jamali bd79b7ed14 refactor(marketing): Standardize marketing wizard steps with initial data support
- Add support for initial data in all marketing wizard step components
- Update step presenters to accept and handle initial data
- Modify forwardRef implementations to include initialData prop
- Add TypeScript interfaces for step component props
- Improve type safety and data handling across marketing wizard steps
- Prepare components for edit and create workflows with consistent data management
2025-11-11 10:43:32 +03:30
AmirReza Jamali b444f6a08f feat(cms): Add CMS table with delete and edit functionality
- Implement CMS table with row listing and pagination
- Add delete functionality for CMS entries with confirmation modal
- Introduce edit button to navigate to edit page for specific CMS entry
- Update page type form to include new 'key' field for CMS entries
- Modify CMS service and types to support new data structure
- Enhance table presenter with additional actions and state management
Resolves data management and user interaction improvements for CMS module
2025-11-11 10:12:21 +03:30
AmirReza Jamali 2b9eaa0495 refactor(marketing): Restructure marketing wizard components and improve project organization
- Move all marketing wizard components from `create/_components` to `_components` directory
- Update import paths in `create/page.tsx` to reflect new component locations
- Add countries constant to support country selection in page type configuration
- Minor formatting and cleanup of `.vscode/settings.json`
- Prepare for more modular and consistent component structure in marketing wizard
2025-11-10 12:41:41 +03:30
AmirReza Jamali b8169fbcd9 Add section validations 2025-11-10 09:58:27 +03:30
AmirReza Jamali 5640febf40 feat(cms): Add CMS details page and update related components
- Implement new edit marketing page with dynamic routing
- Update CMS and contact us table components with placeholder content
- Add new query hook for fetching CMS details by ID
- Modify CMS service to support fetching individual CMS details
- Update type definitions for CMS-related data structures
- Add initial breadcrumb navigation for edit marketing page
- Prepare infrastructure for future CMS editing functionality
2025-11-10 09:53:22 +03:30
AmirReza Jamali ed18d86960 feat(marketing): Add page type configuration and validation for marketing wizard
- Add page type selection (company or organization) with dynamic form fields
- Implement conditional validation for company-specific fields (language, company name, country)
- Update HeroStep with URL pattern validation for GIF file input
- Modify page submission to include page type and related configuration data
- Enhance form handling with react-hook-form for page type configuration
- Add input groups and select components for page type configuration section
2025-11-09 17:01:52 +03:30
AmirReza Jamali 4f7b258533 refactor(marketing): Standardize step components and data structure
- Rename field names across step components for consistency
- Update chart step to use more generic data structure
- Modify input field names to follow consistent naming convention
- Refactor chart step to use key-value pairs instead of x-y coordinates
- Update form field names in multiple marketing wizard steps
- Improve type consistency and naming across marketing wizard components
2025-11-09 16:04:52 +03:30
AmirReza Jamali 574a3a20ce refactor(marketing): Standardize step components with forwardRef and data collection
- Add forwardRef to all marketing wizard step components
- Implement useImperativeHandle for consistent data collection across steps
- Remove redundant collectData static methods
- Add displayName to each component for better debugging
- Simplify data retrieval pattern using ref-based getData method
- Remove duplicate code and improve component consistency
- Ensure each step component follows the same structural pattern
2025-11-09 15:02:26 +03:30
AmirReza Jamali cdc8cde6a4 feat(marketing): Refactor marketing wizard steps and add data collection methods
- Moved all marketing wizard step components to `create/_components` directory
- Added `collectData` static method to each step component for data retrieval
- Reorganized file structure to improve component modularity
- Prepared steps for dynamic data collection in wizard workflow
- Added VSCode settings file for project configuration
- Introduced new CMS-related components and services
- Updated API endpoints and added new query hooks
2025-11-09 14:53:36 +03:30
AmirReza Jamali f9bd7fce4b feat(marketing): add footer step with form inputs for email, phone, address, tagline, and copyright 2025-11-05 16:16:53 +03:30
AmirReza Jamali c2a14953d0 feat(marketing): add contacts section and improve checkbox UI
This commit introduces a new "Contacts" section to the marketing page, which is now the fifth step in the page's flow.

Additionally, the Checkbox component has been enhanced with a smooth transition effect on state change. This provides better visual feedback and a more polished user experience.
2025-11-05 15:39:16 +03:30
AmirReza Jamali ad93236594 feat(stepper): add scroll to top on step change
When navigating between steps, the new content could appear below the fold, requiring the user to scroll up manually.

This change introduces an automatic smooth scroll to the top of the page whenever the user navigates to the next or previous step. This improves the user experience by ensuring the start of the new step's content is always visible.
2025-11-05 12:47:53 +03:30
AmirReza Jamali b18aa8eb71 refactor(marketing): Abstract form logic into reusable SectionStep component
Reduces code duplication in the marketing page forms by creating a generic `SectionStep` component. This new component encapsulates the shared UI and logic for sections that include a title, description, and a dynamic list of fields (e.g., feature cards, pricing points).

The `FeaturesStep` component has been refactored to use this new `SectionStep`, resulting in a much cleaner and more maintainable implementation.
2025-11-05 12:44:39 +03:30
AmirReza Jamali 90ca4054d8 feat(marketing): add features step to wizard
This commit replaces the placeholder "Preferences" step in the marketing page's multi-step process with a new, functional "Features" step.

The `FeaturesStep` component is now imported and rendered as the third step, allowing users to add features. The step's title and description have been updated to reflect this change.
2025-11-04 17:04:08 +03:30
AmirReza Jamali 634de17f23 feat(marketing): Implement chart creation step
This commit introduces the second step in the marketing page's stepper, which allows users to create a chart. The previous placeholder content has been replaced with the new `ChartStep` component.

To support form functionality within this new step, the `Button` component has been updated to accept a `type` attribute (`button`, `submit`, `reset`), enabling proper form submission handling.
2025-11-04 15:30:36 +03:30
AmirReza Jamali 2d664795ad feat(sidebar): add calls section to navigation menu
This commit introduces a new "Calls" section to the main sidebar navigation to provide users with access to call logs.

- Adds a new collapsible "Calls" menu item to the sidebar configuration.
- Includes sub-links for "All Calls", "Incoming", "Outgoing", and "Missed" calls.
- Creates new custom icons (GlobeSearch, CallIncome, CallMade, CallMissed, CallReceived) to support the new menu items.
- Updates `apexcharts` and `react-apexcharts` dependencies to newer versions.
2025-11-04 14:12:20 +03:30
AmirReza Jamali 0084b131f8 feat(form): Add controlled mode to Select component
Refactors the `Select` component to support being used as a controlled component by accepting a `value` prop. This allows its state to be managed externally, for example, by React Hook Form.

This change was necessary to properly implement the `clearable` functionality within forms. Previously, clearing the select would only update its internal state, not the form's state.

- Added `value` and `useEffect` to sync with external state.
- Updated the `onClear` handler to propagate the change via `onChange`.
- Modified `AdminListFilters` to use the `Select` component in a controlled manner, passing `watch` and `setValue` from React Hook Form.
- Adjusted the filter layout to be more responsive.
2025-10-13 15:17:18 +03:30
AmirReza Jamali 19a3f72325 feat(admins): Move filter state to URL query params
Refactors the `useAdminsPresenter` hook to manage the admin table's filter and pagination state through URL search parameters instead of local component state.

This change introduces the `useSearchParams` hook to read the state from the URL and a `useEffect` to synchronize it with the component's state and the filter form. The search function now updates the URL using `router.push`, making the URL the single source of truth.

This enables several key improvements:
- Users can now bookmark and share links to filtered views of the admin table.
- The browser's back and forward buttons will correctly navigate through filter changes.
- The filter form state is preserved on page refresh.
2025-10-13 12:43:31 +03:30
AmirReza Jamali f84c21f829 feat(form): Add clearable functionality to Select component
This commit introduces a new `clearable` prop to the `Select` component, allowing users to easily reset its value.

When the `clearable` prop is set to true, a clear button (an 'X' icon) is displayed when an option is selected. Clicking this button resets the select input to its initial placeholder state and triggers an optional `onClear` callback.

To support this, the component's internal state management was refactored to control the input's value.

Additionally, the `AdminListFilters` component has been updated to:
- Utilize the new clearable select for the status filter.
- Consolidate multiple search fields (email, username, full_name) into a single generic "search" input.
- Add explicit "Reset" and "Apply" buttons for better filter management.
2025-10-13 12:26:56 +03:30
AmirReza Jamali 5b73389d64 feat(admins): add filter functionality to admins list
This commit introduces filtering capabilities to the administrators table, allowing users to refine the list based on specific criteria.

A new `ListHeader` component has been implemented, which now contains the "Create Admin" button and a new "Filter" button. Clicking the filter button opens a modal containing the `AdminListFilters` form. The state for managing the filter modal's visibility is handled within the `useAdminsPresenter` hook. A new `FilterIcon` has also been added to support this feature.
2025-10-12 15:20:52 +03:30
Sina Nakhostin 1f17a1c601 Merge pull request 'feat(settings): implement user profile page and notification handler' (#45) from update-profile into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/45
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-10-11 17:15:19 +03:30
AmirReza Jamali 387747b9b0 feat(settings): implement user profile page and notification handler
This commit introduces a new user settings page and enhances push notification functionality.

The new settings page, located at `/pages/settings`, allows users to view and update their personal profile information. It fetches the current user's data and provides a form to edit fields such as name, email, phone number, position, and role. The form is built using `react-hook-form` for state management and validation, and it leverages custom hooks (`useProfileQuery`, `useUpdateProfileQuery`) to interact with the API.

Additionally, a `notificationclick` event listener has been added to the Firebase messaging service worker. This handler improves the user experience for push notifications by focusing on an existing tab with the relevant URL or opening a new one if none exists when a notification is clicked.
2025-10-11 16:41:26 +03:30
Sina Nakhostin 03da4dea8b Merge pull request 'feat(firebase): Add Firebase SDK and initialize Analytics' (#44) from device-token into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/44
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-10-04 11:20:05 +03:30
AmirReza Jamali b58ea368ec feat(firebase): Add Firebase SDK and initialize Analytics
This commit integrates the Firebase SDK into the application to enable Firebase services, starting with Google Analytics.

Key changes include:
- Added the `firebase` package as a dependency.
- Included Firebase project configuration variables in the production environment file.
- Created a new `firebase.ts` utility to centralize Firebase app initialization.
- Integrated the `FirebaseAnalytics` component into the root layout to enable analytics tracking across the entire application.
2025-10-04 09:28:40 +03:30
Sina Nakhostin df8deaee9b Merge pull request 'feat(profile): display dynamic user data from context' (#43) from profile-view into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/43
2025-10-01 11:21:34 +03:30
AmirReza Jamali ba4a12dfc3 feat(notifications): Auto-mark as read and enhance UI
This commit improves the user experience for notifications by automatically marking them as read upon viewing and refining the UI.

- Notifications are now marked as read immediately when the modal is opened, removing the need for an extra confirmation click.
- The "Mark as read" button has been removed from the modal to streamline the user flow.
- In the notification history table, a new reusable `Boolean` component is used to display the 'seen' status, replacing the previous icon-based implementation.
- Long messages in the history table are now truncated to improve readability and prevent layout issues.
- Added hover effects to the notification dropdown list for better visual feedback.
- Standardized the required field indicator color to use the `text-error` class for consistency.
2025-10-01 11:16:17 +03:30
AmirReza Jamali 53db465a24 feat(profile): display dynamic user data from context
The previous profile page was a static placeholder using hardcoded data. This commit refactors the entire component to fetch and display real user information from the `useUser` context, making the page functional.

Key changes include:
- Replaced static `useState` with the `useUser` context hook for data fetching.
- Completely overhauled the UI for a cleaner, more organized, and responsive layout.
- Displays dynamic user details such as full name, email, phone number, and join date.
- Implemented a `Status` component to visually indicate email and phone verification status.
- Added an error fallback for the profile image, showing a default user icon if the image fails to load.
- Removed the previous local state management and image upload logic.
2025-09-30 17:31:02 +03:30
Sina Nakhostin 1ddc1ce0e6 Merge pull request 'feat(notifications): Implement notification details page and card' (#42) from notification-details-redesign into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/42
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-30 13:05:57 +03:30
AmirReza Jamali f76a0c976f made icons bigger 2025-09-30 12:53:05 +03:30