* feat(tests): Add reusable workspace fixture
Introduces a new `workspace` fixture in `conftest.py` to provide a
consistent and reusable setup for tests that require a workspace.
* feat(tests): Add tests for project creation (POST)
This commit introduces a comprehensive test suite for the project creation API endpoint.
The suite covers a wide range of scenarios, including:
- Successful creation and verification of side-effects (default states, project members, user properties).
- Validation for invalid or missing data (400 Bad Request).
- Permission checks for different user roles (e.g., guests are forbidden).
- Authentication requirements (401 Unauthorized).
- Uniqueness constraints for project names and identifiers (409 Conflict).
- Successful creation with all optional fields populated.
It leverages the `workspace`, `session_client` and `create_user` fixtures for a consistent test setup.
* refactor(tests): Centralize project URL helper into a base class
To avoid code duplication in upcoming tests, this commit introduces a `TestProjectBase` class.
The `get_project_url` helper method is moved into this shared base class, and the existing `TestProjectAPIPost` class is updated to inherit from it. This ensures the URL generation logic is defined in a single place and preparing the suite for the upcoming GET tests.
* feat(tests): Add tests for project listing and retrieval (GET)
This commit adds a suite for the GET method. It leverages the previously created `TestProjectBase` class for URL generation.
The new test suite covers:
- Listing projects:
- Verifies that administrators see all projects.
- Confirms guests only see projects they are members of.
- Tests the separate detailed project list endpoint.
- Retrieving a single project:
- Checks for successful retrieval of a project by its ID.
- Handles edge cases for non-existent and archived projects (404 Not Found).
- Authentication:
- Ensures authentication is required (401 Unauthorized).
* feat(tests): Add tests for project update (PATCH) and deletion (DELETE)
Key scenarios tested for PATCH:
- Successful partial updates by project administrators.
- Forbidden access for non-admin members (403).
- Conflict errors for duplicate names or identifiers on update (409).
- Validation errors for invalid data (400).
Key scenarios tested for DELETE:
- Successful deletion by both project admins and workspace admins.
- Forbidden access for non-admin members (403).
- Authentication checks for unauthenticated users (401).
* Remove unnecessary print statement
* refactor(tests): Update workspace fixture to use ORM
Updates the `workspace` fixture to create the model instance directly via the ORM using the `Workspace` model instead of the API, as requested during code review.
* Refactor: Remove some unused imports
Removes imports that I added while working on the test suite for the Project API but were ultimately not used. Note that other unused imports still exist from the state of the codebase when this branch was created/forked.
* feat: add IssueListDetailSerializer for detailed issue representation
- Introduced IssueListDetailSerializer to enhance issue data representation with expanded fields.
- Updated issue detail endpoint to utilize the new serializer for improved data handling.
- Added methods for retrieving related module, label, and assignee IDs, along with support for expanded relations.
* feat: add ViewIssueListSerializer and enhance issue ordering
- Introduced ViewIssueListSerializer for improved issue representation, including assignee, label, and module IDs.
- Updated WorkspaceViewIssuesViewSet to utilize the new serializer and optimized queryset with prefetching.
- Enhanced order_issue_queryset to maintain consistent ordering by created_at alongside other fields.
- Modified pagination logic to support total count retrieval for better performance.
* fix: optimize issue filtering and pagination logic
- Updated WorkspaceViewIssuesViewSet to apply filters more efficiently in the issue query.
- Refined pagination logic in OffsetPaginator to ensure consistent behavior using limit instead of cursor.value, improving overall pagination accuracy.
* fix: improve pagination logic in OffsetPaginator
- Updated the next_cursor calculation to use the length of results instead of cursor.value, ensuring accurate pagination behavior.
- Added a comment to clarify the purpose of checking for additional results after the current page.
* Move the common permission filters into a separate method
* fix: handle deleted related issues in serializers
- Updated IssueListDetailSerializer to skip null related issues when building relations.
- Enhanced ViewIssueListSerializer to safely access state.group, returning None if state is not present.
- Removed unused User import in base.py for cleaner code.
---------
Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
* chore: improved pat permissions
* fix: err message
* fix: removed permission from backend
* [WEB-4330] refactor: update API token endpoints to use user context instead of workspace slug
- Changed URL patterns for API token endpoints to use "users/api-tokens/" instead of "workspaces/<str:slug>/api-tokens/".
- Refactored ApiTokenEndpoint methods to remove workspace slug parameter and adjust database queries accordingly.
- Added new test cases for API token creation, retrieval, deletion, and updates, including support for bot users and minimal data submissions.
* fix: removed workspace slug from api-tokens
* fix: refactor
* chore: url.py code rabbit suggestion
* fix: APITokenService moved to package
---------
Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
* fix: duplicate assignees in user recents
* chore: optimize filtering logic
* chore: filter with deleted_at field
* chore: tests for IssueRecentSerializer
* fix: settings header css + cta on error page
* [WEB-4249] fix: filter out inactive workspace members from project member list
---------
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
* refactor: permission layer
* refactor: add original_role to project member serializer
* chore: minor fixes related to permission layer
* fix: strict type checking while checking user permissions
* fix: header text of insight table search
* fix: made the active project list scrollable
* chore: added xAxis label to table header
* chore: removed the intake issues
* fix: made the headerText necessary
---------
Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
* chore: added cycles and modules in analytics peek view
* chore: added cycles and modules analytics
* chore: added project filter for work items
* chore: added a peekview flag and based on that table columns
* chore: added peek view
* chore: added check for display name
* chore: cleaned up some code
* chore: fixed export csv data
* chore: added distinct work items
* chore: assignee in peek view
* updated csv fields
* chore: updated workitems peek with assignee
* fix: removed type assersions for workspaceslug
* chore: added day wise filter in cycles and modules
* chore: added extra validations
---------
Co-authored-by: JayashTripathy <jayashtripathy371@gmail.com>
* chore: remove analytics duration filter
* removed subtitle from title and date_filter from service call
* chore: removed the date filter
* bottom text of insight trend card
* chore: changed issue manager
* fix: limited items in table
* fix: removed unnecessary props from data-table
---------
Co-authored-by: JayashTripathy <jayashtripathy371@gmail.com>
Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
* chore: analytics endpoint
* added anlytics v2
* updated status icons
* added area chart in workitems and en translations
* active projects
* chore: created analytics chart
* chore: validation errors
* improved radar-chart , added empty states , added projects summary
* chore: added a new graph in advance analytics
* integrated priority chart
* chore: added csv exporter
* added priority dropdown
* integrated created vs resolved chart
* custom x and y axis label in bar and area chart
* added wrapper styles to legends
* added filter components
* fixed temp data imports
* integrated filters in priority charts
* added label to priority chart and updated duration filter
* refactor
* reverted to void onchange
* fixed some contant exports
* fixed type issues
* fixed some type and build issues
* chore: updated the filtering logic for analytics
* updated default value to last_30_days
* percentage value whole number and added some rules for axis options
* fixed some translations
* added - custom tick for radar, calc of insight cards, filter labels
* chore: opitmised the analytics endpoint
* replace old analytics path with new , updated labels of insight card, done some store fixes
* chore: updated the export request
* Enhanced ProjectSelect to support multi-select, improved state management, and optimized data fetching and component structure.
* fix: round completion percentage calculation in ActiveProjectItem
* added empty states in project insights
* Added loader and empty state in created/resolved chart
* added loaders
* added icons in filters
* added custom colors in customised charts
* cleaned up some code
* added some responsiveness
* updated translations
* updated serrchbar for the table
* added work item modal in project analytics
* fixed some of the layput issues in the peek view
* chore: updated the base function for viewsets
* synced tab to url
* code cleanup
* chore: updated the export logic
* fixed project_ids filter
* added icon in projectdropdown
* updated export button position
* export csv and emptystates icons
* refactor
* code refactor
* updated loaders, moved color pallete to contants, added nullish collasece operator in neccessary places
* removed uneccessary cn
* fixed formatting issues
* fixed empty project_ids in payload
* improved null checks
* optimized charts
* modified relevant variables to observable.ref
* fixed the duration type
* optimized some code
* updated query key in project-insight
* updated query key in project-insight
* updated formatting
* chore: replaced analytics route with new one and done some optimizations
* removed the old analytics
---------
Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
* chore: analytics endpoint
* chore: created analytics chart
* chore: validation errors
* chore: added a new graph in advance analytics
* chore: added csv exporter
* chore: updated the filtering logic for analytics
* chore: opitmised the analytics endpoint
* chore: updated the base function for viewsets
* chore: updated the export logic
* chore: added type hints
* chore: added type hints
* chore: comment details of work item
* chore: attachment count and attachment name
* chore: issue link and subscriber count
* chore: list of assignees
* chore: asset_url as attachment_links
* chore: code refactor
* fix: cannot export Excel
* chore: remove print statements
* fix: filtering in list
* chore: optimize attachment_count and attachment_link query
* chore: optimize fetching issue details for multiple select
* chore: use Prefetch to avoid duplicates