mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
3a678e7261
* Add basic `/api/projects/:id/dashboard/:id/collaborators` * Handle more collaboration cases and add base tests * Add some collaborators UI to share modal * Improve Python typing * Improve TS typing * Allow addition and deletion of collaborators from UI * Add upsell prototype * Improve upsell button * Add `effective_restriction_level` to `DashboardSerializer` * Improve `LemonSelect` value handling * Improve `LemonSelect` behavior when selecting existing value * Refactor the way privilege level name is determined * Don't destroy `ShareModal` on close to avoid logic remounting * Split out upsell into own PR * Fix TS * Fix typing * Increase security with more tests * Inline `parents_query_dict` * Dashboard collaborator bubbles (#8450) * Add collaborator bubbles to restricted dashboard headers * Rename `index.tsx` to `ProfilePicture.tsx` for readability * Improve tooltip handling * Create ProfileBubbles.stories.tsx * Make collaborator bubbles tooltip dashboard-level * Always show collaborator bubbles * Dashboard restrictions (#8462) * Add frontend-side restrictions editing restrictions to dashboards * Restrict `InsightCard` * Align info message margin * Disallow locking yourself out of the dashboard * Handle dashboard restrictions in the insight page * Allow disabling `InsightsTable` series checkbox * Fix minor issues * Align .page-title-row height * Fix typing * Fix arg name * Address review feedback * Fix n+1 queries issue
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from typing import Any, List
|
|
|
|
from django.urls.conf import path
|
|
from rest_framework_extensions.routers import NestedRegistryItem
|
|
|
|
from posthog.api.routing import DefaultRouterPlusPlus
|
|
|
|
from .api import authentication, dashboard_collaborator, debug_ch_queries, explicit_team_member, hooks, license
|
|
|
|
|
|
def extend_api_router(
|
|
root_router: DefaultRouterPlusPlus,
|
|
*,
|
|
projects_router: NestedRegistryItem,
|
|
project_dashboards_router: NestedRegistryItem
|
|
) -> None:
|
|
root_router.register(r"license", license.LicenseViewSet)
|
|
root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries, "debug_ch_queries")
|
|
projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"])
|
|
projects_router.register(
|
|
r"explicit_members", explicit_team_member.ExplicitTeamMemberViewSet, "project_explicit_members", ["team_id"]
|
|
)
|
|
project_dashboards_router.register(
|
|
r"collaborators",
|
|
dashboard_collaborator.DashboardCollaboratorViewSet,
|
|
"project_dashboard_collaborators",
|
|
["team_id", "dashboard_id"],
|
|
)
|
|
|
|
|
|
urlpatterns: List[Any] = [
|
|
path("api/saml/metadata/", authentication.saml_metadata_view),
|
|
]
|