GithubHelp home page GithubHelp logo

birkir / prime Goto Github PK

View Code? Open in Web Editor NEW
1.7K 27.0 101.0 25.92 MB

✨Open Source GraphQL CMS

Home Page: https://docs.primecms.app

License: MIT License

CSS 0.98% TypeScript 94.46% HTML 0.47% JavaScript 2.67% Shell 0.04% Less 1.38%
cms typescript graphql antd prime react mobx-state-tree typeorm type-graphql graphql-modules

prime's People

Contributors

0xflotus avatar andreiconstantinescu avatar badoet avatar bartduisters avatar bbeausej avatar birkir avatar brendonpagano avatar christianulbrich avatar dependabot[bot] avatar dwehrmann avatar intellix avatar its-lucas avatar johannesspohr avatar michallytek avatar moritzgruber avatar mpartipilo avatar mythie avatar pdrvsky avatar pippinthegreat avatar renovate-bot avatar renovate[bot] avatar samtaro avatar snyk-bot avatar swim avatar universlabs avatar vniche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prime's Issues

Cannot read property 'id' of undefined

I saw this app mentioned on Hacker News and deployed a sample Heroku instance with a couple dummy documents in it. I'm unfortunately now unable to run any queries on it. The instance is currently still running and I could email app or database credentials to you if that would be helpful (this is an incredibly cool app you've built, so I'd love to assist if I can). If the instance isn't valuable to you I'll shut it down as it just holds a couple test documents.

Just prior to encountering this issue I had tried switching the API Security setting from public to private and hitting save. I've switched API security back to public and am still seeing the same error result.

In the browser, I can see my documents, for example id:0GzvokOlkj is visible to me at https://prime-try01.herokuapp.com/documents/doc/0GzvokOlkj?locale=en but in the playground and in graphql-ide I get error messages on all my queries, for example

{
  ContentType01(id:"0GzvokOlkj") {
    id,
    something
  }
}

returns

{
  "errors": [
    {
      "message": "Cannot read property 'id' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "ContentType01"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
      }
    }
  ],
  "data": {
    "ContentType01": null
  },
  "extensions": {}
}

and

{
  allContentType01 {
    edges {
      node {
        id,
        something
      }
    }
  }
}

returns

{
  "errors": [
    {
      "message": "Cannot read property 'id' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "allContentType01"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
      }
    }
  ],
  "data": {
    "allContentType01": null
  },
  "extensions": {}
}

Docker Container

Hi,

I am developing a docker container for Prime. You can take a look over here astzweig/docker-primecms.

As soon as issue #117 is resolved, I can finish and publish it on Docker Hub. Would you like to reference that project in the documentation somehow?

[Feature proposal] Schema stitching

How complicated do you think it would be to allow for schema sitiching ?

Maybe it could be another PrimeCMS instance at first to reduce the scope, and then evolve towards a more fully-fledged implementation.

The end idea would be to allow adding a stitched model to our currently edited one, having multiple microservices of PrimeCMS all connected together.

0.3.0-beta.0 release cut

Backlog

  • Setup wizard
  • Previews and cookies handler
  • field-slice refactor (Union bug)
  • field-asset refactor
  • field-select refactor
  • internal/external authorization
  • persist session
  • change password (ui)
  • change email (ui)
  • create user (ui+core)
  • create schema (group name bug)
  • changelog and docs

Contributors

I've spun up a demo and am really impressed with Prime - especially that it's OSS and built on your own time. I could see this growing into something that I could use with client projects, and would love to contribute.

What would be the best way to get started? Anything in particular you'd like to see happen sooner rather than later? I thought the color picker field would be a good way to get familiar..

How to model tags? (list of documents)

Let's say I have some Posts that can have multiple Tags. For example, the TS types would look like:

interface Post {
   id: number;
   title: string;
   body: string;
   tags: Tag[]
}

interface Tag {
   id: number;
   name: string;
   image: Asset;
   plural: string;
}

Mention "SESSION_SECRET" env variable in doc.

Just tried it out. Looks great!

I just wanted to say that I got below error when I run npx primecms start

Error: Unset environment variable in non-development mode: "SESSION_SECRET".

So I added SESSION_SECRET to .env and it works. I think we should mention it in docs.

Thanks.

[Feature proposal] Prime-lite or prime-base basic package with no CMS stuff

I reckon this might be totally out of scope for the project, but since I find myself in the position of wanting this, I do wonder if someone else does, and in that case, if it would be of interest for the prime users to have such a package/boilerplate/documentation available, and of course, as long as @birkir allows it and considers it makes sense. If not it might be just a good exercise to document here or on a blog post or gist or somewhere else.

The thing is, I had never used TypeScript before knowing primeCMS, and also either of the libraries it's using. Peeking around the codebase, has helped me discover great gems like typeorm (which I already adopted and developed my seeds/factories with, thanks to a great w3cc example on a tpyescript/typegraphql seeding.

Anyways, I find myself wanting to replicate pretty much all the basic-libs primeCMS is using, but for a bigger project which may benefit from a CMS, but it requires much more stuff to be developed asides from the CMS as a social/marketplace/platform.

So what I am really asking.
I want to create a trimmed version of prime-core/ui which allows anyone to boilerplate/scaffold a project however they want.

Adding or not CMS features for all or partial of the codebase, should be optional.

I want to use all the same libs, just weight it down so it's usable in more scenarios, both with or without a need for a CMS

does this make any sense?

Do feel free to reject it if it's just not for this project, I understand it's not exactly on the direction of the beta or the roadmap that has been shared so far.

Error while fetching single type schema.

There is an error while fetching the single type schema.
the graphql query throws an error with the following message.

"message": "Cannot read property 'length' of undefined"

note: I am currently using @primecms/core version 0.3.2-beta.3.

how to configure cloudinary properly?

I tried following the video but I'm missing something that may be obvious.

My CLOUDINAR_URL seems to not being set when I create the add-on, even though the CONFIG_VARS show it's there.

So I don't know, how should I modify the contents of store/settings.ts if the file is not in the prime repo or heroku boilerplate eiither?

So sorry if this is documented somewhere but I read the docs and came empty handed, and also can't find anything on the issues besides the one wanting to replace cloudinary alltogether

Groups and templates

Whenever a group is within a template and the template is used in a content type, the group is ignored when queried. Am I doing something wrong? Haven't tried to put the group in the content type because it is redundant if one can use templates for reusable types.

I have tried to debug it, but with no luck so far :(. Do you have any pointers where to look to fix this issue?

Thanks!

Difference between "Document" and "Slice" field.

Hi,

what exactly is the difference between a "Slice" and a "Document" field. "Slice-Content" seems to be just another "Content Type", with the restriction, that it may no be queried directly, but instead has to be referenced in a "Slice" field of a standard "Content Type".

Am I right, when I think of a "Document" field named myField to correspond to the following GraphQL schema:

[...]
union MyFieldDocument = SomeType1 | SomeType2

type MyContentType {
    myField: MyFieldDocument!
}
[...]

If that is right, what exactly does "Slize" correspond to?

Prime fails to load static assets when run from subfolder

Hi,

I am trying to run Prime in a subfolder of the web server (e.g. /cms).

Prime does not seem to respect CORE_URL environment variable on all resources, if the CORE_URL contains a path segment. Example:

If CORE_URL=https://example.com/cms, no static files can be loaded (as the express server is not configured to respect the CORE_URL environment variable).

Localized Field

Do you think it would be possible in the future to have localized fields instead of localized documents?

[Feature Proposal] How to improve prime-cli?

https://medium.com/@nparsons08/crafting-a-command-line-experience-that-developers-love-68657b20c28d
https://oclif.io/
oclif which is a library from heroku/salesforce which they dogfood for their own cli's, seems like a great TS by default option to develop such CLI in case we were to use a library

I was just reading this from @nickparson (stream-cli creator)

It seems to me primeCMS could leverage greatly of a prime-cli optional package, which made easy to configure and develop / publish your project, without being an expert on .env files and such.

Would maybe make easier to spin up your own, and take it from there.

What do you think?

TypeError: Cannot read property 'removeSchema' of null

Hi @birkir

Thanks for building this headless cms. It is very simple and intuitive.

While deleting a schema from the UI (hosted on free Heroku), I get the following error, after pressing ok on the confirmation dialogue.

[GraphQL error]: Message: timestamp out of range: "1556171380226", {message: "timestamp out of range: "1556171380226"", locations: Array(1), path: Array(1), extensions: {…}}extensions: code: "INTERNAL_SERVER_ERROR"exception: code: "22008"file: "timestamp.c"length: 99line: "176"message: "timestamp out of range: "1556171380226""name: "QueryFailedError"parameters: (2) ["4b824c90-8e1a-4d9c-832c-c9e27b62bfbf", 1556171380226]query: "UPDATE "document" SET "deletedAt" = $2, "updatedAt" = CURRENT_TIMESTAMP WHERE "schemaId" = $1"routine: "timestamp_in"severity: "ERROR"__proto__: Object__proto__: Objectlocations: Array(1)0: {line: 2, column: 3}column: 3line: 2__proto__: Objectlength: 1__proto__: Array(0)message: "timestamp out of range: "1556171380226""path: Array(1)0: "removeSchema"length: 1__proto__: Array(0)__proto__: Object
ContentType.ts:114 Uncaught (in promise) TypeError: Cannot read property 'removeSchema' of null
    at ContentType.ts:114
    at S (runtime.js:63)
    at Generator._invoke (runtime.js:282)
    at Generator.e.(/schemas/anonymous function) [as next] (https://sitecms.herokuapp.com/static/js/1.e6e35909.chunk.js:1:2107412)
    at mobx-state-tree.module.js:3130
    at X (mobx.module.js:646)
    at n (mobx.module.js:635)
    at mobx-state-tree.module.js:2228
    at ce (mobx-state-tree.module.js:2112)
    at c (mobx-state-tree.module.js:3090)
(anonymous) @ ContentType.ts:114
S @ runtime.js:63
(anonymous) @ runtime.js:282
e.(anonymous function) @ runtime.js:116
(anonymous) @ mobx-state-tree.module.js:3130
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
c @ mobx-state-tree.module.js:3090
p @ mobx-state-tree.module.js:3129
postMessage (async)
r @ setImmediate.js:136
s.setImmediate @ setImmediate.js:34
p @ mobx-state-tree.module.js:3134
Promise.then (async)
h @ mobx-state-tree.module.js:3180
p @ mobx-state-tree.module.js:3142
f @ mobx-state-tree.module.js:3108
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
(anonymous) @ mobx-state-tree.module.js:3112
r @ mobx-state-tree.module.js:3103
X @ mobx.module.js:646
n @ mobx.module.js:635
(anonymous) @ mobx-state-tree.module.js:2228
ce @ mobx-state-tree.module.js:2112
r @ mobx-state-tree.module.js:2137
onConfirm @ SchemaList.tsx:95
onConfirm @ index.js:142
n.handleClick @ button.js:200
...

Is this related to the application or the infra?

Run prime from root folder's index.js.

According to the documentation,
Prime CMS starts via a command line "npx primecms start".

How can I run Prime from project root folder?

e.g index.js

const Prime = require("@primecms/core")
Prime.start()

Why do I want this?
Because I want to test Prime on cloud function
and it asks me to provide at least index.js file to deploy the app.

Thank you in advance.

Group Type is not usable

Hi,

Nice work, I would use this for a couple of my projects. In fact tried it last night and discovered that any template/content-type that has a group item within it, it's content will not appear inany Graphql queries. I don't know if I am using it wrongly or not, but tried the following scenarios so far:

  • having a group in a Content Type item with a string
  • having a group in a Template item with a string
  • having a group in a Content Type item with a Document pointing to:
    • another document (even though the document is created doesn't appear in the popup)
    • another template

In all cases the contents do not appear in the queries and the only way I could populate the group was if it's items were strings, I would like to be other documents/templates ratehr than strings. Is this possible?

And, am I doing something wrong with the groups that they don't even show in the playground?

Thanks,
Andrei.

Alternative storage for image assets?

Cloudinary is an amazing service, but if you run out of credits it's $89 to unbreak things for a month.

A back-of-the-envelope calculation suggests I can get 1/4 of the way by syncing all of my Google Photos to a Prime CMS instance, even if no one looks at them, which makes me question whether I'd fit within a free plan if someone does 😜

I don't have a path to making money from from page views in mind, or a startup of my own that I can share an API key with, so this is a little scary.

Are there plans for a prime-field-asset variant that stores images locally / in low-cost general purpose cloud storage? It wouldn't need to resize images to be useful, since Gatsby can do this for static sites and programs like willnorris/imageproxy can do this for dynamic sites.

And if there aren't and I wanted to write one, would it make sense to add to prime-field-asset (to keep the editing options the field offers today,) or to make additional derived field types (prime-field-cloudinary-asset, prime-field-local-asset, ...) ?

Deleted type, getting loader.load() error

Got this error after deleting a type in which there was content taht I hadn't deleted.

Error! GraphQL error: The loader.load() function must be called with a value,but got: null. GraphQL error: Cannot read property 'toLowerCase' of null

Guessing the deletion needs some kind of warning like "Content exists, you need to delete it first [OK] [Delete ALL]".

Webhook on model change ?

Hey,
I'm testing out your framework for our app, and trying to see if it could fit our needs. I managed to connect a webhook on new documents, but it seems there is no webhook on Schema change. You think this could be possible ? My usecase would be to notify another graphql server that the schema has been updated so it can fetch the schema again and rebuild.
I'm trying to understand all of the code repo and could get this together after a while and submit a PR, just wondering if you could get this going quicker than I.
Best,
James

MongoDB with Prime?

Firstly, thanks for building this amazing CMS.
I know how good PostgreSQL is, but I am not very familiar with it
and I use MongoDB for most of my projects.

Can I use MongoDB with Prime? or Any roadmap? Thanks.

Heroku deploy doesn't work

Just tried clicking on Heroku button and, at least for me, didn't work.

This is build log output:

-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 10.x...
       Downloading and installing node 10.14.2...
       Using default npm version: 6.4.1
       
-----> Building dependencies
       Installing node modules (package.json + package-lock)
       
       > [email protected] install /tmp/build_33161276506325f845ee025f411e5861/node_modules/bcrypt
       > node-pre-gyp install --fallback-to-build
       
       [bcrypt] Success: "/tmp/build_33161276506325f845ee025f411e5861/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
       
       > @newrelic/[email protected] install /tmp/build_33161276506325f845ee025f411e5861/node_modules/@newrelic/native-metrics
       > node ./lib/pre-build.js install native_metrics
       
       > /tmp/build_33161276506325f845ee025f411e5861/.heroku/node/bin/node /tmp/build_33161276506325f845ee025f411e5861/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean configure
       > /tmp/build_33161276506325f845ee025f411e5861/.heroku/node/bin/node /tmp/build_33161276506325f845ee025f411e5861/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build -j 1 native_metrics
       make: Entering directory '/tmp/build_33161276506325f845ee025f411e5861/node_modules/@newrelic/native-metrics/build'
         CXX(target) Release/obj.target/native_metrics/src/native_metrics.o
         CXX(target) Release/obj.target/native_metrics/src/GCBinder.o
         CXX(target) Release/obj.target/native_metrics/src/LoopChecker.o
         CXX(target) Release/obj.target/native_metrics/src/RUsageMeter.o
         SOLINK_MODULE(target) Release/obj.target/native_metrics.node
         COPY Release/native_metrics.node
       make: Leaving directory '/tmp/build_33161276506325f845ee025f411e5861/node_modules/@newrelic/native-metrics/build'
       install successful: _newrelic_native_metrics-3_1_2-native_metrics-64-linux-x64
       
       > [email protected] postinstall /tmp/build_33161276506325f845ee025f411e5861/node_modules/protobufjs
       > node scripts/postinstall
       
       added 513 packages from 579 contributors and audited 1264 packages in 19.985s
       found 1 moderate severity vulnerability
         run `npm audit fix` to fix them, or `npm audit` for details
       Running heroku-postbuild
       
       > [email protected] heroku-postbuild /tmp/build_33161276506325f845ee025f411e5861
       > primecms db:init
       
[ERROR] error: no pg_hba.conf entry for host "XX.XX.XX.XX", user "xxxxx", database "xxxxx", SSL off
    at Connection.parseE (/tmp/build_33161276506325f845ee025f411e5861/node_modules/pg/lib/connection.js:554:11)
    at Connection.parseMessage (/tmp/build_33161276506325f845ee025f411e5861/node_modules/pg/lib/connection.js:379:19)
    at Socket.<anonymous> (/tmp/build_33161276506325f845ee025f411e5861/node_modules/pg/lib/connection.js:119:22)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] heroku-postbuild: `primecms db:init`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npmcache.HZjBf/_logs/2018-12-22T18_52_52_120Z-debug.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

Lerna

Tried installing Lerna but couldn't get the workspace up and running. Is this the kind of framework that'll only ever work nicely on UNIX ?
Might as weel get my dual boot going sometime if that's the case. Would love to help you out on this project :-).

Could not resolve field module "@primecms/field-asset"

Following the guide for contributing I found the following:

  • The ".env" file must be placed in /packages/prime-core
  • The SESSION_SECRET must also be set.

Running lerna run dev --stream or npm run dev results in many entries like this:

@primecms/core: ERROR: Could not resolve field module "@primecms/field-asset"

What am I missing?

PrimeCMS updater error

While trying to update PrimeCMS' packages from its own settings the following response is being received:

 "errors": [
    {
      "message": "Command failed: yarn add\nerror Missing list of packages to add to your project.\n",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "updateSystem"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "killed": false,
          "code": 1,
          "signal": null,
          "cmd": "yarn add"
        }
      }
    }
  ],
  "data": null
}

I suspect the error is related with some paths where the exec(...) is being executed and not finding the package.json (which is in the root of the project). What do you think?

Documentation Clarification

Is it possible to update the documentation with more detail for getting started? For example, it says to modify the ".env" file but doesn't list where it is and a file search for "*.env" returns nothing. The only one that seems to be present is /usr/lib/node_modules/@primecms/cli/template/_.env on CentOS7 which has jinja2 syntax for the database but doesn't seem to affect anything when changed and the app still connects to 127.0.0.1 instead of the actual DB.

Querying by subdocuments

I would like to search by subdocuments.
I have an author in the blogPost type and I would like to get all posts by selected author.

image

Where I can dig in to add a support for this kind of feature?

Feature: Color Field

From the [Project card](https://github.com/birkir/prime/projects/1#card-
15989935):

Allow developers to add a color field to their schema.

Possible options?

Allow alpha
List of colors as swatch (brand colors)
Output: [rgb,hex,hsl,hsv]?

Some other possible options:

  • Restrict to list of swatches (no custom colors)

Possible output (copied from @sanity/color-input):

{
  _type: 'color',
  hex: '#29158a',
  alpha: 0.9,
  hsl: {
    _type: 'hslaColor',
    h: 249.99999999999994,
    s: 0.7328000000000001,
    l: 0.313,
    a: 0.9
  },
  hsv: {
    _type: 'hsvaColor',
    h: 249.99999999999994,
    s: 0.8457987072945522,
    v: 0.5423664,
    a: 0.9
  },
  rgb: {
    _type: 'rgbaColor',
    r: 41
    g: 21,
    b: 138,
    a: 0.9
  }
}

UI nice-to-haves:

  • Gradient + Slider picker to switch between RGB/Hex/HSL
  • Palette picker (pre-defined swatches, no saving new colors to palette)

Maybe just use the Chrome DevTools UI as a reference?

image

GraphiQL not finding any nodes

Weird bug, PrimeCMS was working well 2 days ago, did a few modifications on schema, and now the interface seems to pick up the different models, so "allContentEntries" seems to work fine, but individual "allModelName" queries don't find anything.
Guessing I might have to reset my heroku isntance, but wondering if this meant anything to you ?

[Fix] Yarn start command.

The yarn start script was not working to start the dev. I have restored the old dev script in order to make it work locally. See #95. With this it works as expected 😄

If there are any problems shout 😛.

UnhandledPromiseRejectionWarning: Error: Schema must contain unique named types but contains multiple types named "PrimeFieldNumberWhere".

This error happenned after creating/deleting and creating again a custom type schema from the frontend

npx primecms start
Unset environment variable in non-development mode: "SESSION_SECRET"
This can be very dangerous
(node:6023) UnhandledPromiseRejectionWarning: Error: Schema must contain unique named types but contains multiple types named "PrimeFieldNumberWhere".
    at invariant (/Users/agustif/Code/prime/node_modules/graphql/jsutils/invariant.js:19:11)
    at typeMapReducer (/Users/agustif/Code/prime/node_modules/graphql/type/schema.js:252:57)
    at typeMapReducer (/Users/agustif/Code/prime/node_modules/graphql/type/schema.js:309:22)
    at Array.reduce (<anonymous>)
    at typeMapReducer (/Users/agustif/Code/prime/node_modules/graphql/type/schema.js:280:38)
    at Array.reduce (<anonymous>)
    at new GraphQLSchema (/Users/agustif/Code/prime/node_modules/graphql/type/schema.js:125:28)
    at Object.<anonymous> (/Users/agustif/Code/prime/node_modules/@primecms/core/lib/routes/external/index.js:132:20)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/agustif/Code/prime/node_modules/@primecms/core/lib/routes/external/index.js:4:58)
(node:6023) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6023) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

How to create a custom field?

I will try to attempt a custom field based on the guidelines in the docs consulting the prime-number package. Maybe it would be a good first PR to add as a custom example number employing the Groups/DateTime/Numbers fields already available as primecms primitives..

I actually want to accomplish a 'TripDates' Group field which would contain at least 2 DateTime fields (startDate,endDate) maybe something extra as a boolean or string, I don't know for sure yet

I would like to use the dual calendar example in ant.design docs (https://ant.design/components/date-picker/)
Start/End Date

I would report back my advancements on this effort.

add users

Hi,

I can't add new users, the "create" button is greyed out. I deployed the project on Heroku, do I need to configure something ?

It would be really great if we could delegate authentication and roles to a third party tool like Keycloak or Okta

Webhook calls error on settings page

"Cannot query field "allWebhookCalls" on type "Query". Did you mean "allWebhooks"?"

Guessing there was an update that you didn't have time to report in the UI :-).

Not more than 10 documents possible?

Hi and thanks for all your work.

I'm just trying to implement your CMS into one of our projects but hit a roadblock:
I have created and published 12 documents, but I only see 10 documents in the backend. Looks like pagination is failing.

Obviously the data is there (it is visible in the frontend), but I cannot update or edit any other than the first 10 documents in the backend.

There are no errors in the console or from the server, so I'm not sure where to start. Any help would be greatly appreciated.

Localization on Fields vs Documents

Just for discussion:

Sanity handles localization on a field level. Prime seems to be set up to do this on a document level.

I suppose there's "right" way to do this because use cases will differ, for instance:

On a travel website, we might want to display a different homepage based on the viewer's locale. This page would be a document with fields like:

  • Cover Photo
  • Travel Recommendations
  • Customer testimonials

British users will see recommendations to (for example) the Caribbean, while Cuban users will see recommendations to New York or London.

Localization on documents would make the most sense here.

On the other hand, on a blog/journal website, an Article document might look like:

  • Title
  • Author
  • Body
  • Further Reading
    • Link
    • Description

Here, the Further Reading field would be an array of entries. The article is going to have the same "further reading" no matter what the translation is. But, the Spanish translation would need to have a description in Spanish.

If localization were only on a document level, users of the CMS would need to manually add the Further Reading entries for each translation - which could lead to a lot of extra work and inconsistency.

Is this something you'd be interested in supporting? I guess it brings up a lot of questions, and both technical and UX issues..

Implement AccountsJS, TypeGraphQL and TypeORM

I've been playing with accounts.js, typeorm and type-graphql (also gqltype).

Looks like a killer combo and I am thinking if I can slowly replace the internal graphql server with it.

Thoughts...

  • Database models would have type-graphql decorators implemented for internal schema use only
  • External schema would stick with vanilla graphql or a separate schema class
  • AccountsJS would require a TypeORM driver, which I've made a PR and has been merged and released (accounts-js/accounts#555)
  • TypeORM has a very easy way of writing custom queries compared to sequelize, so all the custom versioning behavior would be trivial to port
  • We could implement ACL driver for type-graphql by using the Authorization decorator
  • Looks like migrations are easy and almost maintenance free
  • TypeORM has experimental mongodb support so #37 may be a possibility

Links:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.