From 088cfa4f2d8a915ffb01160b7e28a91fbb23ee13 Mon Sep 17 00:00:00 2001 From: Hendrie Bosch <2402124+hen3bosch@users.noreply.github.com> Date: Tue, 28 Sep 2021 23:05:27 +0200 Subject: [PATCH 1/2] Typo in integrations.mdx (#536) --- docs/docs/general-cadhub/integrations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/general-cadhub/integrations.mdx b/docs/docs/general-cadhub/integrations.mdx index fcb1bbf..e8273a9 100644 --- a/docs/docs/general-cadhub/integrations.mdx +++ b/docs/docs/general-cadhub/integrations.mdx @@ -10,4 +10,4 @@ In order for CadHub to be able to host multiple different Cad packages (OpenSCAD The entry points of the wrappers are in `app/web/src/helpers/cadPackages//Controller.tsx` it's this typescript file that is responsible for enforcing the uniform inputs and outputs, but within the file it's able to do whatever it needs todo, i.e. spin up a worker in the case of JSCAD or make a server call in the case of OpenSCAD and CadQuery. The file should export a render function and in order to help with the inputs and outputs for those looking to add a new integration, there is `demoController.ts` as an example and typing for the render function. ## ServerSide Packages -OpenSCAD and CaqQuery packages by using each of the packages respective CLIs deployed with docker on AWS's container lambdas using the serverless framework, the endpoint that these deployments make is what the wrappers above send requests to. For more information as to how this is setup see [this readme](https://github.com/Irev-Dev/cadhub/tree/main/app/api/src/docker). +OpenSCAD and CadQuery packages by using each of the packages respective CLIs deployed with docker on AWS's container lambdas using the serverless framework, the endpoint that these deployments make is what the wrappers above send requests to. For more information as to how this is setup see [this readme](https://github.com/Irev-Dev/cadhub/tree/main/app/api/src/docker). -- 2.39.5 From 928f17bdaabc6fd8fadb98c2f3c7c125c0a7e289 Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Wed, 29 Sep 2021 07:51:21 +1000 Subject: [PATCH 2/2] fix homepage pre-rendering broken in #531 import form project cell which in tern had dependencies that are not pre render friendly was causing issues --- .../src/components/NavPlusButton/NavPlusButton.tsx | 14 +++++++++++++- app/web/src/components/ProjectCell/ProjectCell.tsx | 14 ++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/web/src/components/NavPlusButton/NavPlusButton.tsx b/app/web/src/components/NavPlusButton/NavPlusButton.tsx index 7fb3fde..f9823d3 100644 --- a/app/web/src/components/NavPlusButton/NavPlusButton.tsx +++ b/app/web/src/components/NavPlusButton/NavPlusButton.tsx @@ -4,11 +4,23 @@ import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' import useUser from 'src/helpers/hooks/useUser' -import { CREATE_PROJECT_MUTATION } from 'src/components/ProjectCell/ProjectCell' import Svg from 'src/components/Svg/Svg' import { Popover } from '@headlessui/react' import { CadPackageType } from 'src/components/CadPackage/CadPackage' +export const CREATE_PROJECT_MUTATION = gql` + mutation CreateProjectMutation($input: CreateProjectInput!) { + createProject(input: $input) { + id + title + user { + id + userName + } + } + } +` + const menuOptions: { name: string sub: string diff --git a/app/web/src/components/ProjectCell/ProjectCell.tsx b/app/web/src/components/ProjectCell/ProjectCell.tsx index 7362156..8c41c20 100644 --- a/app/web/src/components/ProjectCell/ProjectCell.tsx +++ b/app/web/src/components/ProjectCell/ProjectCell.tsx @@ -4,6 +4,7 @@ import { navigate, routes } from '@redwoodjs/router' import { useAuth } from '@redwoodjs/auth' import { useIdeState } from 'src/helpers/hooks/useIdeState' import { IdeContext } from 'src/helpers/hooks/useIdeContext' +import { CREATE_PROJECT_MUTATION } from 'src/components/NavPlusButton/NavPlusButton' import ProjectProfile from 'src/components/ProjectProfile/ProjectProfile' import { QUERY as PROJECT_REACTION_QUERY } from 'src/components/ProjectReactionsCell' @@ -76,18 +77,7 @@ const UPDATE_PROJECT_MUTATION = gql` } } ` -export const CREATE_PROJECT_MUTATION = gql` - mutation CreateProjectMutation($input: CreateProjectInput!) { - createProject(input: $input) { - id - title - user { - id - userName - } - } - } -` + const TOGGLE_REACTION_MUTATION = gql` mutation ToggleReactionMutation($input: ToggleProjectReactionInput!) { toggleProjectReaction(input: $input) { -- 2.39.5