Giter Club home page Giter Club logo

keystone-test-project's People

Contributors

bladey avatar creynders avatar ianaya89 avatar jedwatson avatar josephg avatar jossmac avatar kevinold avatar lorbuschris avatar mxstbr avatar twalve 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

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

keystone-test-project's Issues

Mongo error starting test project

Following the "Complete Getting Started Guide" detailed at keystonejs/keystone#1612, I receive an error when starting the test project. Mongod is running and otherwise working.

npm

$ KEYSTONE_DEV=true npm start

> [email protected] start /Users/nifl/Projects/Web/keystone-sites/keystone-test-project
> node keystone.js

------------------------------------------------
Mongo Error:

{ [MongoError: getaddrinfo ENOTFOUND undefined undefined:27017]
  name: 'MongoError',
  message: 'getaddrinfo ENOTFOUND undefined undefined:27017' }
Error: KeystoneJS (Keystone Test) failed to start - Check that you are running `mongod` in a separate process.
    at NativeConnection.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/lib/core/openDatabaseConnection.js:48:10)
    at emitOne (events.js:77:13)
    at NativeConnection.emit (events.js:169:7)
    at NativeConnection.Connection.error (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/connection.js:425:8)
    at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/connection.js:452:14
    at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:52:21
    at /Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb/lib/db.js:226:14
    at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb/lib/server.js:233:9)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/topologies/server.js:263:68)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at null.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/connection/pool.js:77:12)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (/Users/nifl/Projects/Web/keystone-sites/keystone/node_modules/mongodb-core/lib/connection/connection.js:121:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node keystone.js'.
npm ERR! This is most likely a problem with the keystone-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node keystone.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls keystone-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/nifl/Projects/Web/keystone-sites/keystone-test-project/npm-debug.log

mongod:

$ mongod
2015-11-02T22:48:52.399-0800 I JOURNAL  [initandlisten] journal dir=/data/db/journal
2015-11-02T22:48:52.400-0800 I JOURNAL  [initandlisten] recover : no journal files present, no recovery needed
2015-11-02T22:48:52.414-0800 I JOURNAL  [durability] Durability thread started
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] MongoDB starting : pid=33631 port=27017 dbpath=/data/db 64-bit host=Forge.local
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] db version v3.0.7
2015-11-02T22:48:52.414-0800 I JOURNAL  [journal writer] Journal writer thread started
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] git version: nogitversion
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] build info: Darwin elcapitanvm.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] allocator: system
2015-11-02T22:48:52.414-0800 I CONTROL  [initandlisten] options: {}
2015-11-02T22:48:52.444-0800 I NETWORK  [initandlisten] waiting for connections on port 27017

New FS Storage Adapter not saving Images

I am having a problem testing out the new FS Storage Adapter. You can recreate the problem by taking the following steps:

  1. Using keystone-test-project, update models/Post.js to use the FS Adapter:

    var storage = new keystone.Storage({
        adapter: keystone.Storage.Adapters.FS,
        fs: {
            path: keystone.expandPath('./uploads'),
            publicPath: '/public/uploads/',
        },
        ...
    });
    
    Post.add({
        ...
        image: { type: Types.File, storage: storage },
        ...
    });
  2. Launch the keystone-test-project with node keystone

  3. Browse to the Post section of the CMS, create a new Post and upload a photo.

  4. Save that Post (The flash message should report that the save was successful).

  5. Now browse back to the Post listing page: http://localhost:3000/keystone/posts

  6. Click to open the Post you just saved.

  7. Confirm that the Image you uploaded to the Post is not listed, nor is it saved in the uploads folder

API endpoint: `/keystone/api/files/create` returns signin page in test files

On Line 31 of test/api-react/file/1-File.js you make a call to an API endpoint, expecting a json value in return:

api.post('/keystone/api/files/create', {
            body: formData,
            responseType: 'json',
        }

That snippet returns the following error:

xhr:79 Uncaught InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'json').

However (in the name of science), if you change

responseType: 'json'

to

responseType: 'text'

then it simply returns the HTML of the login Page, which means the API calls in the test files aren't recognized as authenticated API calls?:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
    <title>Sign in to Keystone Test</title>
    <link rel="stylesheet" href="/keystone/styles/keystone.min.css">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  </head>
  <body>
    <div id="signin-view"></div>
    <script>
      var Keystone = {"adminPath":"/keystone","brand":"Keystone Test","csrf":{"header":{"x-csrf-token":"o4mFfdnfU9598c28ae972136be40ed9d7a489d66b1959eab0d"}},"from":"/keystone/api/files/create","userCanAccessKeystone":false};
    </script>
    <script src="/keystone/js/packages.js"></script>
    <script src="/keystone/js/signin.js"></script>
  </body>
</html>

Integrate keystone-storage-adapter-s3

Per the conversation with @JedWatson on Slack (#dev):

To get the new keystonejs/keystone-storage-adapter-s3 that @josephg contributed integrated into keystone-test-project:

Steps are [basically]:

In keystone-test-project:

  • add the keystone-storage-adapter-s3 dependency using the git url to the test project’s package.json
  • if (and only if) S3 environment variables are present, create an adapter in the Files list and add a field that uses it
  • load the Admin UI, make sure the new field works as expected (upload / remove files, check they exist in S3 with the correct headers, etc)

In keystonejs/keystone:

  • edit admin/client/utils/List.js and remove both instances of /legacy (this will switch you over to the new api)

I can take this task on if nobody else is working on it...

issue on signin

I cloned the keystone-test-project repo, and when I npm start it, I can go on localhost:3000, but a click on "Got it, let's begin" throws a 500 error:

GET / 304 20.493 ms
GET /js/application.js 304 0.317 ms
GET /keystone/ 302 0.505 ms
Error thrown for request: /keystone/signin
TypeError: Cannot read property 'id' of undefined
    at SigninRoute (D:\DEV\WORKSPACE\keystone-test-project\node_modules\keystone\admin\server\routes\signin.js:17:16)
    at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
    at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:131:13)
    at Route.dispatch (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
    at D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:277:22
    at Function.process_params (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:330:12)
    at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:271:10)
    at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:121:14)
    at exports.persist (D:\DEV\WORKSPACE\keystone-test-project\node_modules\keystone\lib\session.js:210:3)
    at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
    at next (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:131:13)
    at Route.dispatch (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\layer.js:95:5)
    at D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:277:22
    at param (D:\DEV\WORKSPACE\keystone-test-project\node_modules\express\lib\router\index.js:349:14)
GET /keystone/signin 500 0.651 ms

The error is thown by this line: https://github.com/keystonejs/keystone/blob/master/admin/server/routes/signin.js#L17

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.