Giter Site home page Giter Site logo

ember-admin's People

Contributors

bcardarella avatar brzpegasus avatar clairton avatar codeofficer avatar duggiefresh avatar filipecrosk avatar globegitter avatar michaeldupuis-dockyard avatar miguelcobain avatar nanuxbe avatar rwjblue avatar xiphiasuvella 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

ember-admin's Issues

Breaks with Ember 1.8.0

When trying to create a new model you are getting the following error:
This seems to be related to switching to the morph library rather than the metamorph.

Uncaught TypeError: Cannot read property 'pushChildView' of null vendor.js:52755
merge.appendChild   vendor.js:52755
CoreView.extend.appendChild vendor.js:54535
simpleBind vendor.js:19569
bindHelper   vendor.js:19700
(anonymous function) client/helpers/property-print.js:8
bindView.normalizedValue  vendor.js:19255
SimpleHandlebarsView.render vendor.js:22251
EmberRenderer_createElement  vendor.js:50970
Renderer_renderTree vendor.js:22629
merge.ensureChildrenAreInDOM  vendor.js:52362
View.extend._ensureChildrenAreInDOM vendor.js:52327
DeferredActionQueues.invoke  vendor.js:12725
DeferredActionQueues.flush vendor.js:12777
Backburner.end  vendor.js:12183
Backburner.run vendor.js:12238
apply vendor.js:31331
run vendor.js:29906
hash.success  vendor.js:63258
fire vendor.js:3184
self.fireWith vendor.js:3296
done vendor.js:8362
(anonymous function) vendor.js:8709

using dynamic models

I am creating my models dynamically after loading the schema from the server using

Ember.getOwner(store).register('model: modelName', DS.Model.extend(attributes));

It seems this addon need the actual files for models to be bale to create the models. Is there anyway around that?

Is there anyway to add them into the store which ember-admin use at the same time ?

Doesn't display all columns in model

My model looks like following:

export default DS.Model.extend({
  firstName: DS.attr('string'),
  lastName: DS.attr('string'),
  phone: DS.attr('string'),
  company: DS.attr('string'),
  role: DS.attr('string'),
  email: DS.attr('string')
});

But all I see on http://localhost:4200/admin/user/new is the following:

screen shot 2014-09-18 at 13 38 20

If I remove for example the company column, it does display the (empty) role attribute. I have tried to debug myself, but wasn't able to find the reason just yet. Still looking into it, but maybe someone else has run into the same issue before.

Using without Ember-CLI

Would love to use this, but not using Ember-CLI for this project.

Looks like the files in addon are the relevant items.

Feature Request: Pagination

The model-records/index route currently uses findAll to load all records of a given type. For adapters and backends that have non-trivial amounts of data, it is not practical to load all records on a single page.

Instead of using findAll, an alternate implementation could use query (with an empty query by default) and use the metadata attributes offset and total to provide a paginated view of records.

Perhaps this approach has already been considered but I couldn't find anything searching issues.

Error in PropertyPrint component

Hi,

I have simple User model without relations and I set up everything as is at GitHub's README page.

I get this error, when I go to /admin/user route.
Response from REST server is ok.

Error:
Uncaught TypeError: undefined is not a function.

Error occurs in node_modules/ember-admin/addon/components/property-print.js at this line:

Ember['default'].Handlebars.helpers['bind'].call(context, path, options);

Versions: Ember CLI 0.2.3, Ember 1.11.1, Ember Data 1.0.0-beta.16.1.

Set recordType deprecation

In ember-admin#0.1.0 and ember#1.13.11 throws deprecation:

DEPRECATION: You attempted to access `recordType` from `(generated model-records controller)`, but object proxying is deprecated. Please use `model.recordType` instead.

Anybody have this to?

Assumptions behind expectation of '/admin' routes

I am trying to figure out if we may want to add this to our app and it struck me as odd when I saw the expectation that your api has /admin routes.

This seems to imply a lot about the API you are interacting with, specifically that it should have multiple routes which interact with a single resource (ie a /model resource and a /admin/model resource which perform crud on the same underlying resource). I have always heard people refer to this as an anti pattern and unRESTful.

So is there some advantage to structuring things this way which I am missing?

Serving the admin assets separately

Hey,

Is it possible to serve the ember-admin assets separately from the main app - so that regular users don't need to download all the admin specific code?

I'm looking at ways to add admin to my own ember-cli app, I need to share the models between both my app and the admin app, but not sure what the best way is to do it.

Ability to use different include/excludeColumns between forms and index

The ability to limit which columns display in the index is great, but they also then disappear from the form. In many cases (like a Wordpress style CMS) you don't want to display the entire contents of the record, as the article content would be prohibitively long to print into a row, but I would want it to display on the live site and in the new/edit form.

Maybe something along the lines of:

includedColumns: {
  'person': {
    'form': ['name', 'age'],
    'index': ['dateCreated', 'name', 'age']
  }
},

Use engines

Since ember-engines is now a thing, it might be worthwhile to start implementing this as engines, with sub-engines (is that a thing?) for plugins.

App = Ember.Application.extend({
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver,

  engines: {
    emberAdmin: {
      dependencies: {
        services: [
          'store',
          'session'
        ]
      },
      engines: {
        'admin-search': 'custom-ea-advanced-search'
      }
    }
  }
});

Improved relationships interface

It would be great to have a simple interface for managing relationships. Mostly I'd like to be able to associate existing models with hasMany/belongsTo relationships.

I think it could be as simple as a select menu for belongsTo, and a multi-select for hasMany (keeping to standard HTML inputs seems the most appropriate for this project).

Uncaught Error: Could not find module `ember-admin/router`

Followed the following steps but encountered an error. It looks like the router.js is missing.

Install

npm install ember-admin --save-dev

Usage

Add the admin routes to your router.js

import adminRouter from 'ember-admin/router';

Router.map(function() {
  adminRouter(this);
});

Changing default API endpoints

For our API we already have a system in place on the backend that checks if a user is an admin or not and based on that gives the right responses/restricts access.
So is it possible to override the defaults that ember-admin is not accessing /api/admin/model, but just /api/model?
I did find a way how to change it in the addon itself, by simply removing namespaces.push('admin'); in stores/admin.js but is there some way to override it in the app itself?

Btw, this looks like a great addon, thanks for publishing it.

ember-admin attempts to use the undefined value Handlebars.helpers['bind']

I'm not an expert at this (not sure precisely what detail would be best to include) but here's the circumstance:

I followed the Install and Usage instructions specified in the README. I set up admin routes for my Rails backend, and loaded http://localhost:4200/#/admin/ (looks fine, no issues detectable).

Next I click on one of my model names underneath the header, and navigate to, e.g. http://localhost:4200/#/admin/user . The HTTP request goes through find, some User models are fetched from the backend, but when it's time to render them I see the following error:

Uncaught TypeError: Cannot read property 'call' of undefined

In the debugger:

define('ember-admin/components/property-print', ['exports', 'ember'], function (exports, Ember) {

  'use strict';

  var get = Ember['default'].get;

  exports['default'] = Ember['default'].Component.extend({
    defaultLayout: function(context, options){
      var path = 'record.' + get(context, 'column');

      options.hash = {};
      Ember['default'].Handlebars.helpers['bind'].call(context, path, options);
    }
  });

});

Ember['default'].Handlebars.helpers['bind'] is undefined.

(If it saves anyone any work, I tried changing the offending line in property-print.js to:

    Ember.Handlebars.helpers.bindAttr.helperFunction.call(context, path, options);

but that didn't work either)

I'm using ember-cli 0.2.5 and ember 1.12.0.

Using the property name instead of type when creating new items

Hello,

Maybe I am using it the wrong way but it seems that the new.js controller uses the property name instead of its type when trying to create a new object in a relation.
Here is on of my models user:

export default DS.Model.extend({
  firstname:DS.attr('string'),
  lastname:DS.attr('string'),
  email:DS.attr('string'),
  possibleBookings:DS.attr('number'),
  courses:DS.hasMany('course', {inverse: 'users'}),
  bookings:DS.hasMany('booking', {inverse: 'user_id'}),
});

And here is the model course :

export default DS.Model.extend({
    type:DS.attr('string'),
    slotCount:DS.attr('number'),
    date:DS.attr('date-moment'),
    duration:DS.attr('number'),
    users:DS.hasMany('user'),
    occurrences:DS.hasMany('occurrence'),

    usedSlotCount:function() {
        return this.get('users').length;
    }.property('users'),
});

The users are correctly displayed with their related objects (courses and bookings).
But if I click the 'create' link on the 'Course' section in order to add a new course linked to this object I have the following error :
Error while processing route: model-records.new No model was found for 'users' Error: No model was found for 'users'

It uses the property name users instead of the property type user in the find method of mixins/controllers/new.js

Not that the issue happens with every other models when the property name is different from the property type.

Am I using it incorrectly ?

Thanks

Demo/Visual

A demo on gh-pages or something is so necessary for something like this. Maybe even just a screenshot or a video for now.

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.