isbx / isbx-loopback-cms Goto Github PK
View Code? Open in Web Editor NEWContent Management System (CMS) for Node JS LoopBack projects
License: MIT License
Content Management System (CMS) for Node JS LoopBack projects
License: MIT License
Following the tutorial and using the standard built-in user and authentication models, I am unable to save new or updated users. Specific error:
TypeError: Cannot read property '__model' of undefined
at Object.upsert (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/server/relational-upsert.js:44:30)
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/index.js:311:22
at Layer.handle as handle_request
at next (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/route.js:100:13)
at Route.dispatch (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/route.js:81:3)
at Layer.handle as handle_request
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:234:24
at Function.proto.process_params (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:312:12)
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:228:12
at Function.match_layer (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:295:3)
I have tried with both in-memory and a Postgres connected database.
It is worth noting that my common > models directory is empty given I haven't extended the built-in models (yet). The examples extend User as Account.
Should this work as is, or do I need to have .js and .json files in the model directory?
Can you supply a more complete example to download and compare?
#node v6.9.1 npm 4.0.2 windows 10 64 bit
slc loopback
tried loopback 2,x and 3.x with empy and note sample
applied changes from wiki like so:
note: the wiki starts with a very wrong vommand "npm ssh://https://github.com/ISBX/isbx-loopback-cms.git"
1, npm install https://github.com/ISBX/isbx-loopback-cms.git --save
2. copy boot-cms.js
3. set RoleMapping and Role to be public
4. created CMS/config.json - why ist the defaulte port 3005 in the CMS/config.json !? doesnt have any effect!?
btw: http://localhost:3000/cms/ give a blank page with a lot of errors:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/cms/vendor/jquery-resizable-columns/dist/jquery.resizableColumns.css".
localhost/:16 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/cms/vendor/bootstrap3-datetimepicker/build/css/bootstrap-datetimepicker.min.css".
localhost/:21 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/cms/css/custom.css"
Refused to execute script from 'http://localhost:3000/cms/config.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/app.js
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/dashboard/alert/Alert.js
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/dashboard/Dashboard.js
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/dashboard/model/DashboardModel.js
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/dashboard/model/DashboardModelAction.js
localhost/:1 Not allowed to load local resource: file:///C:/loopback-cms2/node_modules/isbx-loopback-cms/client/app/dashboard/model/definition/ModelDefinition.js
[...]
what's wrong? thx
Hi, thanks for this project,
When I "grunt build" and after I delete the jslint tasks, I get:
Warning: Unable to read "src/index.html" file (Error code: ENOENT).
Ta,
Hi!
I have a hard time trying to set it up, since the wiki entry is hidden (not public) I don't know how to set up the /CMS/config.json.
Would be nice if you could provide a sample file.
cheers,
e.
I have successfully integrated the cms (version 0.0.14) in my loopback project (loopback version 2.22.0). I am able to add some models and list them in the cms backend. However, when I try to add a model instance, e.g. a User, from the web interface i get the following message:
TypeError: Cannot read property '__model' of undefined
This error originates in index.js on line 296, i.e.:
app.put('/model/save', function(req, res) {
//TODO: validate access token and ACL
var data = req.body;
relationalUpsert.upsert(data, function(error, response)
It seems that body is undefined. Any idea?
Hello, I am starting a new project and would really like to get your CMS working. I am running into an issue getting any user to be able to login. I followed your suggestion in the wiki to create an Extended User Model named "Account". I pointed the CMS config.json to use the new model for auth and created a new user. When I try to login, however, I keep getting this message:
There is no method to handle POST /User/login?include=user
I tried overriding the Account/login
route to take a user param and pass it in as the email but that doesn't seem to do anything. Any help would be greatly appreciated.
Also is there a demo app that I can install and check my configuration against?
Hello,
I have several error in the console of chrome and the page cms is blank:
the error:
Refused to execute script from 'http://localhost:3000/cms/config.js?v=0.0.19' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught TypeError: Cannot read property 'apiBaseUrl' of undefined
Refused to execute script from 'http://localhost:3000/cms/dev-templates.js?v=0.0.19' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught Error: [$injector:modulerr] Failed to instantiate module dashboard due to:
When using CMS, I few time changed the DB. Then I've noticed that CMS can't properly handle of logging out user when DB has changed.
Hello,how can i grant access for login only for user with SuperAdmin role and denied access for other users?
Thanks!
Hello.
First off I want to be really clear that I understand that this project is very early in dev. I would like to see if I could help this project succeed as I think it could be really amazing if it works well.
with that said, I have been unable to get it to work following the install instructions on the wiki. i tried running the npm ssh://https://github.com/ISBX/isbx-loopback-cms.git
but get a message that this is not a valid command for npm.
I tried adding the package as a dependency to the package.json file and then ran npm install
.
however I still get an error that there is no "CMS" folder. I feel like I am missing a step? I did add the boot script with no issues, but I feel there is more. should I have cloned the project into my strong loop project?
Thanks so much for creating this project, I really want to see it succeed!
Thanks for putting together what seems to be a very promising project.
I have my Loopback API running at 0.0.0.0:8000/v2
, however, when I try to login to the CMS it's hitting http://0.0.0.0:8000/api/user/login?include=user
. If I console.log
restApiRoot
in boot-cms.js, it's properly set to /v2
. What do I need to do differently in order to tell the CMS to POST the login to the correct url?
Hi. I wand to start off by staying that I rely appreciate your work!
I'v found a but we might discuss about.
Let's say you have a model that extends default User, call it Account
I am unable to add or edit record unless I map every property from User to Account by hand, it doesn't read extended models. The same goes for RoleMapping, TypeError: Cannot read property 'id' of undefined
because field id isn't explicitly stated in RoleMapping model, but uses "idInjection": true
param.
To draw a bigger picture, we are working on an open source project and I am trying to implement your CMS into it for convenience.
Let me know if you require anything else from me and how can we fix this issue :)
Hi there,
We noticed that your repo has a high severity vulnerability:
negotiator
<= 0.6.0Here is the test report for this repo.
If you’d like to fix this vulnerability, Snyk lets you generate a pull request that recommends the best upgrade path - there’s a link to fix this vulnerability on the test report.
Stay secure :-)
Ben from the Snyk team
Not an issue - more of a question. I like the idea of the API helper, but wondering why you chose not to use the Loopback AngularJS Client SDK code? Wouldn't that provide a cleaner implementation?
My User model is an extended one. I noticed edition didn't gathered base class properties. I patched locally in ModelEdit.js but wanted to know if you have a specific configuration to correctly tell ISBX which class to gather base user properties together with my customer User properties.
hope you get what I mean
Thanks for your work !
The $watch on the 'sortInfo' is constantly fired, and newVal !== oldVal because newVal and oldVal also include the column, which includes the columns width.
Proposed solution: instead of comparing all of newVal and oldVal, we should compare if the sort attributes we depend on have changed (sortInfo.fields and sortInfo.directions).
please refer a link to the demo site..
The ModelFieldLocation is a big help! Thanks for putting it together.
In working on integrating it as a field that allows for the editing of a geopoint, I noticed a few inconsistencies that I wanted to ask about. I have started on refactoring the directive somewhat to address some of the issues mentioned below, but please let me know if any of these assumptions are incorrect.
scope.data
is never updated). Recommendation is to add input fields for lat/lng at the top of the form, show a map marker on the map indicating the current location (with a different color than those used for the search results), and allow the geopoint value to be updated by dragging the marker or editing the fields. If the value is changed, a reset button appears or becomes enabled allowing the user to reset the point to the original value.bounds
is initialized to a new google.maps.LatLngBounds
. Recommendation is to move script loading to a loadScript
function that returns a promise, call it at the top of the link function, and move the majority of the rest of the link function into the then()
handler.google.maps.places.PlacesService.textSearch
anywayFrom looking at some of the associated commits, it seems one of the requirements driving the field's creation was the ability to show a list of pharmacies on load, but it would be great to get a little more clarity on the expected/required behavior is so it can be maintained if some of these changes are made. Curious what your thoughts are.
Wondering if there are any plans/interest in developing an Angular 2 version?
Currently the /cms/model/save end point does not validate access token and ACL permissions. This is a major vulnerability
First off, let me restate that this project is great. The company I work for plans to leverage it heavily for a project of our own, so thank you for all the work that's gone into getting it this far.
That said, there is a good bit of functionality we'd like to add, and it would be great to get some guidance on the most effective way to contribute, get those changes rolled back into master, and what we can reasonably expect that process to look like.
There are a handful of pull requests that go back to July, for example, but they all seem to be pending. I understand triaging/commenting on pull requests can be time consuming, and that that time probably never really exists, but I just want to get a better sense of what contributors can expect as far as how we can help the project continue to grow. Thanks!
During implementing sample models like example news
, I've came across some difficulties.
The main navigation bar (related to nav
object in CMS/config.json
) and buttons are missing, but models can access directly with its links like:
http://.../cms/dashboard/news/
http://.../cms/dashboard/whatever/
And snippet of CMS/config.json
:
{
"private": {
<CUTTED>
},
"public": {
"address": "0.0.0.0",
"port": 3005,
"title": "",
"css": "/css/custom.css",
"authModel": "Accounts",
"profileModel": "Account",
"profileKey": "id",
"defaultNav": {
"route": "list",
"params": {
"model": "accounts"
}
},
"customModules": [],
"nav": [
{
"label": "Accounts",
"path": "accounts",
"icon": "fa-user",
"roles": ["admin"],
"url": "/cms/dashboard/accounts",
"defaultSubNavIndex": 1,
"subnav": [
<CUTTED>
]
},
{
"label": "News",
"path": "news",
"icon": "fa-newspaper-o",
"roles": ["admin", "manager", "editor"],
"url": "/cms/dashboard/news",
"defaultSubNavIndex": 2,
"subnav": [
{
"label": "Add",
"route": "edit",
"roles": ["admin", "editor", "manager"],
"options": {
"model": "News",
"key": "id"
}
},
{
"label": "All News",
"route": "list",
"roles": ["admin", "editor", "manager"],
"options": {
"model": "News",
"key": "id",
"showFilter": true,
"pageSize": 100,
"params": {},
"columns": [
{
"field": "id",
"display": "ID",
"headerClass": "center",
"width": 50
},
<CUTTED>
]
}
}
]
}
]
}
}
Did I miss something in config to enable main nav or is just bug?
Thanks in advance
Hello
I have Parent Model Driver and child model Rider I want to build multiple Rider in driver child at time of creation.
Please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.