Commit Graph

131 Commits

Author SHA1 Message Date
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
AmirReza Jamali ae89c45a7e feat(notifications): Implement notification details page and card
This commit introduces a dedicated page for viewing the full details of a notification and refactors the related UI components for better modularity and user experience.

Key changes include:
- Created a new reusable `NotificationDetailsCard` component to display notification details, decoupling the presentation logic from the page.
- Refactored the notification details page (`/notification-history/[id]`) to use the new card component, resulting in cleaner code.
- Made notification items in the header dropdown clickable, linking each to its respective details page.
- Added a dedicated "Mark as Read" button to each notification item in the dropdown for improved usability.
- Updated the application's global title metadata for branding consistency.
- Added a specific page title for the Tenders page to improve SEO and navigation.
2025-09-30 12:43:41 +03:30
Sina Nakhostin cfb95d3bb1 Merge pull request 'feat(notifications): Implement functional header notification dropdown' (#41) from company-details into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/41
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-29 17:16:27 +03:30
AmirReza Jamali 021ee7d11e feat(notifications): Implement functional header notification dropdown
This commit replaces the static notification dropdown in the header with a fully functional component that fetches live data from the API.

Key features include:
- Fetches and displays the latest notifications.
- Shows a badge with the count of unseen notifications.
- Opens a modal with notification details upon clicking an item.
- Marks notifications as seen when they are viewed.

Additionally, this commit includes several related improvements:
- refactor: Replaced the global loading component with a custom Tailwind CSS spinner for a consistent look and feel.
- feat: Enhanced the DatePicker component to optionally include a time picker.
- style: Improved the layout of the notification details page by moving the message to a dedicated section and capitalizing the 'priority' and 'type' fields for better readability.
2025-09-29 15:28:16 +03:30
Nima Nakhsotin 7ba69706ab Merge pull request 'fix: Prevent edit page crash and correct date formatting' (#39) from company-details into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/39
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-29 10:27:26 +03:30
AmirReza Jamali dde2fc5a05 fix: Prevent edit page crash and correct date formatting
On the company edit page, added optional chaining to the `defaultValues` prop. This prevents a potential runtime error if the company data is undefined when the page loads.

Additionally, this commit corrects the `unixToDate` utility function. The previous logic could incorrectly include 'false' in the format string when time was not required. It now uses a ternary operator to conditionally add the time format, ensuring correct output.

Minor code formatting adjustments are also included.
2025-09-28 23:19:12 +03:30
AmirReza Jamali 120331a886 fixed create notification validations 2025-09-28 16:35:22 +03:30
AmirReza Jamali 697921d3ee add multi date picker in package json file 2025-09-28 11:12:14 +03:30
AmirReza Jamali 403e213f8a made date picker a client component 2025-09-28 11:01:29 +03:30
AmirReza Jamali 62ce0692cc date picker 2025-09-28 11:01:05 +03:30
AmirReza Jamali 469ce75d5b made date picker a client component 2025-09-28 10:55:09 +03:30
AmirReza Jamali 711dee4bce fixed build issue 2025-09-28 10:29:16 +03:30
Nima Nakhsotin 9c36f90b46 Merge pull request 'feat(companies): Enhance company forms with additional fields' (#38) from create-notification into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/38
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-27 23:25:24 +03:30
AmirReza Jamali bb56e1013a feat(companies): Enhance company forms with additional fields
This commit expands the company profile by adding several new fields to the create and edit forms. This allows for the collection of more detailed and comprehensive company information.

Key changes include:
- Added new fields: Establishment Date, Company Type, Business Nature, Industry, Country, State, and City.
- Introduced a new reusable `DatePicker` component, utilizing `react-datepicker`, for date input.
- Created a new `CalendarIcon` for use in the date picker.
- Updated the company Zod schema, API services, and data types to support the new fields.

Additionally, this commit includes a refactor to standardize the `MultiSelect` component by renaming the `text` prop to `label` for better consistency across form elements. Form labels are now capitalized for a uniform UI.
2025-09-27 16:33:13 +03:30
Nima Nakhsotin 527d8e7661 Merge pull request 'feat(notifications): add notification history page and API' (#37) from notification-history into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/37
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-27 10:59:15 +03:30
AmirReza Jamali e7089a2e60 refactor(utils): Update date formatters to control time visibility
The `unixToDate` and `msToDate` utility functions have been updated to provide more control over the output format. They now accept an object with a `hasTime` boolean property, allowing the caller to specify whether the time should be included in the formatted date string.

This change was implemented to hide the time portion of the `seen_at` field on the notification details page, displaying only the date. All existing calls to these functions across the application have been updated to use the new signature.
2025-09-27 10:29:28 +03:30
AmirReza Jamali da250b805d feat(ui): add tooltips to action icons in admins table
This commit introduces the `react-tooltip` library to improve user interface clarity and provide a better user experience.

Tooltips have been added to the action icons (Edit, Delete, Change Status) in the Admins table. This provides users with clear, on-hover information about the function of each icon, enhancing usability and reducing ambiguity.

The implementation involved:
- Adding `react-tooltip` as a project dependency.
- Importing the required CSS in the root layout.
- Integrating the `Tooltip` component within the Admins table.
2025-09-26 20:48:59 +03:30
AmirReza Jamali 85d95530a8 feat(notifications): add notification history page and API
This commit introduces the notification history feature, allowing users to view a log of their past notifications.

Key changes include:
- Added a "Notifications" link to the sidebar with a new icon.
- Defined API endpoints for fetching notification history and details.
- Added a "sent" status variant for displaying notification status.

Additionally, this commit includes related UI improvements:
- The user's full name is now dynamically displayed in the header, replacing the hardcoded placeholder.
- Table headers are now styled in uppercase for improved readability and consistency.
2025-09-25 17:09:42 +03:30
Nima Nakhsotin b5d3654360 Merge pull request 'feat(feedback): Add feedback view for companies and customers' (#36) from feedbacks into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/36
2025-09-24 11:57:15 +03:30
AmirReza Jamali 339fb770fa refactor(companies-table): Simplify table and correct cell component
The 'City' and 'Postal Code' columns have been removed from the companies table to simplify the UI and reduce visual clutter. This change is reflected in both the table's JSX structure and the `useCompanyListPresenter` hook that defines the table headers.

Additionally, the `TableHead` component was incorrectly used for data cells within the table body. This has been fixed by replacing it with the semantically correct `TableCell` component.
2025-09-24 11:56:46 +03:30
AmirReza Jamali 3801073fd7 feat: Add loading states and improve form handling
This commit introduces several enhancements to form components and user experience across the application.

- **Sign-in Form:**
  - Implemented a loading state using `useIsMutating` from TanStack Query.
  - The username and password fields are now disabled during the login process to prevent concurrent submissions.
  - The "Sign in" button displays a spinner while the mutation is pending, providing clear visual feedback.

- **Assign to Company Modal:**
  - Refactored the modal to use `react-hook-form` for more robust state management and validation.
  - The form submission button is now disabled while the assignment request is in progress.

- **Tag Input Component:**
  - Added a new `shouldAddWithSpace` prop to allow creating tags by pressing the space bar, increasing the component's flexibility.

- **Header:**
  - Corrected the image path for the mobile header logo to display the correct icon.
2025-09-24 10:45:45 +03:30
AmirReza Jamali 708f35cf02 changed icons 2025-09-23 15:57:51 +03:30
AmirReza Jamali c146f1175c fixed: edit customer company not appearing 2025-09-23 15:25:30 +03:30
AmirReza Jamali 14f36827ab feat(feedback): Add feedback view for companies and customers
This commit introduces the ability to view feedback associated with specific companies and customers directly from their respective tables.

To support this, the `TenderFeedbackTable` has been refactored into a more generic `FeedbackTable` component. This new component accepts a `paramKey` prop (e.g., "tender_id", "company_id") to filter feedback for different entities.

A new feedback icon has been added to the actions column in both the Companies and Customers tables, providing a direct link to the feedback page for each entry.
2025-09-23 15:08:37 +03:30
Nima Nakhsotin 8cf8e4f5b2 Merge pull request 'sidebar-issues' (#35) from sidebar-issues into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/35
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-23 13:36:35 +03:30
AmirReza Jamali 0fda25f339 fixed minor issues 2025-09-23 13:30:07 +03:30
AmirReza Jamali 3276bc80e4 feat(sidebar): Add support for multi-level nested navigation
This commit refactors the sidebar component to support arbitrarily deep nested navigation items.

The previous implementation was limited to one level of nesting and contained complex rendering logic directly within the main component, making it difficult to extend and maintain.

Changes include:
- Extracted the rendering logic into a new recursive `MenuItem` component.
- Rewrote the effect that keeps the active path expanded to correctly handle multiple levels of nesting.
- Updated the navigation data structure to reflect the new capabilities and corrected the URL for "Company Categories".
- Removed a large block of commented-out, unused navigation data.
2025-09-23 13:14:02 +03:30
Sina Nakhostin c626baff21 Merge pull request 'feat(feedback): add feedback button to tenders table' (#34) from tender-feedbacks into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/34
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-23 12:55:49 +03:30