Commit Graph

254 Commits

Author SHA1 Message Date
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
AmirReza Jamali 1d944739bc feat(feedback): add feedback button to tenders table
This commit introduces the ability for users to navigate to a feedback page directly from the tenders list.

A new feedback icon and a corresponding button have been added to the actions column of the tenders table. Clicking this button redirects the user to the feedback page associated with that specific tender.

To support this feature, the following changes were made:
- Added a new `FeedbackIcon` SVG component.
- Defined API endpoints and created query hooks for the feedback module.
- Fixed a query key inconsistency for company details to ensure data is correctly refetched after updates.
2025-09-23 11:16:02 +03:30
AmirReza Jamali 0abfdde285 Merge branch 'develop' into tender-feedbacks 2025-09-23 11:15:33 +03:30
AmirReza Jamali dd0cbb8e29 fixed: force issues 2025-09-22 14:57:29 +03:30
AmirReza Jamali e50990b912 removed switches from test page 2025-09-22 10:07:09 +03:30
Nima Nakhsotin fe00ee56ec Merge pull request 'feat(admins): implement admin status management' (#33) from change-admin-status into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/33
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-21 13:23:53 +03:30
AmirReza Jamali 1d78b2b65d feat(admins): implement admin status management
This commit introduces the functionality for super admins to change the status of other admin users to either 'Active' or 'Inactive'. This provides better control over admin account access.

Key changes include:
- A 'Status' column with a visual badge has been added to the admins table.
- A new 'Change Status' action button, using a new `UserSettingIcon`, opens a modal for status updates.
- The backend service and frontend mutation for updating an admin's status are implemented.
- The `IUser` type and a new `AdminStatus` enum have been added to support this feature.

Additionally, the confirmation modal implementation has been simplified across the admin and customer tables by removing the `modalConfig` state.
2025-09-21 13:18:53 +03:30
Nima Nakhsotin e00e75b8be Merge pull request 'fix(auth, customers): Refresh page on logout and rename form field' (#32) from rename-company-field into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/32
Reviewed-by: Nima Nakhsotin <n.nakhostin@ravanertebat.com>
2025-09-21 13:15:40 +03:30
AmirReza Jamali b8175e3b63 fix(auth, customers): Refresh page on logout and rename form field
This commit introduces two main improvements: ensuring a clean state after user logout and enhancing the clarity of the customer creation form.

The logout function in the `UserContext` now calls `router.refresh()`. This forces a page reload, preventing the user from seeing stale, authenticated data after logging out.

Additionally, the form field for assigning companies to a customer has been renamed from `company_ids` to `companies` in both the form component and the Zod validation schema. This refactoring improves code clarity and consistency. A related `console.log` statement was also removed.
2025-09-21 09:58:27 +03:30
Sina Nakhostin 17ef40eed7 Merge pull request 'refactor(forms): Enhance MultiSelect with controlled state and styling' (#31) from tag-input into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/31
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-20 20:07:43 +03:30
AmirReza Jamali 28d4a11005 refactor (forms): add form footer buttons 2025-09-20 19:53:03 +03:30
AmirReza Jamali 2f1229202a remove customer mobile field 2025-09-20 19:43:33 +03:30
AmirReza Jamali 4a7a1c66f7 Add: shared skeleton, dark toggle bg, fixed: multi select patching issue 2025-09-20 19:35:58 +03:30
AmirReza Jamali 0ea2ff635b refactor(forms): Enhance MultiSelect with controlled state and styling
This commit overhauls the `MultiSelect` component to improve its functionality, flexibility, and integration with form libraries.

The component is now a controlled component, accepting a `value` prop and using the `onChange` handler to propagate updates. This allows for seamless integration with libraries like React Hook Form.

Key changes include:
- Added `value`, `disabled`, `active`, and `height` props for more granular control over the component's state and appearance.
- Refactored styling logic to use the `cn` utility for cleaner conditional class management.
- Simplified the internal JSX structure and SVGs for better readability and maintenance.
- Updated the component's state management to correctly reflect the incoming `value` prop.
2025-09-20 18:28:53 +03:30
AmirReza Jamali e6493f5d83 feat(form): add loading state and replace custom switch component
This commit introduces a loading state for form submissions and replaces the custom switch component with a third-party library for improved user experience and maintainability.

- Adds `react-switch` as a dependency to replace the custom-built switch component, providing a more robust and feature-rich solution.
- Implements a loading indicator on form submission buttons and in the confirmation modal by utilizing the `useIsMutating` hook from TanStack Query. This provides clear visual feedback to the user during asynchronous operations.
- Creates a reusable `FormFooter` component to encapsulate the submit and cancel buttons, centralizing the form submission logic and loading state.
- Refactors the company create/edit forms to use the new `FormFooter` and `react-switch` components.
- Moves the `BreadcrumbItem` type to a shared types file for better code organization.
2025-09-20 16:13:04 +03:30
Sina Nakhostin 2c43e945c2 Merge pull request 'feat(submissions): Implement submissions page with paginated table' (#30) from tender-details-page into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/30
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-20 15:55:53 +03:30
AmirReza Jamali 5aa6111460 fix(tenders): Hide empty submission URL and adjust section spacing
The "Submission Url" section on the tender details page was being rendered even when the URL was null or empty, leading to a visually broken component.

This commit wraps the "Submission Url" section in a conditional check to ensure it only renders when a URL is present.

Additionally, a `gap-2` utility has been added to the flex containers to improve the visual separation between detail sections.
2025-09-18 16:55:53 +03:30
AmirReza Jamali e1898bf259 feat(submissions): Implement submissions page with paginated table
This commit introduces a new page for users to view their submissions in a structured and paginated table. This allows users to easily track their submission history and access key details.

The main changes include:
- A new page at `/submissions` to display the submissions list.
- A `SubmissionsTable` component to render submission data, including title, country, status, and a link to the submission URL.
- Integration of `react-paginate` to handle navigation through large sets of data.
- A new `useSubmissions` custom hook using TanStack Query for efficient, paginated data fetching from the API.
- Addition of the `currency-symbol-map` dependency to display prices with the correct currency symbol.
2025-09-18 16:52:46 +03:30
Sina Nakhostin 2f2114eba9 Merge pull request 'refactor(logo): Update main logo SVG to use currentColor' (#29) from required-field-stars into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/29
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-17 11:17:21 +03:30
AmirReza Jamali 4fb1a931c5 refactor(logo): Update main logo SVG to use currentColor
The main logo SVG has been replaced with an updated version.

The previous logo had hardcoded fill colors, making it difficult to adapt to different color schemes, such as light and dark modes.

The new SVG uses `fill="currentColor"`, which allows its color to be controlled via the parent element's CSS `color` property. This makes the logo easily themeable and more flexible for use throughout the application.
2025-09-16 18:31:33 +03:30
AmirReza Jamali 2fa774b6bd feat(companies): implement companies page with data table
This commit introduces a new "Companies" page to the dashboard, providing a comprehensive view of company data in a sortable and paginated table.

Key changes include:
- A new page at `/companies` to display the data table.
- A new API route `/api/companies` that serves mock company data.
- A `CompaniesTable` component built with `react-table` featuring sorting, pagination, and search functionality.
- Reusable `TablePagination` and `TableActions` components to support the table.
- The `moment` library has been added as a dependency to format dates within the table.
- A new `CrossIcon` has been added for UI controls.
- The `InputGroup` component is enhanced with an `autoComplete` prop.
- A link to the new "Companies" page has been added to the sidebar navigation.
2025-09-16 16:01:59 +03:30
AmirReza Jamali feac2ddcb9 fixed .env file 2025-09-09 17:20:04 +03:30
AmirReza Jamali 274b48007d build: Allow .env.production to be committed
Modify the .gitignore file to explicitly un-ignore the `.env.production` file.

This allows the production environment configuration to be version-controlled, ensuring it is available for build and deployment processes.
2025-09-09 16:57:28 +03:30
Sina Nakhostin a7c60df3b8 Merge pull request 'Fixed build issues' (#28) from drone-and-docker into develop
Reviewed-on: https://repo.ravanertebat.com/TM/tm_panel/pulls/28
Reviewed-by: Sina Nakhostin <s.nakhostin@ravanertebat.com>
2025-09-09 14:06:21 +03:30
AmirReza Jamali 6298acd14d Merge remote-tracking branch 'origin/develop' into drone-and-docker 2025-09-09 13:34:24 +03:30
AmirReza Jamali 83bd4394fc Fixed build issues 2025-09-09 13:32:58 +03:30
n.nakhostin d030bb59b6 Add Dockerfile for multi-stage build setup with Node.js 2025-09-09 12:21:24 +03:30
n.nakhostin c8c1490ceb Update drone configuration to trigger builds on 'main' and 'develop' branches 2025-09-09 12:18:48 +03:30