GithubHelp home page GithubHelp logo

isbx-loopback-cms's People

Contributors

carlitolee avatar coolwr avatar csapinoso avatar dzorrilla avatar henrymannisbx avatar jllaneza avatar leolynn avatar myeganyan avatar npedrini avatar tienshiao avatar tma-isbx 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

Watchers

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

isbx-loopback-cms's Issues

Cannot read property '__model' of undefined

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?

There is pretty much nothing working

#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

Installing the Demo app

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,

Setting up

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.

Error saving model

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?

Unable to login through CMS

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?

Multiple error by refused to execute script

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:

Install documentation is not clear

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!

restApiRoot not recognized for login request

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?

angular error on missing property object

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 :)

Why aren't you using AngularJS Client SDK?

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?

Extending User model

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 !

ModelList - sorting and then resizing causes loadItems() to be called while dragging/resizing

https://github.com/ISBX/isbx-loopback-cms/blob/master/client/app/dashboard/model/list/ModelList.js#L692

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).

https://github.com/ISBX/isbx-loopback-cms/blob/master/client/app/dashboard/model/list/ModelList.js#L295

Unexpected behavior in Location field

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.

  • Most importantly, the directive never seems to update the associated model property (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.
  • The directive loads the GoogleMaps JS internally, but doesn't check for its existence in the link function, which throws a null reference error on line 92 when 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.
  • The search box is only used to trigger a search when it has focus and the enter key is pressed (which as a side effect triggers submission of the edit form as a whole); whatever text is entered into it is never sent to the geocode or textsearch service. Recommendation is to remove the field and add a search button that triggers the search
  • The radius select is not used in initSearch() either, and has no affect since there is no model associated with it in the template. While it affects the size of the circle that circumscribes the search results, those are only displayed on init if display.options.placeType is set. Recommendation is to remove the radius select, since radius is passed to google.maps.places.PlacesService.textSearch anyway
  • The search results don't seem to do anything when selected. Recommendation is to put them into a Bootstrap selectable list, and set the geopoint value to match the selected location when clicked.
  • Field description is duplicated within the directive (also rendered in ModelField.js)

From 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.

Clearer contribution guidelines?

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!

CMS main sidebar navigation missing

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/

Below I attach sample screen:
image

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

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.