Closed moalamri closed 5 months ago
I added some UI enhancements.
I won’t be home till Monday then I’ll take a look at the changes! From what I can see you’re tackling all the right issues. Cheers man!
tried running the new version, but ran into an error while running.
this is my current list of collections in PocketBase:
this is the error I'm getting:
After looking at the approach, I think a better method might be to initialise all of the important base pcms__
collections using the same installer method used in the PocketBase UI when first logging in.
take a look at this: https://github.com/pocketbase/pocketbase/blob/1682db5c7215b6766c6e569833000f27932357e2/ui/src/components/PageIndex.svelte#L6
Then when first visiting the PocketCMS UI it will set up all the right collections. Do you think this approach would be better?
The steps I think it could follow are:
load PocketBase for the first time, complete installer, load in.
the default PocketBase collections are now created
load PocketCMS for the first time, complete installer
the installer will make requests to PocketBase to create the following collections
pcms__collections
- a view collection used by PocketCMS to view all the PocketCMS collections. This is required because you must be authenticated as a PocketBase admin in order to list collections, this allows a regular user to view the PCMS ones. The current view collection query I have is:
SELECT id, name, schema, listRule, viewRule, createRule, updateRule, deleteRule
FROM _collections
WHERE name LIKE 'pcms|_%' ESCAPE '|'
AND name NOT LIKE 'pcms|_|_%' ESCAPE '|';
pcms__users
- an auth collection containing all the users than can log in to PocketCMS
Hey @parkuman Thank you for testing this out, I honestly didn't test it as a new init setup. You're totally right, we should use the native method the original maintainer used with the correct steps. My pr was to make it easy for users to just clone and jump right into using pocketcms, but I surely had it missing most of the necessary collections (I haven't had it working yet in my end, maybe because I used regular non-admin account). Do you think it is better to have a new PR with the complete auto setup for pocketcms? We better close this one? Also we could bypass the account type limitation if we used hooks to setup the init collections?
Hey @parkuman Thank you for testing this out, I honestly didn't test it as a new init setup. You're totally right, we should use the native method the original maintainer used with the correct steps. My pr was to make it easy for users to just clone and jump right into using pocketcms, but I surely had it missing most of the necessary collections (I haven't had it working yet in my end, maybe because I used regular non-admin account). Do you think it is better to have a new PR with the complete auto setup for pocketcms? We better close this one? Also we could bypass the account type limitation if we used hooks to setup the init collections?
Making a new PR would be good! The work you did on the UI with collections looks great though, maybe we could just rebase this PR to have those UI changes and do the collection setup in a new one. Is that something you want to tackle? If not, I am happy to do it! I am planning on updating the README with better setup instructions in addition to adding some ideas we could build out.
Sounds good 👍🏻 I will rename this PR to highlight the UI enhancements.
cool! I think if we revert the changes to the main.go
file as well I will approve :)
Done :)
It's my first time writing in Go so please review my method to create the
pcms__users
collection before serving, I will add the other collectionpcms__collections
if my method is the correct way. It will make it easier for users to just run and start adding contentsI also add a script to run and serve main.go