Add project forking #533
Reference in New Issue
Block a user
Delete Branch "frank/add-project-forking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the ability to fork projects from either the ProjectProfile or Editor routes if user is logged-in.
This design frame shows both the Fork button in the header navbar and the link to a project this was forked from within the details panel. Here is that view in local development:

This design shows the Forks counter in the

ProjectCardcomponent. Here is that count shown in development (disregard the missing images, never took a project image for them):@@ -144,2 +141,2 @@name="Save Project Image"className=" bg-ch-blue-650 bg-opacity-30 hover:bg-opacity-80 text-ch-gray-300"className="bg-ch-pink-800 bg-opacity-30 hover:bg-opacity-80 text-ch-gray-300"onClick={handleRender}Navigate to either the IDE or the details views to match wherever you are now.
TODO regularize these params when the Header component gets regularized.
@@ -52,6 +52,7 @@.markdown-overrides div {@apply text-ch-gray-300 bg-transparent;}.pink-link,Made this a utility class and naming things is hard.
@@ -144,2 +141,2 @@name="Save Project Image"className=" bg-ch-blue-650 bg-opacity-30 hover:bg-opacity-80 text-ch-gray-300"className="bg-ch-pink-800 bg-opacity-30 hover:bg-opacity-80 text-ch-gray-300"onClick={handleRender}This seems a little brittle to me, as I would hope that the component would be able be able to know what page it's on without having to look at the route. What if someone names their project "idea" than it would match on "user/idea" I had a look at seeing what it would take to pass this information to the component instead and realised that it could be done but it would be adding more mess to the messy situation that is this component so I did a big refactor aimed at this branch.
I've put you as a review, but the diff is not super meaningful as it's really just huge chunks of code moved around 🤷
https://github.com/Irev-Dev/cadhub/pull/534
I can't remember if the formatting for the forks always looked like this in the designs or not

So I'll ask, are you querying for the userName because thats how you want to fork formatted,
Add id, can cause caching issues with Apollo
Looks great.
Listing some things that have some to mind that we'll also want to consider going forward.
Up to you if you want to merge this or https://github.com/Irev-Dev/cadhub/pull/534/files first.
Live now, sorry to me a while as I broke the build for pre-rendering in #531