-
Notifications
You must be signed in to change notification settings - Fork 614
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
Feat/headless cms installation #825
Feat/headless cms installation #825
Conversation
add `cmsSettings` and `cmsContentModelGroup` models to plugins models
implement `cmsInstall` typeDefs and resolvers
implement `InstallationPlugin` for cms
Starting with this... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at a couple of things (nothing major).
|
||
export default { | ||
typeDefs: /* GraphQL */ ` | ||
type CmsBooleanResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this into the main graphql file, which imports all of these smaller ones. Just so it's more clear that CmsBooleanResponse
is there, and other files can rely on it.
import { GraphQLFieldResolver } from "@webiny/graphql/types"; | ||
|
||
const initialEnvironment = { | ||
id: mdbid(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this, id
will automatically get generated.
const initialEnvironment = { | ||
id: mdbid(), | ||
name: "Production", | ||
description: "Ready to go live", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with something like "This is the production environment".
const initialEnvironmentAlias = { | ||
slug: "production", | ||
name: "Production", | ||
description: "Ready to go live" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with something like "This is the "production" environment alias".
packages/api-headless-cms/src/plugins/graphql/installResolver/install.ts
Show resolved
Hide resolved
if (await settings.data.installed) { | ||
return new ErrorResponse({ | ||
code: "CMS_INSTALL_ABORTED", | ||
message: "Cms is already installed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cms
-> The app is already installed.
} | ||
// Create a production environment | ||
const cmsEnvironmentProduction = await cmsEnvironment.populate({ | ||
id: initialEnvironment.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this.
id: initialEnvironment.id, | ||
name: initialEnvironment.name, | ||
description: initialEnvironment.description, | ||
createdFrom: initialEnvironment.createdFrom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have this prop, right? Anyways, for the initial production environment, it should be null
.
// import header from "./contentDetails/header"; | ||
import revisionContent from "./contentDetails/revisionContent"; | ||
import previewContent from "./contentDetails/contentForm"; | ||
import header from "./contentDetails/header"; | ||
import pageRevisions from "./contentDetails/pageRevisions"; | ||
// import pageRevisions from "./contentDetails/pageRevisions"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also remove the other commented out code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, remove it, and I'll check these files that are commented. They are part of the content model form, which I'm currently working on. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒
Thanks @doitadrian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can merge this.
Related Issue
Issue #808
Headless CMS - Create Installation
Your solution
Implement installation plugin for headless cms
How Has This Been Tested?
Manually, by following these steps:
Screenshots (if relevant):
https://www.loom.com/share/89d7d51051f24e1f91739a3527f7bd6a