",
"contributors": "https://github.com/linnovate/mean/graphs/contributors",
- "mean": "0.5.0",
+ "mean": "0.5.5",
"repository": {
"type": "git",
"url": "https://github.com/linnovate/mean.git"
},
+ "license": "MIT",
"scripts": {
"start": "node server",
- "mocha": "node node_modules/.bin/mocha packages/**/server/tests/**/*.js -R spec -r tools/test/mocha-req.js",
+ "mocha": "node tools/test/run-mocha.js",
"karma": "node node_modules/karma/bin/karma start karma.conf.js",
- "test": "npm run mocha && NODE_ENV=test npm run start & sleep 20 && npm run karma",
+ "test": "gulp test",
+ "test-e2e": "gulp e2e.test",
"postinstall": "node tools/scripts/postinstall.js"
},
"dependencies": {
@@ -46,7 +48,7 @@
"passport-linkedin": "latest",
"passport-local": "latest",
"passport-twitter": "latest",
- "q": "^1.4.0",
+ "q": "latest",
"request": "latest",
"serve-favicon": "latest",
"shelljs": "latest",
@@ -58,6 +60,7 @@
"del": "latest",
"expect.js": "latest",
"gulp": "latest",
+ "gulp-coffee": "latest",
"gulp-concat": "latest",
"gulp-csslint": "latest",
"gulp-cssmin": "latest",
@@ -69,6 +72,8 @@
"gulp-nodemon": "latest",
"gulp-uglify": "latest",
"gulp-util": "latest",
+ "jasmine": "latest",
+ "jasmine-reporters": "latest",
"jshint-stylish": "latest",
"karma": "latest",
"karma-chrome-launcher": "latest",
@@ -77,13 +82,14 @@
"karma-firefox-launcher": "latest",
"karma-html2js-preprocessor": "latest",
"karma-jasmine": "latest",
+ "karma-junit-reporter": "latest",
"karma-ng-html2js-preprocessor": "latest",
- "karma-ng-scenario": "latest",
"karma-phantomjs-launcher": "latest",
+ "karma-phantomjs-shim": "latest",
"karma-requirejs": "latest",
"karma-script-launcher": "latest",
- "mean-seo": "latest",
"mocha": "latest",
+ "protractor": "latest",
"require-dir": "latest",
"requirejs": "latest",
"supertest": "latest",
diff --git a/packages/core/admin/app.js b/packages/core/admin/app.js
index 18ce527..25133a7 100644
--- a/packages/core/admin/app.js
+++ b/packages/core/admin/app.js
@@ -13,12 +13,43 @@ var Admin = new Module('admin');
Admin.register(function(app, auth, database) {
- Admin.menus.add({
- title: 'admin settings',
- link: 'admin settings',
- roles: ['admin'],
- menu: 'main'
- });
+ var icons = 'admin/assets/img/icons/';
+
+ Admin.menus.add({
+ title: 'admin settings',
+ link: 'admin settings',
+ roles: ['admin'],
+ menu: 'main'
+ });
+
+ Admin.menus.add({
+ roles: ['admin'],
+ title: 'MODULES',
+ link: 'modules',
+ icon: icons + 'modules.png',
+ menu: 'admin'
+ });
+ Admin.menus.add({
+ roles: ['admin'],
+ title: 'THEMES',
+ link: 'themes',
+ icon: icons + 'themes.png',
+ menu: 'admin'
+ });
+ Admin.menus.add({
+ roles: ['admin'],
+ title: 'SETTINGS',
+ link: 'settings',
+ icon: icons + 'settings.png',
+ menu: 'admin'
+ });
+ Admin.menus.add({
+ roles: ['admin'],
+ title: 'USERS',
+ link: 'users',
+ icon: icons + 'users.png',
+ menu: 'admin'
+ });
Admin.aggregateAsset('css', 'admin.css');
Admin.aggregateAsset('js', '../lib/ng-clip/src/ngClip.js', {
diff --git a/packages/core/admin/public/assets/css/admin.css b/packages/core/admin/public/assets/css/admin.css
index 091c17e..de2ba9e 100644
--- a/packages/core/admin/public/assets/css/admin.css
+++ b/packages/core/admin/public/assets/css/admin.css
@@ -129,5 +129,10 @@ span.editable-wrapper input {
font-size: 12px;
}
+.users .actions-bar {
+ clear: both;
+ margin: 20px 0;
+}
+
diff --git a/packages/core/admin/public/controllers/admin.js b/packages/core/admin/public/controllers/admin.js
index d5ac74a..3d5d9b4 100644
--- a/packages/core/admin/public/controllers/admin.js
+++ b/packages/core/admin/public/controllers/admin.js
@@ -6,30 +6,8 @@ angular.module('mean.admin').controller('AdminController', ['$scope', 'Global',
$scope.menus = {};
$scope.overIcon = false;
$scope.user = MeanUser;
- var icons = 'admin/assets/img/icons/';
-
- // Default hard coded menu items for main menu
- var defaultAdminMenu = [{
- 'roles': ['admin'],
- 'title': 'MODULES',
- 'link': 'modules',
- 'icon': icons + 'modules.png'
- }, {
- 'roles': ['admin'],
- 'title': 'THEMES',
- 'link': 'themes',
- 'icon': icons + 'themes.png'
- }, {
- 'roles': ['admin'],
- 'title': 'SETTINGS',
- 'link': 'settings',
- 'icon': icons + 'settings.png'
- }, {
- 'roles': ['admin'],
- 'title': 'USERS',
- 'link': 'users',
- 'icon': icons + 'users.png'
- }];
+
+ var defaultAdminMenu = [];
// Query menus added by modules. Only returns menus that user is allowed to see.
function queryMenu(name, defaultMenu) {
diff --git a/packages/core/admin/public/controllers/themes.js b/packages/core/admin/public/controllers/themes.js
index d999810..2895b9d 100644
--- a/packages/core/admin/public/controllers/themes.js
+++ b/packages/core/admin/public/controllers/themes.js
@@ -8,7 +8,8 @@ angular.module('mean.admin').controller('ThemesController', ['$scope', 'Global',
$scope.init = function() {
$http({
method: 'GET',
- url: 'http://api.bootswatch.com/3/'
+ url: 'http://api.bootswatch.com/3/',
+ skipAuthorization: true
}).
success(function(data, status, headers, config) {
$scope.themes = data.themes;
diff --git a/packages/core/admin/public/controllers/users.js b/packages/core/admin/public/controllers/users.js
index 1c5728b..12e8780 100644
--- a/packages/core/admin/public/controllers/users.js
+++ b/packages/core/admin/public/controllers/users.js
@@ -1,49 +1,60 @@
'use strict';
-angular.module('mean.admin').controller('UsersController', ['$scope', 'Global', 'Menus', '$rootScope', '$http', 'Users',
- function($scope, Global, Menus, $rootScope, $http, Users) {
+angular.module('mean.admin').controller('UsersController', ['$scope', 'Global', 'Menus', '$rootScope', '$http', 'Users', 'Circles',
+ function($scope, Global, Menus, $rootScope, $http, Users, Circles) {
+
$scope.global = Global;
- $scope.userSchema = [{
- title: 'Email',
- schemaKey: 'email',
- type: 'text',
- inTable: true
- }, {
- title: 'Name',
- schemaKey: 'name',
- type: 'text',
- inTable: true
- }, {
- title: 'Username',
- schemaKey: 'username',
- type: 'text',
- inTable: true
- }, {
- title: 'Roles',
- schemaKey: 'roles',
- type: 'select',
- options: ['authenticated', 'admin'],
- inTable: true
- }, {
- title: 'Password',
- schemaKey: 'password',
- type: 'password',
- inTable: false
- }, {
- title: 'Repeat password',
- schemaKey: 'confirmPassword',
- type: 'password',
- inTable: false
- }];
$scope.user = {};
+ Circles.mine(function(acl) {
+
+ var circles = acl.allowed;
+
+ $scope.userSchema = [{
+ title: 'Email',
+ schemaKey: 'email',
+ type: 'email',
+ inTable: true
+ }, {
+ title: 'Name',
+ schemaKey: 'name',
+ type: 'text',
+ inTable: true
+ }, {
+ title: 'Username',
+ schemaKey: 'username',
+ type: 'text',
+ inTable: true
+ }, {
+ title: 'Roles',
+ schemaKey: 'roles',
+ type: 'select',
+ options: circles,
+ inTable: true
+ }, {
+ title: 'Password',
+ schemaKey: 'password',
+ type: 'password',
+ inTable: false
+ }, {
+ title: 'Repeat password',
+ schemaKey: 'confirmPassword',
+ type: 'password',
+ inTable: false
+ }];
+
+ });
+
+
+
$scope.init = function() {
Users.query({}, function(users) {
$scope.users = users;
});
};
- $scope.add = function() {
+ $scope.add = function(valid) {
+ if (!valid) return;
if (!$scope.users) $scope.users = [];
var user = new Users({
@@ -55,11 +66,13 @@ angular.module('mean.admin').controller('UsersController', ['$scope', 'Global',
roles: $scope.user.roles
});
- user.$save(function(response) {
- $scope.users.push(response);
+ user.$save(function(data, headers) {
+ $scope.user = {};
+ $scope.users.push(user);
+ $scope.userError = null;
+ }, function(data, headers) {
+ $scope.userError = data.data;
});
-
- this.firstName = this.lastName = this.email = this.password = this.role = '';
};
$scope.remove = function(user) {
@@ -73,7 +86,7 @@ angular.module('mean.admin').controller('UsersController', ['$scope', 'Global',
};
$scope.update = function(user, userField) {
- if (userField && userField === 'roles' && user.roles.indexOf('admin') === -1) {
+ if (userField && userField === 'roles' && user.tmpRoles.indexOf('admin') !== -1 && user.roles.indexOf('admin') === -1) {
if (confirm('Are you sure you want to remove "admin" role?')) {
user.$update();
} else {
@@ -89,4 +102,4 @@ angular.module('mean.admin').controller('UsersController', ['$scope', 'Global',
}
};
}
-]);
\ No newline at end of file
+]);
diff --git a/packages/core/admin/public/views/settings.html b/packages/core/admin/public/views/settings.html
index 1991002..d165f42 100644
--- a/packages/core/admin/public/views/settings.html
+++ b/packages/core/admin/public/views/settings.html
@@ -13,7 +13,7 @@
- Overridden
+ Overridden
|
{{value.default}}
diff --git a/packages/core/admin/public/views/users.html b/packages/core/admin/public/views/users.html
index 4cdba76..99e8ee7 100644
--- a/packages/core/admin/public/views/users.html
+++ b/packages/core/admin/public/views/users.html
@@ -1,20 +1,42 @@
- |