dockyard / ember-admin Goto Github PK
View Code? Open in Web Editor NEWAdmin backend for ember-cli projects
License: MIT License
Admin backend for ember-cli projects
License: MIT License
I had problems with: https://github.com/dockyard/ember-admin/blob/master/addon/components/property-print.js#L10 blowing up.
When I had my CLI project pointed at canary and HTMLbars turned on. I know it's early, but I just wanted to bump this up
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
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 ?
@bcardarella would you accept a PR that adds column sorting functionality?
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.
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']
}
},
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'
}
}
}
});
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.
Ember 2.6.0
Ember-admin 0.2.1
After adding the below code to the router.js I get an console errror (noted in title):
Router.map(function() {
adminRouter(this);
});
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.
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.
A demo on gh-pages or something is so necessary for something like this. Maybe even just a screenshot or a video for now.
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).
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:
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.
Would love to use this, but not using Ember-CLI for this project.
Looks like the files in addon
are the relevant items.
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?
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
Using ember-django-adapter, namespace
is a computed property making `adapter.namespace.split('/') fail.
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.
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?
Followed the following steps but encountered an error. It looks like the router.js is missing.
npm install ember-admin --save-dev
Add the admin routes to your router.js
import adminRouter from 'ember-admin/router';
Router.map(function() {
adminRouter(this);
});
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.