Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/api/plane/api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@
from .invite import WorkspaceInviteSerializer
from .member import ProjectMemberSerializer
from .sticky import StickySerializer
from .page import PageAPISerializer
52 changes: 52 additions & 0 deletions apps/api/plane/api/serializers/page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) 2023-present Plane Software, Inc. and contributors
# SPDX-License-Identifier: AGPL-3.0-only
# See the LICENSE file for details.

# Third party imports
from rest_framework import serializers

# Module imports
from .base import BaseSerializer
from plane.db.models import Page


class PageAPISerializer(BaseSerializer):
"""
Serializer for pages in the public v1 API.

Provides page data including metadata, access control, and
external integration fields for third-party sync workflows.
"""

class Meta:
model = Page
fields = [
"id",
"name",
"description_html",
"access",
"color",
"is_locked",
"archived_at",
"view_props",
"logo_props",
"external_id",
"external_source",
"owned_by",
"parent",
"sort_order",
"created_at",
"updated_at",
"created_by",
"updated_by",
]
read_only_fields = [
"id",
"is_locked",
"archived_at",
"owned_by",
"created_at",
"updated_at",
"created_by",
"updated_by",
]
2 changes: 2 additions & 0 deletions apps/api/plane/api/urls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .work_item import urlpatterns as work_item_patterns
from .invite import urlpatterns as invite_patterns
from .sticky import urlpatterns as sticky_patterns
from .page import urlpatterns as page_patterns

urlpatterns = [
*asset_patterns,
Expand All @@ -22,6 +23,7 @@
*label_patterns,
*member_patterns,
*module_patterns,
*page_patterns,
*project_patterns,
*state_patterns,
*user_patterns,
Expand Down
39 changes: 39 additions & 0 deletions apps/api/plane/api/urls/page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2023-present Plane Software, Inc. and contributors
# SPDX-License-Identifier: AGPL-3.0-only
# See the LICENSE file for details.

from django.urls import path

from plane.api.views.page import (
PageListCreateAPIEndpoint,
PageDetailAPIEndpoint,
PageArchiveAPIEndpoint,
PageLockAPIEndpoint,
)

urlpatterns = [
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/pages/",
PageListCreateAPIEndpoint.as_view(http_method_names=["get", "post"]),
name="page-list-create",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/pages/<uuid:page_id>/",
PageDetailAPIEndpoint.as_view(
http_method_names=["get", "patch", "delete"]
),
name="page-detail",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/pages/<uuid:page_id>/archive/",
PageArchiveAPIEndpoint.as_view(
http_method_names=["post", "delete"]
),
name="page-archive",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/pages/<uuid:page_id>/lock/",
PageLockAPIEndpoint.as_view(http_method_names=["post", "delete"]),
name="page-lock",
),
]
7 changes: 7 additions & 0 deletions apps/api/plane/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,10 @@
from .invite import WorkspaceInvitationsViewset

from .sticky import StickyViewSet

from .page import (
PageListCreateAPIEndpoint,
PageDetailAPIEndpoint,
PageArchiveAPIEndpoint,
PageLockAPIEndpoint,
)
Loading