2026-01-27 08:24:22 +00:00
|
|
|
# Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
# See the LICENSE file for details.
|
|
|
|
|
|
2023-08-11 13:57:44 +00:00
|
|
|
# Python imports
|
2024-10-08 11:21:57 +00:00
|
|
|
import pytz
|
2023-08-11 13:57:44 +00:00
|
|
|
from uuid import uuid4
|
2025-03-25 14:47:16 +00:00
|
|
|
from enum import Enum
|
2023-08-11 13:57:44 +00:00
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
# Django imports
|
|
|
|
|
from django.conf import settings
|
2024-05-08 17:31:20 +00:00
|
|
|
from django.core.validators import MaxValueValidator, MinValueValidator
|
|
|
|
|
from django.db import models
|
2024-07-31 14:08:53 +00:00
|
|
|
from django.db.models import Q
|
2022-11-29 21:17:42 +00:00
|
|
|
|
2024-10-08 11:21:57 +00:00
|
|
|
# Module imports
|
2022-11-29 21:17:42 +00:00
|
|
|
from plane.db.mixins import AuditModel
|
|
|
|
|
|
2024-05-08 17:31:20 +00:00
|
|
|
from .base import BaseModel
|
2022-11-29 21:17:42 +00:00
|
|
|
|
2024-11-21 12:12:44 +00:00
|
|
|
ROLE_CHOICES = ((20, "Admin"), (15, "Member"), (5, "Guest"))
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
|
2025-09-11 08:46:36 +00:00
|
|
|
class ROLE(Enum):
|
|
|
|
|
ADMIN = 20
|
|
|
|
|
MEMBER = 15
|
|
|
|
|
GUEST = 5
|
|
|
|
|
|
|
|
|
|
|
2025-03-25 14:47:16 +00:00
|
|
|
class ProjectNetwork(Enum):
|
|
|
|
|
SECRET = 0
|
|
|
|
|
PUBLIC = 2
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def choices(cls):
|
|
|
|
|
return [(0, "Secret"), (2, "Public")]
|
|
|
|
|
|
|
|
|
|
|
2022-12-20 11:29:24 +00:00
|
|
|
def get_default_props():
|
|
|
|
|
return {
|
2023-09-13 13:43:31 +00:00
|
|
|
"filters": {
|
2023-09-22 14:18:07 +00:00
|
|
|
"priority": None,
|
2023-09-13 13:43:31 +00:00
|
|
|
"state": None,
|
|
|
|
|
"state_group": None,
|
|
|
|
|
"assignees": None,
|
|
|
|
|
"created_by": None,
|
|
|
|
|
"labels": None,
|
|
|
|
|
"start_date": None,
|
|
|
|
|
"target_date": None,
|
|
|
|
|
"subscriber": None,
|
|
|
|
|
},
|
|
|
|
|
"display_filters": {
|
|
|
|
|
"group_by": None,
|
2024-01-13 13:35:06 +00:00
|
|
|
"order_by": "-created_at",
|
2023-09-13 13:43:31 +00:00
|
|
|
"type": None,
|
|
|
|
|
"sub_issue": True,
|
|
|
|
|
"show_empty_groups": True,
|
|
|
|
|
"layout": "list",
|
|
|
|
|
"calendar_date_range": "",
|
|
|
|
|
},
|
2022-12-20 11:29:24 +00:00
|
|
|
}
|
|
|
|
|
|
2023-08-11 13:57:44 +00:00
|
|
|
|
2023-07-25 08:52:54 +00:00
|
|
|
def get_default_preferences():
|
2025-11-26 07:26:11 +00:00
|
|
|
return {"pages": {"block_display": True}, "navigation": {"default_tab": "work_items", "hide_in_more_menu": []}}
|
2023-07-25 08:52:54 +00:00
|
|
|
|
2022-12-20 11:29:24 +00:00
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
class Project(BaseModel):
|
|
|
|
|
NETWORK_CHOICES = ((0, "Secret"), (2, "Public"))
|
|
|
|
|
name = models.CharField(max_length=255, verbose_name="Project Name")
|
2024-11-21 12:12:44 +00:00
|
|
|
description = models.TextField(verbose_name="Project Description", blank=True)
|
2025-09-29 13:45:32 +00:00
|
|
|
description_text = models.JSONField(verbose_name="Project Description RT", blank=True, null=True)
|
|
|
|
|
description_html = models.JSONField(verbose_name="Project Description HTML", blank=True, null=True)
|
2024-11-21 12:12:44 +00:00
|
|
|
network = models.PositiveSmallIntegerField(default=2, choices=NETWORK_CHOICES)
|
2025-09-29 13:45:32 +00:00
|
|
|
workspace = models.ForeignKey("db.WorkSpace", on_delete=models.CASCADE, related_name="workspace_project")
|
|
|
|
|
identifier = models.CharField(max_length=12, verbose_name="Project Identifier", db_index=True)
|
2022-11-29 21:17:42 +00:00
|
|
|
default_assignee = models.ForeignKey(
|
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
|
related_name="default_assignee",
|
|
|
|
|
null=True,
|
|
|
|
|
blank=True,
|
|
|
|
|
)
|
|
|
|
|
project_lead = models.ForeignKey(
|
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
|
related_name="project_lead",
|
|
|
|
|
null=True,
|
|
|
|
|
blank=True,
|
|
|
|
|
)
|
2023-05-19 11:16:56 +00:00
|
|
|
emoji = models.CharField(max_length=255, null=True, blank=True)
|
|
|
|
|
icon_prop = models.JSONField(null=True)
|
2026-09-13 10:10:24 +00:00
|
|
|
module_view = models.BooleanField(default=True)
|
|
|
|
|
cycle_view = models.BooleanField(default=True)
|
|
|
|
|
issue_views_view = models.BooleanField(default=True)
|
2023-03-27 20:22:21 +00:00
|
|
|
page_view = models.BooleanField(default=True)
|
2026-09-13 10:10:24 +00:00
|
|
|
intake_view = models.BooleanField(default=True)
|
|
|
|
|
is_time_tracking_enabled = models.BooleanField(default=True)
|
|
|
|
|
is_issue_type_enabled = models.BooleanField(default=True)
|
2024-09-11 11:40:15 +00:00
|
|
|
guest_view_all_features = models.BooleanField(default=False)
|
2024-10-11 14:43:38 +00:00
|
|
|
cover_image = models.TextField(blank=True, null=True)
|
|
|
|
|
cover_image_asset = models.ForeignKey(
|
|
|
|
|
"db.FileAsset",
|
|
|
|
|
on_delete=models.SET_NULL,
|
|
|
|
|
null=True,
|
|
|
|
|
blank=True,
|
|
|
|
|
related_name="project_cover_image",
|
|
|
|
|
)
|
2025-09-29 13:45:32 +00:00
|
|
|
estimate = models.ForeignKey("db.Estimate", on_delete=models.SET_NULL, related_name="projects", null=True)
|
|
|
|
|
archive_in = models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(12)])
|
|
|
|
|
close_in = models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(12)])
|
2024-03-06 13:45:48 +00:00
|
|
|
logo_props = models.JSONField(default=dict)
|
2025-09-29 13:45:32 +00:00
|
|
|
default_state = models.ForeignKey("db.State", on_delete=models.SET_NULL, null=True, related_name="default_state")
|
2024-03-20 08:29:31 +00:00
|
|
|
archived_at = models.DateTimeField(null=True)
|
2024-10-08 11:21:57 +00:00
|
|
|
# timezone
|
[WEB-4045] feat: restructuring of the external APIs for better maintainability (#7477)
* Basic setup for drf-spectacular
* Updated to only handle /api/v1 endpoints
* feat: add asset and user endpoints with URL routing
- Introduced new asset-related endpoints for user assets and server assets, allowing for asset uploads and management.
- Added user endpoint to retrieve current user information.
- Updated URL routing to include new asset and user patterns.
- Enhanced issue handling with a new search endpoint for issues across multiple fields.
- Expanded member management with a new endpoint for workspace members.
* Group endpoints by tags
* Detailed schema definitions and examples for asset endpoints
* Removed unnecessary extension
* Specify avatar_url field separately
* chore: add project docs
* chore: correct all errors
* chore: added open spec in work items
* feat: enhance cycle API endpoints with detailed OpenAPI specifications
- Updated CycleAPIEndpoint and CycleIssueAPIEndpoint to include detailed OpenAPI schema definitions for GET, POST, PATCH, and DELETE operations.
- Specified allowed HTTP methods for each endpoint in the URL routing.
- Improved documentation for cycle creation, updating, and deletion, including request and response examples.
* chore: added open spec in labels
* chore: work item properties
* feat: enhance API endpoints with OpenAPI specifications and HTTP method definitions
- Added detailed OpenAPI schema definitions for various API endpoints including Intake, Module, and State.
- Specified allowed HTTP methods for each endpoint in the URL routing for better clarity and documentation.
- Improved request and response examples for better understanding of API usage.
- Introduced unarchive functionality for cycles and modules with appropriate endpoint definitions.
* chore: run formatter
* Removed unnecessary settings for authentication
* Refactors OpenAPI documentation structure
Improves the organization and maintainability of the OpenAPI documentation by modularizing the `openapi_spec_helpers.py` file.
The changes include:
- Migrates common parameters, responses, examples, and authentication extensions to separate modules.
- Introduces helper decorators for different endpoint types.
- Updates view imports to use the new module paths.
- Removes the legacy `openapi_spec_helpers.py` file.
This refactoring results in a more structured and easier-to-maintain OpenAPI documentation setup.
* Refactor OpenAPI endpoint specifications
- Removed unnecessary parameters from the OpenAPI documentation for various endpoints in the asset, cycle, and project views.
- Updated request structures to improve clarity and consistency across the API documentation.
- Enhanced response formatting for better readability and maintainability.
* Enhance API documentation with detailed endpoint descriptions
Updated various API endpoints across the application to include comprehensive docstrings that clarify their functionality. Each endpoint now features a summary and detailed description, improving the overall understanding of their purpose and usage. This change enhances the OpenAPI specifications for better developer experience and documentation clarity.
* Enhance API serializers and views with new request structures
- Added new serializers for handling cycle and module issue requests, including `CycleIssueRequestSerializer`, `TransferCycleIssueRequestSerializer`, `ModuleIssueRequestSerializer`, and intake issue creation/updating serializers.
- Updated existing serializers to improve clarity and maintainability, including the `UserAssetUploadSerializer` and `IssueAttachmentUploadSerializer`.
- Refactored API views to utilize the new serializers, enhancing the request handling for cycle and intake issue endpoints.
- Improved OpenAPI documentation by replacing inline request definitions with serializer references for better consistency and readability.
* Refactor OpenAPI documentation and endpoint specifications
- Replaced inline schema definitions with dedicated decorators for various endpoint types, enhancing clarity and maintainability.
- Updated API views to utilize new decorators for user, cycle, intake, module, and project endpoints, improving consistency in OpenAPI documentation.
- Removed unnecessary parameters and responses from endpoint specifications, streamlining the documentation for better readability.
- Enhanced the organization of OpenAPI documentation by modularizing endpoint-specific decorators and parameters.
* chore: correct formatting
* chore: correct formatting for all api folder files
* refactor: clean up serializer imports and test setup
- Removed unused `StateLiteSerializer` import from the serializer module.
- Updated test setup to include a noqa comment for the `django_db_setup` fixture, ensuring clarity in the code.
- Added missing commas in user data dictionary for consistency.
* feat: add project creation and update serializers with validation
- Introduced `ProjectCreateSerializer` and `ProjectUpdateSerializer` to handle project creation and updates, respectively.
- Implemented validation to ensure project leads and default assignees are members of the workspace.
- Updated API views to utilize the new serializers for creating and updating projects, enhancing request handling.
- Added OpenAPI documentation references for the new serializers in the project API endpoints.
* feat: update serializers to include additional read-only fields
* refactor: rename intake issue serializers and enhance structure
- Renamed `CreateIntakeIssueRequestSerializer` to `IntakeIssueCreateSerializer` and `UpdateIntakeIssueRequestSerializer` to `IntakeIssueUpdateSerializer` for clarity.
- Introduced `IssueSerializer` for nested issue data in intake requests, improving the organization of serializer logic.
- Updated API views to utilize the new serializer names, ensuring consistency across the codebase.
* refactor: rename issue serializer for intake and enhance API documentation
- Renamed `IssueSerializer` to `IssueForIntakeSerializer` for better clarity in the context of intake issues.
- Updated references in `IntakeIssueCreateSerializer` and `IntakeIssueUpdateSerializer` to use the new `IssueForIntakeSerializer`.
- Added OpenAPI documentation for the `get_workspace_work_item` endpoint, detailing parameters and responses for improved clarity.
* chore: modules and cycles serializers
* feat: add new serializers for label and issue link management
- Introduced `LabelCreateUpdateSerializer`, `IssueLinkCreateSerializer`, `IssueLinkUpdateSerializer`, and `IssueCommentCreateSerializer` to enhance the handling of label and issue link data.
- Updated existing API views to utilize the new serializers for creating and updating labels, issue links, and comments, improving request handling and validation.
- Added `IssueSearchSerializer` for searching issues, streamlining the search functionality in the API.
* Don't consider read only fields as required
* Add setting to separate request and response definitions
* Fixed avatar_url warning on openapi spec generation
* Made spectacular disabled by default
* Moved spectacular settings into separate file and added detailed descriptions to tags
* Specify methods for asset urls
* Better server names
* Enhance API documentation with summaries for various endpoints
- Added summary descriptions for user asset, cycle, intake, issue, member, module, project, state, and user API endpoints to improve clarity and usability of the API documentation.
- Updated the OpenAPI specifications to reflect these changes, ensuring better understanding for developers interacting with the API.
* Add contact information to OpenAPI settings
- Included contact details for Plane in the OpenAPI settings to enhance API documentation and provide developers with a direct point of contact for support.
- This addition aims to improve the overall usability and accessibility of the API documentation.
* Reordered tags and improved description relavancy
* Enhance OpenAPI documentation for cycle and issue endpoints
- Added response definitions for the `get_cycle_issues` and `delete_cycle_issue` methods in the CycleIssueAPIEndpoint to clarify expected outcomes.
- Included additional response codes for the IssueSearchEndpoint to handle various error scenarios, improving the overall API documentation and usability.
* Enhance serializer documentation across multiple files
- Updated docstrings for various serializers including UserAssetUploadSerializer, AssetUpdateSerializer, and others to provide clearer descriptions of their functionality and usage.
- Improved consistency in formatting and language across serializer classes to enhance readability and maintainability.
- Added detailed explanations for new serializers related to project, module, and cycle management, ensuring comprehensive documentation for developers.
* Refactor API endpoints for cycles, intake, modules, projects, and states
- Replaced existing API endpoint classes with more descriptive names such as CycleListCreateAPIEndpoint, CycleDetailAPIEndpoint, IntakeIssueListCreateAPIEndpoint, and others to enhance clarity.
- Updated URL patterns to reflect the new endpoint names, ensuring consistency across the API.
- Improved documentation and method summaries for better understanding of endpoint functionalities.
- Enhanced query handling in the new endpoint classes to streamline data retrieval and improve performance.
* Refactor issue and label API endpoints for clarity and functionality
- Renamed existing API endpoint classes to more descriptive names such as IssueListCreateAPIEndpoint, IssueDetailAPIEndpoint, LabelListCreateAPIEndpoint, and LabelDetailAPIEndpoint to enhance clarity.
- Updated URL patterns to reflect the new endpoint names, ensuring consistency across the API.
- Improved method summaries and documentation for better understanding of endpoint functionalities.
- Streamlined query handling in the new endpoint classes to enhance data retrieval and performance.
* Refactor asset API endpoint methods and introduce new status enums
- Updated the GenericAssetEndpoint to only allow POST requests for asset creation, removing the GET method.
- Modified the get method to require asset_id, ensuring that asset retrieval is always tied to a specific asset.
- Added new IntakeIssueStatus and ModuleStatus enums to improve clarity and management of asset and module states.
- Enhanced OpenAPI settings to include these new enums for better documentation and usability.
* enforce naming convention
* Added LICENSE to openapi spec
* Enhance OpenAPI documentation for various API endpoints
- Updated API endpoints in asset, cycle, intake, issue, module, project, and state views to include OpenApiRequest and OpenApiExample for better request documentation.
- Added example requests for creating and updating resources, improving clarity for API consumers.
- Ensured consistent use of OpenApi utilities across all relevant endpoints to enhance overall API documentation quality.
* Enhance OpenAPI documentation for various API endpoints
- Added detailed descriptions to multiple API endpoints across asset, cycle, intake, issue, module, project, state, and user views to improve clarity for API consumers.
- Ensured consistent documentation practices by including descriptions that outline the purpose and functionality of each endpoint.
- This update aims to enhance the overall usability and understanding of the API documentation.
* Update OpenAPI examples and enhance project queryset logic
- Changed example fields in OpenAPI documentation for issue comments from "content" to "comment_html" to reflect the correct structure.
- Introduced a new `get_queryset` method in the ProjectDetailAPIEndpoint to filter projects based on user membership and workspace, while also annotating additional project-related data such as total members, cycles, and modules.
- Updated permission checks to use the correct attribute name for project identifiers, ensuring accurate permission handling.
* Enhance OpenAPI documentation and add response examples
- Updated multiple API endpoints across asset, cycle, intake, issue, module, project, state, and user views to include new OpenApiResponse examples for better clarity on expected outcomes.
- Introduced new parameters for project and issue identifiers to improve request handling and documentation consistency.
- Enhanced existing responses with detailed examples to aid API consumers in understanding the expected data structure and error handling.
- This update aims to improve the overall usability and clarity of the API documentation.
* refactor: update terminology from 'issues' to 'work items' across multiple API endpoints for consistency and clarity
* use common timezones from pytz for choices
* Moved the openapi utils to the new folder structure
* Added exception logging in GenericAssetEndpoint to improve error handling
* Fixed code rabbit suggestions
* Refactored IssueDetailAPIEndpoint to streamline issue retrieval and response handling, removing redundant external ID checks and custom ordering logic.
---------
Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
2025-07-24 18:47:05 +00:00
|
|
|
TIMEZONE_CHOICES = tuple(zip(pytz.common_timezones, pytz.common_timezones))
|
2024-11-21 12:12:44 +00:00
|
|
|
timezone = models.CharField(max_length=255, default="UTC", choices=TIMEZONE_CHOICES)
|
2025-06-09 10:32:09 +00:00
|
|
|
# external_id for imports
|
|
|
|
|
external_source = models.CharField(max_length=255, null=True, blank=True)
|
|
|
|
|
external_id = models.CharField(max_length=255, blank=True, null=True)
|
2022-11-29 21:17:42 +00:00
|
|
|
|
2025-12-16 15:16:53 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
# Track if timezone is provided, if so, don't override it with the workspace timezone when saving
|
|
|
|
|
self.is_timezone_provided = kwargs.get("timezone") is not None
|
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
2024-10-11 14:43:38 +00:00
|
|
|
@property
|
|
|
|
|
def cover_image_url(self):
|
|
|
|
|
# Return cover image url
|
|
|
|
|
if self.cover_image_asset:
|
|
|
|
|
return self.cover_image_asset.asset_url
|
|
|
|
|
|
|
|
|
|
# Return cover image url
|
|
|
|
|
if self.cover_image:
|
|
|
|
|
return self.cover_image
|
|
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
def __str__(self):
|
|
|
|
|
"""Return name of the project"""
|
|
|
|
|
return f"{self.name} <{self.workspace.name}>"
|
|
|
|
|
|
2026-02-16 19:19:02 +00:00
|
|
|
FORBIDDEN_IDENTIFIER_CHARS_PATTERN = r"^.*[&+,:;$^}{*=?@#|'<>.()%!-].*$"
|
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
class Meta:
|
2024-07-31 14:08:53 +00:00
|
|
|
unique_together = [
|
|
|
|
|
["identifier", "workspace", "deleted_at"],
|
|
|
|
|
["name", "workspace", "deleted_at"],
|
|
|
|
|
]
|
|
|
|
|
constraints = [
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["identifier", "workspace"],
|
|
|
|
|
condition=Q(deleted_at__isnull=True),
|
|
|
|
|
name="project_unique_identifier_workspace_when_deleted_at_null",
|
|
|
|
|
),
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["name", "workspace"],
|
|
|
|
|
condition=Q(deleted_at__isnull=True),
|
|
|
|
|
name="project_unique_name_workspace_when_deleted_at_null",
|
|
|
|
|
),
|
|
|
|
|
]
|
2022-11-29 21:17:42 +00:00
|
|
|
verbose_name = "Project"
|
|
|
|
|
verbose_name_plural = "Projects"
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
db_table = "projects"
|
2022-11-29 21:17:42 +00:00
|
|
|
ordering = ("-created_at",)
|
|
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs):
|
2025-12-16 15:16:53 +00:00
|
|
|
from plane.db.models import Workspace
|
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
self.identifier = self.identifier.strip().upper()
|
2025-12-16 15:16:53 +00:00
|
|
|
is_creating = self._state.adding
|
|
|
|
|
|
|
|
|
|
if is_creating and not self.is_timezone_provided:
|
|
|
|
|
workspace = Workspace.objects.get(id=self.workspace_id)
|
|
|
|
|
self.timezone = workspace.timezone
|
|
|
|
|
|
2022-11-29 21:17:42 +00:00
|
|
|
return super().save(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectBaseModel(BaseModel):
|
2025-09-29 13:45:32 +00:00
|
|
|
project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name="project_%(class)s")
|
|
|
|
|
workspace = models.ForeignKey("db.Workspace", on_delete=models.CASCADE, related_name="workspace_%(class)s")
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
abstract = True
|
|
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs):
|
|
|
|
|
self.workspace = self.project.workspace
|
|
|
|
|
super(ProjectBaseModel, self).save(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectMemberInvite(ProjectBaseModel):
|
|
|
|
|
email = models.CharField(max_length=255)
|
|
|
|
|
accepted = models.BooleanField(default=False)
|
|
|
|
|
token = models.CharField(max_length=255)
|
|
|
|
|
message = models.TextField(null=True)
|
|
|
|
|
responded_at = models.DateTimeField(null=True)
|
2024-09-11 11:40:15 +00:00
|
|
|
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=5)
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
verbose_name = "Project Member Invite"
|
|
|
|
|
verbose_name_plural = "Project Member Invites"
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
db_table = "project_member_invites"
|
2022-11-29 21:17:42 +00:00
|
|
|
ordering = ("-created_at",)
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
return f"{self.project.name} {self.email} {self.accepted}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectMember(ProjectBaseModel):
|
|
|
|
|
member = models.ForeignKey(
|
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
|
null=True,
|
|
|
|
|
blank=True,
|
|
|
|
|
related_name="member_project",
|
|
|
|
|
)
|
|
|
|
|
comment = models.TextField(blank=True, null=True)
|
2024-09-11 11:40:15 +00:00
|
|
|
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=5)
|
2023-04-06 08:29:43 +00:00
|
|
|
view_props = models.JSONField(default=get_default_props)
|
2022-12-20 11:29:24 +00:00
|
|
|
default_props = models.JSONField(default=get_default_props)
|
2023-07-25 08:52:54 +00:00
|
|
|
preferences = models.JSONField(default=get_default_preferences)
|
2023-07-31 12:42:02 +00:00
|
|
|
sort_order = models.FloatField(default=65535)
|
2023-11-15 10:23:16 +00:00
|
|
|
is_active = models.BooleanField(default=True)
|
2023-07-31 12:42:02 +00:00
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs):
|
2026-01-06 10:07:19 +00:00
|
|
|
if self._state.adding and self.member:
|
|
|
|
|
# Get the minimum sort_order for this member in the workspace
|
|
|
|
|
min_sort_order_result = ProjectUserProperty.objects.filter(
|
|
|
|
|
workspace_id=self.project.workspace_id, user=self.member
|
|
|
|
|
).aggregate(min_sort_order=models.Min("sort_order"))
|
|
|
|
|
min_sort_order = min_sort_order_result.get("min_sort_order")
|
|
|
|
|
|
|
|
|
|
# create project user property with project sort order
|
|
|
|
|
ProjectUserProperty.objects.create(
|
|
|
|
|
workspace_id=self.project.workspace_id,
|
|
|
|
|
project=self.project,
|
|
|
|
|
user=self.member,
|
|
|
|
|
sort_order=(min_sort_order - 10000 if min_sort_order is not None else 65535),
|
|
|
|
|
)
|
2023-07-31 12:42:02 +00:00
|
|
|
|
|
|
|
|
super(ProjectMember, self).save(*args, **kwargs)
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
class Meta:
|
2024-08-02 07:45:59 +00:00
|
|
|
unique_together = ["project", "member", "deleted_at"]
|
|
|
|
|
constraints = [
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["project", "member"],
|
|
|
|
|
condition=Q(deleted_at__isnull=True),
|
|
|
|
|
name="project_member_unique_project_member_when_deleted_at_null",
|
|
|
|
|
)
|
|
|
|
|
]
|
2022-11-29 21:17:42 +00:00
|
|
|
verbose_name = "Project Member"
|
|
|
|
|
verbose_name_plural = "Project Members"
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
db_table = "project_members"
|
2022-11-29 21:17:42 +00:00
|
|
|
ordering = ("-created_at",)
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
"""Return members of the project"""
|
|
|
|
|
return f"{self.member.email} <{self.project.name}>"
|
|
|
|
|
|
2023-02-07 07:50:15 +00:00
|
|
|
|
2022-12-13 18:18:09 +00:00
|
|
|
# TODO: Remove workspace relation later
|
2022-11-29 21:17:42 +00:00
|
|
|
class ProjectIdentifier(AuditModel):
|
2025-09-29 13:45:32 +00:00
|
|
|
workspace = models.ForeignKey("db.Workspace", models.CASCADE, related_name="project_identifiers", null=True)
|
|
|
|
|
project = models.OneToOneField(Project, on_delete=models.CASCADE, related_name="project_identifier")
|
2024-07-23 13:50:50 +00:00
|
|
|
name = models.CharField(max_length=12, db_index=True)
|
2022-11-29 21:17:42 +00:00
|
|
|
|
|
|
|
|
class Meta:
|
2024-07-31 14:08:53 +00:00
|
|
|
unique_together = ["name", "workspace", "deleted_at"]
|
|
|
|
|
constraints = [
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["name", "workspace"],
|
|
|
|
|
condition=Q(deleted_at__isnull=True),
|
|
|
|
|
name="unique_name_workspace_when_deleted_at_null",
|
|
|
|
|
)
|
|
|
|
|
]
|
2022-11-29 21:17:42 +00:00
|
|
|
verbose_name = "Project Identifier"
|
|
|
|
|
verbose_name_plural = "Project Identifiers"
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
db_table = "project_identifiers"
|
2022-11-29 21:17:42 +00:00
|
|
|
ordering = ("-created_at",)
|
2023-03-06 13:27:07 +00:00
|
|
|
|
|
|
|
|
|
2023-08-11 13:57:44 +00:00
|
|
|
def get_anchor():
|
|
|
|
|
return uuid4().hex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_default_views():
|
|
|
|
|
return {
|
|
|
|
|
"list": True,
|
|
|
|
|
"kanban": True,
|
|
|
|
|
"calendar": True,
|
|
|
|
|
"gantt": True,
|
|
|
|
|
"spreadsheet": True,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-06-10 06:46:23 +00:00
|
|
|
# DEPRECATED TODO:
|
|
|
|
|
# used to get the old anchors for the project deploy boards
|
2023-08-11 13:57:44 +00:00
|
|
|
class ProjectDeployBoard(ProjectBaseModel):
|
2025-09-29 13:45:32 +00:00
|
|
|
anchor = models.CharField(max_length=255, default=get_anchor, unique=True, db_index=True)
|
2023-08-11 13:57:44 +00:00
|
|
|
comments = models.BooleanField(default=False)
|
|
|
|
|
reactions = models.BooleanField(default=False)
|
2025-09-29 13:45:32 +00:00
|
|
|
intake = models.ForeignKey("db.Intake", related_name="board_intake", on_delete=models.SET_NULL, null=True)
|
2023-08-11 13:57:44 +00:00
|
|
|
votes = models.BooleanField(default=False)
|
|
|
|
|
views = models.JSONField(default=get_default_views)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
unique_together = ["project", "anchor"]
|
|
|
|
|
verbose_name = "Project Deploy Board"
|
|
|
|
|
verbose_name_plural = "Project Deploy Boards"
|
|
|
|
|
db_table = "project_deploy_boards"
|
|
|
|
|
ordering = ("-created_at",)
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
"""Return project and anchor"""
|
|
|
|
|
return f"{self.anchor} <{self.project.name}>"
|
2023-08-30 06:45:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectPublicMember(ProjectBaseModel):
|
|
|
|
|
member = models.ForeignKey(
|
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
|
related_name="public_project_members",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
2024-08-02 07:45:59 +00:00
|
|
|
unique_together = ["project", "member", "deleted_at"]
|
|
|
|
|
constraints = [
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["project", "member"],
|
|
|
|
|
condition=models.Q(deleted_at__isnull=True),
|
|
|
|
|
name="project_public_member_unique_project_member_when_deleted_at_null",
|
|
|
|
|
)
|
|
|
|
|
]
|
2023-08-30 06:45:08 +00:00
|
|
|
verbose_name = "Project Public Member"
|
|
|
|
|
verbose_name_plural = "Project Public Members"
|
|
|
|
|
db_table = "project_public_members"
|
|
|
|
|
ordering = ("-created_at",)
|
2026-01-06 10:07:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectUserProperty(ProjectBaseModel):
|
|
|
|
|
from .issue import get_default_filters, get_default_display_filters, get_default_display_properties
|
|
|
|
|
|
|
|
|
|
user = models.ForeignKey(
|
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
|
related_name="project_property_user",
|
|
|
|
|
)
|
|
|
|
|
filters = models.JSONField(default=get_default_filters)
|
|
|
|
|
display_filters = models.JSONField(default=get_default_display_filters)
|
|
|
|
|
display_properties = models.JSONField(default=get_default_display_properties)
|
|
|
|
|
rich_filters = models.JSONField(default=dict)
|
|
|
|
|
preferences = models.JSONField(default=get_default_preferences)
|
|
|
|
|
sort_order = models.FloatField(default=65535)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
verbose_name = "Project User Property"
|
|
|
|
|
verbose_name_plural = "Project User Properties"
|
|
|
|
|
db_table = "project_user_properties"
|
|
|
|
|
ordering = ("-created_at",)
|
|
|
|
|
unique_together = ["user", "project", "deleted_at"]
|
|
|
|
|
constraints = [
|
|
|
|
|
models.UniqueConstraint(
|
|
|
|
|
fields=["user", "project"],
|
|
|
|
|
condition=Q(deleted_at__isnull=True),
|
|
|
|
|
name="project_user_property_unique_user_project_when_deleted_at_null",
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
"""Return properties status of the project"""
|
|
|
|
|
return str(self.user)
|