Commit graph

677 commits

Author SHA1 Message Date
Ashwin Kumar
66f5ea77e7
Merge pull request #751 from Rohit10jr/fix/leads-detail-404
fix(leads): return 404 instead of 500 for an unknown lead on comment/attachment POST
2026-08-12 22:52:56 +05:30
Ashwin Kumar
96d19c749c
Merge pull request #750 from Rohit10jr/fix/api-settings-list-id
fix(api-settings): include id in the list serializer
2026-08-12 22:45:52 +05:30
Ashwin Kumar
0875185804
Merge pull request #752 from Django-CRM/dev
chore: update project version to 1.3.1 and enhance description in pyp…
2026-08-12 22:19:59 +05:30
Ashwin
2226887224 chore: update project version to 1.3.1 and enhance description in pyproject.toml; add shared testing fixtures and improve CodeQL workflow 2026-08-12 22:19:21 +05:30
Rohit10jr
43745f16c9 fix(leads): 404 instead of 500 on unknown lead in comment/attachment POST 2026-08-12 21:32:46 +05:30
Rohit10jr
6f0b9b830c fix(api-settings): include id in the list serializer so rows can be edited/deleted 2026-08-12 21:26:03 +05:30
Ashwin Kumar
ad3134a5ea
Merge pull request #749 from Django-CRM/dev
fix: update CodeQL workflow to include permissions and use latest act…
2026-08-12 21:16:48 +05:30
Ashwin
49c5db94d1 fix: update CodeQL workflow to include permissions and use latest actions versions; adjust publish job dependencies 2026-08-12 21:16:08 +05:30
Ashwin Kumar
41512a63eb
Merge pull request #748 from Django-CRM/dev
Dev
2026-08-12 20:28:52 +05:30
Ashwin
edb93cfcd0 Merge branch 'master' of https://github.com/django-crm/Django-CRM into dev 2026-08-12 20:28:30 +05:30
Ashwin
f8f7dc0c11 feat: add email templates for assigned contacts, leads, and opportunities
- Created new email templates for notifying users when a contact, lead, or opportunity is assigned to them.
- Added a health check HTML template for server status.
- Introduced magic link email templates for sign-in codes and links.
- Implemented a new root email template for consistent styling across emails.
- Updated packaging tests to ensure all templates are included in the wheel.
- Modified settings to remove project-level template directories, ensuring templates are sourced from app directories.
- Added new templates for goal milestones and stale deals alerts in the opportunity module.
- Bumped version to 1.3.0 and updated dependencies in the project configuration.
- Enhanced Dockerfile for better build management and added .dockerignore for cleaner builds.
- Introduced CSAT rating functionality in the frontend with corresponding tests.
2026-08-12 20:19:53 +05:30
Ashwin
ad2498a35e feat: implement move functionality for opportunities, tasks, and leads
- Added tests for moving leads, allowing non-admin creators to move their own leads.
- Updated the LeadMoveView to support moving leads with explicit order and improved permission checks.
- Introduced OpportunityMoveSerializer for moving opportunities, including permission checks for creators and assignees.
- Created tests for moving opportunities, ensuring proper RBAC and handling of closed stages.
- Enhanced TaskMoveView to allow non-admin creators to move tasks, with similar permission checks.
- Updated frontend to support moving deals with drag-and-drop functionality, including optimistic UI updates and error handling.
- Added API endpoints for moving opportunities and updated mobile app to utilize the new move functionality.
2026-08-12 17:52:00 +05:30
Ashwin Kumar
a0afb58caa
Merge pull request #747 from Rohit10jr/fix/opportunity-kanban-rbac
fix(opportunity): fix dead creator check in kanban move RBAC
2026-08-12 16:17:49 +05:30
Rohit10jr
56fe450ab4 fix(opportunity): fix dead creator check in kanban move RBAC
is_owner compared request.profile (a Profile) to opportunity.created_by (a
User FK), which is never equal, so a non-admin creator who is not also an
assignee was wrongly denied moving their own deal. Compare user ids, matching
the detail-view RBAC.
2026-08-12 12:33:39 +05:30
Ashwin Kumar
799bb12102
Merge pull request #746 from Django-CRM/dev
feat(tickets): implement bulk update and delete actions for tickets
2026-08-12 08:06:51 +05:30
Ashwin
ccfe065979 feat(tickets): implement bulk update and delete actions for tickets
- Added bulkUpdate and bulkDelete actions in the tickets server-side logic.
- Enhanced the tickets Svelte component to support bulk selection and actions.
- Introduced a BulkActionBar component for managing selected tickets.
- Updated the tickets API configuration for bulk operations in the mobile app.
- Implemented bulk update and delete methods in the mobile tickets provider.
- Created unit tests for bulk update and delete functionalities in both mobile and frontend.
- Added UI tests for ticket selection and bulk actions in the mobile app.
2026-08-12 08:06:00 +05:30
Ashwin Kumar
e42c563164
Merge pull request #744 from Django-CRM/dev
Dev
2026-08-09 12:54:52 +05:30
Ashwin
c96a5d3bbf feat: update icons to Lucide icons across various models and screens 2026-08-09 12:53:56 +05:30
Ashwin
f8bb608336 fix: update goal period display format in milestone email template 2026-08-09 09:27:45 +05:30
Ashwin Kumar
d3eb5f9448
Merge pull request #743 from Django-CRM/dev
Dev
2026-08-08 15:47:48 +05:30
Ashwin
c11ced7894 feat: add invoice template form screen and integrate with templates list
- Implemented `InvoiceTemplateFormScreen` for creating and editing invoice templates.
- Added functionality to pre-fill form fields from existing templates.
- Enhanced `InvoiceTemplatesScreen` to allow admins to create new templates and set defaults.
- Updated routing to include paths for creating and editing templates.
- Added tests for the new template form and its integration with the templates list.
- Ensured proper handling of admin-only actions and user permissions.
2026-08-08 15:47:13 +05:30
Ashwin
f132d17d0c feat: enhance profile screen with additional information and links
- Added teams and last signed in information to the profile screen.
- Introduced new link rows for API tokens, goals, timesheet, and tasks.
- Implemented a new _LinkRow widget for better navigation and UI consistency.

fix: update attachment handling in task and ticket detail screens

- Changed attachment opening logic to use API for downloads instead of direct file paths.
- Ensured that attachments without files are handled gracefully.

feat: add contact management to ticket form and detail screens

- Included contact selection in the ticket form, allowing users to link contacts to tickets.
- Updated ticket detail screen to display associated contacts.

refactor: improve API service for file uploads

- Modified the API service to support both POST and PUT methods for file uploads.

test: add unit tests for ticket contacts and document download URLs

- Created tests to ensure correct handling of ticket contacts and document download logic.
- Verified that the absence of contacts does not cause crashes and that payloads are correctly formed.
2026-08-08 14:18:17 +05:30
Ashwin
72d56514d6 feat: add Documents and Goals sections to MoreScreen
- Introduced new MenuRow items for Documents and Goals in the MoreScreen.
- Updated the navigation to link to the respective screens for Documents and Goals.

test: add comprehensive tests for Documents and Goals functionality

- Created unit tests for document handling, including sharing and editing permissions.
- Added tests for goal management, including creation, status tracking, and validation.
- Ensured coverage for edge cases in document and goal functionalities.

test: implement integration tests for Documents and Goals screens

- Developed integration tests to verify the rendering and functionality of Documents and Goals screens.
- Included tests for user roles (admin vs member) and their respective permissions.
2026-08-08 10:53:25 +05:30
Ashwin
ea2e52752a feat: add support ticket management features
- Implemented a new support ticket creation screen with form validation and file attachment capabilities.
- Added a support ticket detail screen to view ticket messages and reply functionality.
- Created a support ticket list screen to display all tickets with options to create new tickets.
- Enhanced API service to handle downloading private attachments securely.
- Updated attachment upload service to support file selection and validation for support tickets.
- Added unit tests for support ticket functionalities, including ticket creation, replies, and attachment handling.
- Introduced self-serve help options for deployments without support queues.
2026-08-08 09:38:37 +05:30
Ashwin
e40153ce47 feat(tickets): implement cascading close functionality for parent tickets
- Added a confirmation step for closing parent tickets that may have open child tickets.
- Introduced a new `close.js` module to handle the logic for identifying open descendants and generating summary messages.
- Updated the ticket detail page to include a close button that triggers the confirmation panel.
- Enhanced the close dialog to display the names of tickets that will be closed and allow users to add a resolution comment.
- Implemented tests for the new close functionality, ensuring correct behavior for various scenarios.
- Updated mobile app to reflect changes in the ticket closing process, including the handling of open descendants and resolution comments.
- Removed the old server endpoint for closing tickets with children, as the new logic is now handled client-side.
2026-08-08 07:40:40 +05:30
Ashwin
49cd93fa1d feat: add inbound email and approval rules settings to the mobile app
- Updated SettingsHubScreen to include new menu options for Inbound Email and Approval Rules.
- Implemented new screens for managing inbound emails and approval rules.
- Added tests for the new inbound email and approval rules functionalities, ensuring proper rendering and behavior.
- Created unit tests for ApprovalRule and Mailbox models, covering JSON serialization and business logic.
2026-08-08 06:56:35 +05:30
Ashwin
3a4ef40ba5 feat: Implement close-with-children dialog and related settings
- Added `close_with_children_dialog.dart` to handle the close ticket prompt with linked tickets.
- Updated `_closeWithChildren` method in `ticket_detail_screen.dart` to utilize the new dialog and respect organization settings for default checkbox state.
- Enhanced ticket closing feedback messages based on whether linked tickets were also closed.
- Introduced unit tests for `AccessToken` and `OrgSettings` to ensure proper serialization and functionality.
- Added tests for the new close-with-children dialog to verify UI behavior and settings integration.
- Updated existing tests to cover new functionality and ensure no regressions.
2026-08-08 01:18:27 +05:30
Ashwin
6bb00db95f feat: add reopen policy screen and related functionality
- Implemented ReopenScreen for managing the reopen policy, including admin-only access and editing capabilities.
- Added MenuRow for navigating to the Reopen policy settings in the SettingsHubScreen.
- Created unit tests for the ReopenPolicy model, covering JSON serialization and validation logic.
- Introduced BusinessCalendar model and tests for business hours functionality.
- Updated phone viewport tests to include scenarios for the reopen policy screen.
2026-08-08 00:33:39 +05:30
Ashwin
68554b89f6 Add escalation settings and tests for escalation policies
- Introduced a new menu option for 'Escalation' in the settings hub screen.
- Added tests for the escalation policies, including rendering, sorting, and behavior based on active/inactive states.
- Implemented logic to handle escalation policies in various scenarios, ensuring proper notifications and actions based on the policy configuration.
- Created unit tests to validate the functionality of escalation policies, including edge cases for targets and breach counts.
2026-08-08 00:11:15 +05:30
Ashwin
e9886b1d99 feat: add routing settings and implement routing rules tests
- Added a new menu option for routing settings in the settings hub screen.
- Implemented comprehensive tests for routing rules, covering various scenarios including rule creation, activation, deactivation, and condition handling.
- Introduced fake client for testing API interactions and ensured proper serialization of routing rules.
- Enhanced routing rule logic to handle active and inactive assignees correctly.
2026-08-07 23:46:49 +05:30
Ashwin
81e813bf3b feat: add tags management screen and functionality
- Introduced a new TagsScreen for managing tags across records.
- Implemented functionality for creating, turning off, turning on, and merging tags.
- Updated SettingsHubScreen to include a link to the new TagsScreen.
- Added tests for the TagsScreen to ensure proper rendering and functionality.
- Created unit tests for tag-related logic, including usage calculations and duplicate detection.
2026-08-07 23:06:14 +05:30
Ashwin
fc07d2a3bb chore: clean up code formatting and improve readability across multiple files 2026-08-07 22:42:57 +05:30
Ashwin
3f7d9068bf Refactor navigation links to use resolve function for path consistency
- Updated all task-related pages to use the `resolve` function for navigation links.
- Ensured that all links in the tickets and organization pages also utilize the `resolve` function.
- Removed unnecessary variables from OAuth callback handling in login server.
- Improved error handling in notifications API by clarifying empty body handling.
2026-08-07 22:31:31 +05:30
Ashwin
01ca6da166 Add unit tests for custom fields and macros functionality
- Implemented comprehensive tests for custom fields, covering key validation, draft validation, payload creation, and parsing.
- Added tests for macros, including permission checks, removal actions, draft validation, and payload structure.
- Established a fake HTTP client to simulate API responses for testing purposes.
- Ensured that all edge cases and expected behaviors are thoroughly validated in both custom fields and macros.
2026-08-07 20:11:01 +05:30
Ashwin Kumar
05b7b34063
Merge pull request #742 from Django-CRM/dev
Dev
2026-08-07 20:00:43 +05:30
Ashwin
98c95e55b0 Add unit tests for invoice creation, notifications, and timesheet functionality
- Implement tests for contact billing rules in new_invoice_test.dart
- Validate line item payload structure and constraints in new_invoice_test.dart
- Create comprehensive tests for notifications provider in notifications_provider_test.dart
- Ensure correct handling of unread notifications and marking them as read
- Add tests for timesheet provider functionality in timesheet_provider_test.dart
- Verify time entry parsing, running timers, and week calculations
2026-08-07 19:32:32 +05:30
Ashwin
f30e30aa7e feat(tags): add merge functionality for tags
- Introduced TagsMergeView to handle merging of tags, allowing records from one tag to be moved to another and archiving the source tag.
- Updated URLs to include the new merge endpoint.
- Enhanced tag views and serializers to support merging operations.
- Added tests for the new merge functionality, ensuring proper behavior and error handling.
- Updated frontend to integrate the merge feature, including UI changes for suggesting tag merges and handling user interactions.
- Documented the merge functionality in the relevant API and frontend files.
2026-08-07 16:43:34 +05:30
Ashwin Kumar
03f265ee5d
Merge pull request #741 from Django-CRM/dev
Refactor and enhance frontend URL handling
2026-08-07 15:59:20 +05:30
Ashwin
bd79a7a4cc Refactor code style and improve error handling in analytics API
- Cleaned up admin.py by removing unnecessary dictionary wrapping for fields.
- Adjusted migration files to maintain consistent formatting and removed redundant lines.
- Updated models.py and tests to remove unnecessary blank lines and improve readability.
- Enhanced error handling in the analytics API to properly forward upstream status and messages.
- Added comprehensive tests for the analytics proxy to ensure correct status and body forwarding.
- Updated contributing guidelines to clarify the use of ruff for code style enforcement.
2026-08-07 15:58:35 +05:30
Ashwin
f4484eaf4b Refactor and enhance frontend URL handling
- Removed unused imports and cleaned up test files for better readability.
- Updated `FRONTEND_URL` handling in `crm/settings.py` to enforce absolute URL requirements in production environments, preventing dead links in emails.
- Added comprehensive tests for `FRONTEND_URL` validation to ensure it does not accept loopback addresses or non-absolute URLs outside of development.
- Improved documentation to clarify the purpose and requirements of `FRONTEND_URL` in the context of email links and deployment.
- Updated dependencies in `pyproject.toml` and `uv.lock` to include `ruff` for enhanced linting capabilities.
2026-08-07 15:23:43 +05:30
Ashwin Kumar
80acf45901
Merge pull request #740 from Django-CRM/dev
Dev
2026-08-07 14:47:21 +05:30
Ashwin
d886d9ada3 feat: add kanban board feature with board and lane management
- Introduced BoardScreen for kanban board functionality.
- Updated app router to include route for the board screen.
- Added UI components for creating and managing boards and lanes.
- Implemented card management within lanes, including adding, moving, and deleting cards.
- Enhanced tasks list screen with navigation to the board screen.
- Created unit tests for board provider to ensure correct functionality and API interactions.
2026-08-07 14:46:33 +05:30
Ashwin
d5a14d6514 feat: add TeamScreen for managing team members and roles
- Implemented TeamScreen to display active and deactivated team members.
- Added functionality to invite new members and manage roles (admin/member).
- Integrated error handling for API responses and loading states.
- Created reusable widgets for displaying member information and actions.

feat: enhance TasksListScreen with initial view filtering

- Modified TasksListScreen to accept an initial view parameter for filtering tasks.
- Implemented logic to apply filters based on dashboard badge taps.
- Updated UI to show active filters with clear options.

test: add unit tests for dashboard badge filters

- Created tests to verify the behavior of task and lead filters based on dashboard badges.
- Ensured correct API query parameters are sent for various filter scenarios.

test: add unit tests for team provider functionality

- Implemented tests for team provider to validate fetching and managing team members.
- Verified role changes, activation status updates, and invite functionality.
- Ensured proper handling of API responses, including error states.
2026-08-07 12:49:50 +05:30
Ashwin
eea82484e2 feat: add file attachment functionality to task and ticket detail screens
- Implemented file attachment upload feature in task detail screen.
- Added a new AttachFileButton widget for initiating file uploads.
- Created AttachmentTile widget to display uploaded files with icons based on file type.
- Enhanced ticket detail screen to include a new Files tab for viewing and uploading attachments.
- Introduced AttachmentUploadResult class to handle the result of file uploads.
- Added postMultipart method in ApiService for handling multipart file uploads.
- Implemented attachment upload logic in attachment_upload.dart service.
- Updated pubspec.yaml to include file_picker dependency for file selection.
- Added unit tests for attachment upload functionality to ensure reliability.
2026-08-07 11:03:06 +05:30
Ashwin
ab27ea85fd Refactor dashboard API response to reduce payload size and improve performance
- Removed serialization of full account, contact, lead, and opportunity objects from the dashboard API response.
- Added new fields for urgent counts, pipeline by stage, revenue metrics, hot leads, tasks, activities, and goal summary.
- Updated the context building logic to only include counts and essential data.

Enhance JWT signing key validation in settings

- Added a check to ensure the SECRET_KEY is at least 32 bytes for HS256 JWT signing.
- Introduced warnings for development environments when the key is shorter than required.

Update environment variable documentation

- Clarified the requirements for the SECRET_KEY in the environment variables documentation, emphasizing the minimum length for security.

Revise mobile app API configuration for self-hosting

- Updated the mobile app to allow self-hosting by using `--dart-define` for API_BASE_URL and GOOGLE_SERVER_CLIENT_ID.
- Ensured that the app enforces HTTPS in release builds to secure JWT transmission.

Implement entity lookup for task linking in mobile app

- Created a new EntityLookup model to handle task attachments to accounts, leads, opportunities, and tickets.
- Refactored task form screen to utilize the new lookup mechanism, improving the user experience by providing real-time loading states and error handling.

Add unit tests for new features and configurations

- Implemented unit tests for API configuration, entity lookup, and task link picker to ensure functionality and reliability.
2026-08-07 10:05:19 +05:30
Ashwin
1da98d92cf feat: add contacts list screen with search and pagination
- Implemented ContactsListScreen to display a list of contacts with search functionality.
- Added infinite scrolling to load more contacts as the user scrolls.
- Created a count strip to show the number of contacts loaded.
- Added error handling and retry functionality for loading contacts.
- Introduced a new ContactRow widget for displaying individual contact details.

refactor: enhance deal form unsaved changes detection

- Replaced manual unsaved changes checks with a baseline snapshot comparison.
- Updated the deal form to capture the initial state of the form for better change detection.
- Improved the handling of unsaved changes for various fields in the deal form.

refactor: update lead form unsaved changes detection

- Implemented baseline snapshot comparison for unsaved changes in the lead form.
- Enhanced the lead form to ensure all relevant fields are considered for change detection.

feat: add accounts and contacts menu items in settings

- Added new menu items for Accounts and Contacts in the MoreScreen for easier navigation.

refactor: update task forms to use account options provider

- Changed references from accountsProvider to accountOptionsProvider in task forms for consistency.

fix: improve auth service sign-out process

- Updated the sign-out method to notify the server of the sign-out while ensuring local state is cleared.

test: add unit tests for account and contact parsing

- Created tests to validate the parsing of account and contact data from API responses.
- Ensured that the parsing logic correctly handles nested structures and missing fields.
2026-08-07 09:20:28 +05:30
Ashwin
4767126e3d Merge branch 'master' of https://github.com/django-crm/Django-CRM into dev 2026-08-07 08:46:08 +05:30
Ashwin
8911551e2c feat: Implement unsaved changes guard in forms
- Added UnsavedChangesGuard widget to prevent accidental loss of unsaved changes when navigating away from forms.
- Integrated unsaved changes detection in TicketFormScreen and ProfileScreen.
- Updated TicketFormScreen to compare current form state against a baseline to track unsaved changes.
- Enhanced user experience by prompting for confirmation when attempting to leave a form with unsaved changes.
- Refactored ticket submission logic to ensure proper validation and error handling.
- Introduced TokenStorage service for secure storage of JWTs, migrating from SharedPreferences to FlutterSecureStorage.
- Updated AuthService to utilize TokenStorage for managing access and refresh tokens.
- Added unit tests for TokenStorage to ensure proper functionality and migration of tokens.
- Created tests for unsaved changes functionality to verify correct behavior in various scenarios.
2026-08-07 08:45:36 +05:30
Ashwin Kumar
873d97b751
Merge pull request #739 from Django-CRM/dev
Dev
2026-08-07 08:23:17 +05:30
Ashwin
c1fa72b667 feat: Implement organization creation feature
- Removed notification model and related exports.
- Added create organization functionality in AuthProvider and AuthService.
- Introduced OrgCreateScreen for organization creation with form validation.
- Updated routing to include organization creation and selection screens.
- Enhanced OrgSelectionScreen to allow users to create a new organization.
- Added tests for organization creation and validation logic.
2026-08-07 08:22:43 +05:30