Allow Resources to be saved as drafts#19
Conversation
create resoucevisibilty enum add resource visibilty as field on Resource model add draft resources to User Model remove draftResources from User Model made skeleton to view draft resources in profile view published resources Change ResourceVisibility.PUBLIC to ResourceVisibility.PUBLISHED add button to save as draft, changed draft to be a boolean in prisma remove unused import disallow published resources from being drafts fixed bug where proposed resources didnt show fixed bug where editing a draft would propose an update instead of just saving changed published to submitted in my-proposed-resources Pretty-fied tabs in my-proposed-resources add warning for resource id add admin tool to delete resource by ID clean up after rebase
|
Someone is attempting to deploy a commit to a Personal Account owned by @aberonni on Vercel. @aberonni first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
aberonni
left a comment
There was a problem hiding this comment.
Thanks for the contribution! This is really cool.
I've added a few comments here and there, but after seeing it in practice I've actually thought up a process that I think I would prefer to this one. I'm gonna outline it here, but you don't have to implement it if you're not up for it. I'm happy to run with it based on your proposal. Lemme know what you think.
- When a user hits "propose new resource", they first see a dialog where they are prompted to enter title and URL
- After submitting the title and URL, we create the resource in the backend (with
publicationStatus: DRAFT), and redirect the user to the "edit" form (so the "create" page does not exist anymore) - In the "edit" form
- We leave the "Save" button but we also add a "Submit for review" button
- We update the alert to explain that you can save as much as you like before submitting for review. Once you hit "submit for review", you can't edit or save anymore
- When the user hits "Submit for review", we simply switch to
publicationStatus: READY_FOR_REVIEW
This would also open up the possibility in the future to fetch similar resources from the backend after the first step (the title dialog) and say "Are you maybe trying to re-create an existing resource?" and show the alternative resources. I wouldn't do this in the first run, but it's an idea.
I think this would make for a smoother, easier to understand UX, and also reduce the amount of complexity we need to add in the codebase. What do you think?
|
@aberonni I perfer your proposal workflow. My Idea originally was just for it to not touch too much of what was already there (hence being a "pre"-step) but your way is much more efficient. I didn't want to respond until I'd had the chance to try it out but I ended up making an implementation in the process so let me know what you think |
aberonni
left a comment
There was a problem hiding this comment.
I didn't dig deep into the implementation because it seems that things still need to be addressed (eg. CI failures, and still some dead code from the previous implementation) so I assume this is still a WIP. That said, I love the new direction and would love to see it through to completion!
I imagine it would be easier for you to test with a real DB. If you hit me up (eg. on LinkedIn) I'd be happy to give you access to a development db with a copy of production data so you can test this more easily, and so that we can get a migration in place on planetscale before eventually merging.
| @@ -1,4 +1,4 @@ | |||
| import { useEffect, useMemo, useState } from "react"; | |||
| import React, { useEffect, useState } from "react"; | |||
There was a problem hiding this comment.
If I'm not mistaken, all the changes in this file can be reverted because the new dialog isn't being used anymore.
|
Thanks! yes, I wanted to get your opinion first to make sure I understood what your suggestion was as I dont have a lot of time in the coming days. |
|
Yeah there's no rush at all so you can take your time. If you'd prefer me to take it on from here that's also fine. Just let me know either way. If you do decide to keep at it, ping me elsewhere so I can give you access to a dev DB branch. |
create resoucevisibilty enum add resource visibilty as field on Resource model add draft resources to User Model remove draftResources from User Model made skeleton to view draft resources in profile view published resources Change ResourceVisibility.PUBLIC to ResourceVisibility.PUBLISHED add button to save as draft, changed draft to be a boolean in prisma remove unused import disallow published resources from being drafts fixed bug where proposed resources didnt show fixed bug where editing a draft would propose an update instead of just saving changed published to submitted in my-proposed-resources Pretty-fied tabs in my-proposed-resources add warning for resource id add admin tool to delete resource by ID clean up after rebase
c9c961a to
0d77e64
Compare
0d77e64 to
895d75a
Compare
fix next step button separate create and update resource schemas
implements #18
Adds "drafts" as a "pre-step" to the current resource workflow, ie, only non-submitted resources can be drafted.
Adds "delete by ID" tool in admin resource approval to help with removing abandoned drafts