admin-config
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -63,5 +63,2 @@ import stringUtils from "../Utils/stringUtils"; | ||
/** | ||
* @deprecated Use .views["MenuView"] instead | ||
*/ | ||
menuView() { | ||
@@ -71,5 +68,2 @@ return this._views["MenuView"]; | ||
/** | ||
* @deprecated Use .views["DashboardView"] instead | ||
*/ | ||
dashboardView() { | ||
@@ -79,5 +73,2 @@ return this._views["DashboardView"]; | ||
/** | ||
* @deprecated Use .views["ListView"] instead | ||
*/ | ||
listView() { | ||
@@ -87,5 +78,2 @@ return this._views["ListView"]; | ||
/** | ||
* @deprecated Use .views["CreateView"] instead | ||
*/ | ||
creationView() { | ||
@@ -95,5 +83,2 @@ return this._views["CreateView"]; | ||
/** | ||
* @deprecated Use .views["EditView"] instead | ||
*/ | ||
editionView() { | ||
@@ -103,5 +88,2 @@ return this._views["EditView"]; | ||
/** | ||
* @deprecated Use .views["DeleteView"] instead | ||
*/ | ||
deletionView() { | ||
@@ -111,5 +93,2 @@ return this._views["DeleteView"]; | ||
/** | ||
* @deprecated Use .views["BatchDeleteView"] instead | ||
*/ | ||
batchDeleteView() { | ||
@@ -119,5 +98,2 @@ return this._views["BatchDeleteView"]; | ||
/** | ||
* @deprecated Use .views["ExportView"] instead | ||
*/ | ||
exportView() { | ||
@@ -127,5 +103,2 @@ return this._views["ExportView"]; | ||
/** | ||
* @deprecated Use .views["ShowView"] instead | ||
*/ | ||
showView() { | ||
@@ -157,2 +130,5 @@ return this._views["ShowView"]; | ||
if (!arguments.length) return this._identifierField; | ||
if (!(value instanceof Field)) { | ||
throw new Error('Entity ' + this.name() + ': identifier must be an instance of Field.'); | ||
} | ||
this._identifierField = value; | ||
@@ -159,0 +135,0 @@ return this; |
{ | ||
"name": "admin-config", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"private": false, | ||
@@ -13,5 +13,5 @@ "repository": { | ||
"devDependencies": { | ||
"babel": "^5.5.3", | ||
"chai": "^2.3.0", | ||
"mocha": "^2.2.5", | ||
"mocha-traceur": "^2.1.0", | ||
"sinon": "^1.14.1" | ||
@@ -18,0 +18,0 @@ }, |
var assert = require('chai').assert; | ||
import Entity from "../../../lib/Entity/Entity"; | ||
import Entity from '../../../lib/Entity/Entity'; | ||
import Field from '../../../lib/Field/Field'; | ||
@@ -25,3 +26,3 @@ describe('Entity', function() { | ||
it('should return given label if already set', function() { | ||
var post = new Entity('post').label("Article"); | ||
var post = new Entity('post').label('Article'); | ||
assert.equal('Article', post.label()); | ||
@@ -64,7 +65,7 @@ }); | ||
}); | ||
}) | ||
}); | ||
describe('createMethod', function() { | ||
it('should return given createMethod if already set', function() { | ||
var post = new Entity('post').createMethod("put"); | ||
var post = new Entity('post').createMethod('put'); | ||
assert.equal('put', post.createMethod()); | ||
@@ -81,3 +82,3 @@ }); | ||
it('should return given updateMethod if already set', function() { | ||
var post = new Entity('post').updateMethod("post"); | ||
var post = new Entity('post').updateMethod('post'); | ||
assert.equal('post', post.updateMethod()); | ||
@@ -91,2 +92,18 @@ }); | ||
}); | ||
describe('identifier', function() { | ||
it('should set default identifier', function() { | ||
var post = new Entity('post'); | ||
assert.equal('id', post.identifier().name()); | ||
}); | ||
it('should set custom identifier', function() { | ||
var post = new Entity('post').identifier(new Field('my_id')); | ||
assert.equal('my_id', post.identifier().name()); | ||
}); | ||
it('should throw error on wrong argument', function() { | ||
assert.throw(function () { new Entity('post').identifier('my_id'); }, Error, 'Entity post: identifier must be an instance of Field'); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
119062
0
3160