-
Notifications
You must be signed in to change notification settings - Fork 3.6k
chore: updated the ssr rendering on sites #6145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c4da96b
fix: refactoring
sriramveeraghanta fcd085d
fix: site ssr implementation
sriramveeraghanta 6a7fe3b
chore: fixed auto reload on file change in sites
gurusainath 58dbbd7
Merge branch 'preview' of gurusainath:makeplane/plane into sites-ssr
gurusainath 777698f
chore: updated constant imports and globalised powerBy component
gurusainath e6ea55d
chore: resolved lint and updated the env
gurusainath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # third party | ||
| from rest_framework.permissions import AllowAny | ||
| from rest_framework import status | ||
| from rest_framework.response import Response | ||
|
|
||
| from plane.db.models import DeployBoard, Project | ||
|
|
||
| from .base import BaseAPIView | ||
| from plane.space.serializer.project import ProjectLiteSerializer | ||
|
|
||
|
|
||
| class ProjectMetaDataEndpoint(BaseAPIView): | ||
| permission_classes = [AllowAny] | ||
|
|
||
| def get(self, request, anchor): | ||
| try: | ||
| deploy_board = DeployBoard.objects.filter( | ||
| anchor=anchor, entity_name="project" | ||
| ).first() | ||
| except DeployBoard.DoesNotExist: | ||
| return Response( | ||
| {"error": "Project is not published"}, status=status.HTTP_404_NOT_FOUND | ||
| ) | ||
|
|
||
| try: | ||
| project_id = deploy_board.entity_identifier | ||
| project = Project.objects.get(id=project_id) | ||
| except Project.DoesNotExist: | ||
| return Response( | ||
| {"error": "Project is not published"}, status=status.HTTP_404_NOT_FOUND | ||
| ) | ||
|
|
||
| serializer = ProjectLiteSerializer(project) | ||
| return Response(serializer.data, status=status.HTTP_200_OK) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| "use client"; | ||
|
|
||
| import { observer } from "mobx-react"; | ||
| import useSWR from "swr"; | ||
| // components | ||
| import { LogoSpinner } from "@/components/common"; | ||
| import { IssuesNavbarRoot } from "@/components/issues"; | ||
| import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error"; | ||
| // hooks | ||
| import { useIssueFilter, usePublish, usePublishList } from "@/hooks/store"; | ||
|
|
||
| type Props = { | ||
| children: React.ReactNode; | ||
| anchor: string; | ||
| }; | ||
|
|
||
| export const IssuesClientLayout = observer((props: Props) => { | ||
| const { children, anchor } = props; | ||
| // store hooks | ||
| const { fetchPublishSettings } = usePublishList(); | ||
| const publishSettings = usePublish(anchor); | ||
| const { updateLayoutOptions } = useIssueFilter(); | ||
| // fetch publish settings | ||
| const { error } = useSWR( | ||
| anchor ? `PUBLISH_SETTINGS_${anchor}` : null, | ||
| anchor | ||
| ? async () => { | ||
| const response = await fetchPublishSettings(anchor); | ||
| if (response.view_props) { | ||
| updateLayoutOptions({ | ||
| list: !!response.view_props.list, | ||
| kanban: !!response.view_props.kanban, | ||
| calendar: !!response.view_props.calendar, | ||
| gantt: !!response.view_props.gantt, | ||
| spreadsheet: !!response.view_props.spreadsheet, | ||
| }); | ||
| } | ||
| } | ||
| : null | ||
| ); | ||
|
|
||
| if (!publishSettings && !error) return <LogoSpinner />; | ||
|
|
||
| if (error) return <SomethingWentWrongError />; | ||
|
|
||
| return ( | ||
| <div className="relative flex h-screen min-h-[500px] w-screen flex-col overflow-hidden"> | ||
| <div className="relative flex h-[60px] flex-shrink-0 select-none items-center border-b border-custom-border-300 bg-custom-sidebar-background-100"> | ||
| <IssuesNavbarRoot publishSettings={publishSettings} /> | ||
| </div> | ||
| <div className="relative h-full w-full overflow-hidden bg-custom-background-90">{children}</div> | ||
| </div> | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| "use client"; | ||
|
|
||
| import { FC, ReactNode } from "react"; | ||
| // components | ||
| import { InstanceProvider } from "@/lib/instance-provider"; | ||
| import { StoreProvider } from "@/lib/store-provider"; | ||
| import { ToastProvider } from "@/lib/toast-provider"; | ||
|
|
||
| interface IAppProvider { | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| export const AppProvider: FC<IAppProvider> = (props) => { | ||
| const { children } = props; | ||
|
|
||
| return ( | ||
| <StoreProvider> | ||
| <ToastProvider> | ||
| <InstanceProvider>{children}</InstanceProvider> | ||
| </ToastProvider> | ||
| </StoreProvider> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from "./project-logo"; | ||
| export * from "./logo-spinner"; | ||
| export * from "./powered-by"; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.