Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 17 05:20
    jossmac unassigned #3262
  • Jun 14 20:06
    jupazave closed #4555
  • Mar 18 16:42
    apfel-das commented #3994
  • Mar 06 07:07
    sounishnath003 commented #3994
  • Feb 15 03:45

    dcousens on point-readme-to-ks6

    (compare)

  • Feb 15 03:45

    dcousens on master

    Point keystone-classic readme t… don't dance around the wording Merge pull request #5008 from k… (compare)

  • Feb 15 03:45
    dcousens closed #5008
  • Feb 15 03:45

    dcousens on point-readme-to-ks6

    don't dance around the wording (compare)

  • Feb 15 03:45
    dcousens synchronize #5008
  • Feb 10 02:08
    Noviny review_requested #5008
  • Feb 10 02:07
    Noviny opened #5008
  • Feb 10 02:07

    Noviny on point-readme-to-ks6

    Point keystone-classic readme t… (compare)

  • Jan 12 11:15
    ankitWVS commented #3994
  • Dec 19 2021 00:40
    tomasignacioc commented #3994
  • Nov 24 2021 03:50

    bladey on master

    Update README.md (compare)

  • Nov 24 2021 03:46

    bladey on master

    Update README.md (compare)

  • Nov 22 2021 20:58
    ibrahimjamil commented #4953
  • Nov 03 2021 03:37
    khalwat commented #1566
  • Nov 03 2021 03:12
    khalwat commented #1566
  • Aug 16 2021 23:28
    sonyafung commented #4913
Ghost
@ghost~56835aa516b6c7089cc090e9
isn't that just for the first model though?
what about subsequent models
(i've already used the yo generator to start my project)
Max Ma
@max8hine_twitter
I am new to keystone tho, as far as I know, yo generator only for the first time when you initial the site.
Ghost
@ghost~56835aa516b6c7089cc090e9
yeah, that much was obivous
i remember back around 2016, there was some sort of cli tool to generate models + updates (then called migrations?)
it seems i'm remembering wrong though, oh well
thanks anyway
1337cookie
@1337cookie
@Lemmmy Sounds like laravel.
Kraig Hufstedler
@kraigh
I have maybe a dumb question, but can someone explain why in a keystone route you can simply do "var locals = res.locals" and then write new properties to that locals object, and it is available in the view without having to write back to res.locals? Is locals = res.locals some sort of pass by reference? Just trying to understand how it works.
Max Ma
@max8hine_twitter
For all I know, Object in Javascript just works in that way. for the deeper reason of how assignment operator works? , dunno about it.
const obj = { greeting: { action: 'hello', object: 'world' } }
const { greeting } = obj
greeting.object = 'you'
console.log(obj.greeting) // {action: "hello", object: "you"}
David Finton
@dfinton
@kraigh Yes, if you have var locals = res.locals then modifying locals will also modify res.locals because you only copied over the reference to the object rather than the object itself. If you want to make a copy of res.locals to a variable called locals and modify that without also modifying the original, you want to use the following code:
var locals = Object.assign({}, res.locals);
Object.assign(...) takes the first object and assigns values from all objects following it to that value. In this case, we're copying the values of res.locals to the empty object {}, effectively copying all the values of res.locals into a new object
Note that this is a shallow copy only. If you have nested objects, the above method won't create new objects for those. You'll need to write a recursive function that does that. A quick google search will tell you how to do that without too much effort :)
Kraig Hufstedler
@kraigh
Interesting, thanks for the help guys! I come from PHP and it works backwards, by default it passes just the value, and you have to specify if its pass by reference. Thanks for the help!
Max Ma
@max8hine_twitter
@dfinton that's very helpful. assignment operator will mutate the original object. but it works differently in Array. very intersting.
Max Ma
@max8hine_twitter
Any thought on the API Auth methods? (JWT)Key based API Auth vs. Session based API Auth?
Max Ma
@max8hine_twitter
I read few articles about JWT based Auth, seems it has some pitfalls, such as where to store, expiry times, etc. but what's the good part of using JWT?
Mitul Patel
@mitul69
Hello Is there way i will store settings in Database without listing
Directly i can update it ?
Vamshi Bachaneboina
@vamshi9
Hey! I have been struggling with the date picker in admin panel. Can I get date picker as in only Year picker? I can do it with Types.Select but it is kinda manual work right to write all the years!
1337cookie
@1337cookie
@vamshi9
year: { type: Types.Date, format: 'YYYY' }
I think the admin UI should automatically adjust, cant be sure though.
Navid
@navidshad
hey, I cant start keystone on pm2. pm2 could not read "COOKIE_SECRET" from .env file.
I set an environment variable in pm2 config file but I got the error again.
what shall I do ?
Chris Hurst
@ytsruh
@navidshad I could never get it to work with PM2 either, I had to revert to use a .env file
Pavelescu Razvan
@pavelescurazvan
Hello, I need to integrate user chat in a project, should I use socket.io or does anyone know a better way?
Vamshi Bachaneboina
@vamshi9
@1337cookie I tried that!
but didn't work that :/
mnksingh
@mnksingh
Hey guys couldnt find anything to integrate marcojs as templating engine with keystonejs. Any idea how could i do that, or any reference. Thank you
Vamshi Bachaneboina
@vamshi9
Can we modify fields as per the options seleceted in admin panel? For example if I have state as 3 options, and if I select first option the following field must be manipulated accordingly. Can this be done?
Research.add({
     title                       : {type : String, required : true},
     state                       : {type : Types.Select, options : 'Submitted, Ongoing , Completed',default : 'Submitted'},
     principalInvestigator       : {type : String},
     coInvestigator              : {type : String},
     fundingAgency               : {type : String},
     sanctionedAmount            : {type : Number,note:'lakhs'},
     from                        : {type : Types.Date},
     to                          : {type : Types.Date},
});
I want from to be gone if submitted is selected. How to track this state?
Vamshi Bachaneboina
@vamshi9
A function something like this!
Research.schema.pre('save',function(next){
    console.log(this.state);

    if(this.state=="submitted"){
        this.from.label = 'on';
        this.to.hidden = 'true';
    }
    next();
});
Vamshi Bachaneboina
@vamshi9
Is this group alive?
simranprdxn
@simranprdxn
Yes, I want to know the same thing. I want to modify the Types.Select options so that I can attach an Object as a value
grexen
@grexen
Hey guys, can someone give me some advice how to put a route parameter with a html form (without using frontend JS)?
Patrick McDonough
@patrickPDD
I'm having issue with using mongolab for a database- added MONGO_UR to .env file but don't see any reference to it in the codebase . Any one else have this issue?
Kenna
@mommylonewolf_twitter
Hello according to keystonejs config you use tinyMCE, and im a bit confused where to enable the additional tinymce options at in keystonejs
Kenna
@mommylonewolf_twitter
i figured it out , nvm.
alb445
@alb445

I want to add a logo to a keystone project or if logo is not possible, just a simple text. I was able to add the logo only during the login process. I suppose the best place to add the logo is the navigation bar but its not a must.

I tried to changed the home logo <span class="octicon octicon-home"></span> with my logo but was not able to found where.

I tried to add img(src='/images/logo.png', width='160') to templates/layouts/default.pub but I got an error img is a self closing element: <img/> but contains nested content. It's also wrote There is no .container wrapping class around body blocks to allow more flexibility in design

I tried to add an iFrame using javascript and tried to put some html code on it. This also didn't worked.

I also tried to set a label or singular to one page but this is not what I need

Do you have any idea?

Brandon Taylor
@alsoicode_gitlab

Hello everyone. I've added a custom validator to a text field, but the admin UI isn't displaying the message property of the validator. Instead it displays: "ValidationError: [model name] validation failed". Example:

phone: {
      type: Types.Text,
      required: [true, 'Phone number is required'],
      initial: true,
      validate: {
        validator: function(value: any) {
          return /\d{3}-\d{3}-\d{4}/.test(value);
        },
        message: '{VALUE} is not a valid phone number',
      },
    },

What am I doing wrong?

I'm using Keystone 4 beta 8 and TypeScript btw
Mihajlo Ilijić
@Pritilender
Hi. Is there a way to set max dimensions of images uploaded to Cloudinary?
Roman
@alphamyd
Hello!
Is it possible to use social login in keystone.js?
Max Ma
@max8hine
@alphamyd check out syd.js project. it has an example for social login
@alsoicode_gitlab I think req.flash doesn't support to do validation check via mongoose
Max Ma
@max8hine
you need to convert the error data and make it ready to consume by flash-messages.pug
Philip Cox
@_philipjc_twitter
Hello Keystone community. I hope it's okay to throw a question out here, I've just started using KS and I am having trouble getting a custom JS file to run. I am have a file in a dir called pages, inside /public/js/. This is a class that I would like to use JS in and manipulate the DOM. I have placed a src tag inside the JS block as defined in default.html, but I am getting such errors as document is not defined etc. Now I know this is because the document is not yet ready and KS is processing on the server. But is there a way to add custom JS to my pages, please? Thanks so much.
Stephen Steneker
@stennie
Hello KeystoneJS community! Great to see there are more than 750 interested folks in this channel :). As a Keystone user I'm very keen to help Keystone 4 finally lose the beta label and see some healthy engagement between community & contributors. There's some active discussion starting up on the KeystoneJS Slack, and I'd like to invite anyone interested to join via https://launchpass.com/keystonejs.