Skip to content

Commit

Permalink
Merge branch 'release/1.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenPioneer committed Sep 4, 2018
2 parents 627a5b4 + 8d91ef6 commit 4735aec
Show file tree
Hide file tree
Showing 42 changed files with 10,435 additions and 2,042 deletions.
50 changes: 0 additions & 50 deletions .snyk

This file was deleted.

6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
language: node_js
node_js:
- 6
- 7
- 8
- 9
- 10
os:
- linux
- centos
- macosx
- windows
env:
- NODE_ENV=nightwatch
before_script:
Expand Down
30 changes: 15 additions & 15 deletions client/modules/blog/blog.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
BlogFactory.update({
id: $stateParams.id
}, vm.blog,
function (success) {
$location.url('/blog/view/' + $stateParams.id)
},
function (error) {
logger.error(error.data.message, error, 'Blog')
})
function (success) {
$location.url('/blog/view/' + $stateParams.id)
},
function (error) {
logger.error(error.data.message, error, 'Blog')
})
}
vm.delete = function (blogId) {
// Disable confirm for testing purposes
Expand All @@ -68,16 +68,16 @@
BlogFactory.remove({
id: blogId
},
function (success) {
for (var i in vm.blogs) {
if (vm.blogs[i]._id === blogId) {
vm.blogs.splice(i, 1)
}
function (success) {
for (var i in vm.blogs) {
if (vm.blogs[i]._id === blogId) {
vm.blogs.splice(i, 1)
}
},
function (error) {
logger.error(error.data.message, error, 'Blog')
})
}
},
function (error) {
logger.error(error.data.message, error, 'Blog')
})
}
}
function activate () {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/blog/blog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('BLOG Testing', function () {
$httpBackend.when('GET', /modules\/\w+\/(\d|\w)+\.view\.html\?noCache=\d+/)
.respond(200, '')
var $scope = $rootScope.$new()
BlogController = $controller('BlogController', {$scope: $scope})
BlogController = $controller('BlogController', { $scope: $scope })
}))

it('should exist', function () {
Expand Down
65 changes: 32 additions & 33 deletions client/modules/core/core.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
'use strict'

angular
.module('app.core')
.service('browserInfo', browserInfo)
.module('app.core')
.service('browserInfo', browserInfo)

browserInfo.$inject = ['$window', '$document']

function browserInfo ($window, $document) {
if (!$window.navigator) {
$window.navigator = {userAgent: '', appVersion: ''}
$window.navigator = { userAgent: '', appVersion: '' }
}

this.giveMeAllYouGot = function () {
Expand Down Expand Up @@ -153,39 +153,39 @@
}

var osList = [
{name: 'Windows 95', regex: /(Windows 95|Win95|Windows_95)/},
{name: 'Windows ME', regex: /(Win 9x 4.90|Windows ME)/},
{name: 'Windows 98', regex: /(Windows 98|Win98)/},
{name: 'Windows 2000', regex: /(Windows NT 5.0|Windows 2000)/},
{name: 'Windows XP', regex: /(Windows NT 5.1|Windows XP)/},
{name: 'Windows Server 2003', regex: /Windows NT 5.2/},
{name: 'Windows Vista', regex: /Windows NT 6.0/},
{name: 'Windows 7', regex: /(Windows 7|Windows NT 6.1)/},
{name: 'Windows 8.1', regex: /(Windows 8.1|Windows NT 6.3)/},
{name: 'Windows 8', regex: /(Windows 8|Windows NT 6.2)/},
{name: 'Windows NT 4.0', regex: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},
{name: 'Windows ME', regex: /Windows ME/},
{name: 'Android', regex: /Android/},
{name: 'Open BSD', regex: /OpenBSD/},
{name: 'Free BSD', regex: /FreeBSD/},
{name: 'Sun OS', regex: /SunOS/},
{name: 'Ubuntu', regex: /Ubuntu/},
{name: 'Linux', regex: /(Linux|X11)/},
{name: 'iOS', regex: /(iPhone|iPad|iPod)/},
{name: 'Mac OS X', regex: /Mac OS X/},
{name: 'Mac OS', regex: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},
{name: 'QNX', regex: /QNX/},
{name: 'UNIX', regex: /UNIX/},
{name: 'BeOS', regex: /BeOS/},
{name: 'OS/2', regex: /OS\/2/},
{name: 'Search Bot', regex: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}
{ name: 'Windows 95', regex: /(Windows 95|Win95|Windows_95)/ },
{ name: 'Windows ME', regex: /(Win 9x 4.90|Windows ME)/ },
{ name: 'Windows 98', regex: /(Windows 98|Win98)/ },
{ name: 'Windows 2000', regex: /(Windows NT 5.0|Windows 2000)/ },
{ name: 'Windows XP', regex: /(Windows NT 5.1|Windows XP)/ },
{ name: 'Windows Server 2003', regex: /Windows NT 5.2/ },
{ name: 'Windows Vista', regex: /Windows NT 6.0/ },
{ name: 'Windows 7', regex: /(Windows 7|Windows NT 6.1)/ },
{ name: 'Windows 8.1', regex: /(Windows 8.1|Windows NT 6.3)/ },
{ name: 'Windows 8', regex: /(Windows 8|Windows NT 6.2)/ },
{ name: 'Windows NT 4.0', regex: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
{ name: 'Windows ME', regex: /Windows ME/ },
{ name: 'Android', regex: /Android/ },
{ name: 'Open BSD', regex: /OpenBSD/ },
{ name: 'Free BSD', regex: /FreeBSD/ },
{ name: 'Sun OS', regex: /SunOS/ },
{ name: 'Ubuntu', regex: /Ubuntu/ },
{ name: 'Linux', regex: /(Linux|X11)/ },
{ name: 'iOS', regex: /(iPhone|iPad|iPod)/ },
{ name: 'Mac OS X', regex: /Mac OS X/ },
{ name: 'Mac OS', regex: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
{ name: 'QNX', regex: /QNX/ },
{ name: 'UNIX', regex: /UNIX/ },
{ name: 'BeOS', regex: /BeOS/ },
{ name: 'OS/2', regex: /OS\/2/ },
{ name: 'Search Bot', regex: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
]

var getOperaInfo = function () {
return {
name: 'Opera',
version: $window.navigator.userAgent.indexOf('Version') !== -1 ? getBrowserVersion('Version', 8)
: getBrowserVersion('Opera', 6)
: getBrowserVersion('Opera', 6)
}
}

Expand All @@ -207,7 +207,7 @@
return {
name: 'Safari',
version: $window.navigator.userAgent.indexOf('Version') !== -1 ? getBrowserVersion('Version', 8)
: getBrowserVersion('Safari', 7)
: getBrowserVersion('Safari', 7)
}
}

Expand All @@ -225,7 +225,7 @@
}
}

// TODO maybe there's a way
// TODO maybe there's a way
var getUnknownBrowserInfo = function () {
return {
name: undefined,
Expand Down Expand Up @@ -253,4 +253,3 @@
}
}
}())

2 changes: 1 addition & 1 deletion client/modules/core/core.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('CORE Testing', function () {
it('should exist', function () {
inject(function ($rootScope, $controller) {
var $scope = $rootScope.$new()
var CoreController = $controller('CoreController', {$scope: $scope})
var CoreController = $controller('CoreController', { $scope: $scope })
expect(CoreController).to.exist
})
})
Expand Down
4 changes: 2 additions & 2 deletions client/modules/core/util.provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
}

this.$get = function () {
return {config: this.config}
return { config: this.config }
}
}

Expand All @@ -132,7 +132,7 @@
function extendExceptionHandler ($delegate, exceptionHandler, logger) {
return function (exception, cause) {
$delegate(exception, cause)
logger.error(exception.message || exception, {exception: exception, cause: cause})
logger.error(exception.message || exception, { exception: exception, cause: cause })
}
}
})()
2 changes: 1 addition & 1 deletion client/modules/footer/footer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('FOOTER Testing', function () {
beforeEach(module('app.footer'))
beforeEach(inject(function ($controller, $rootScope) {
var $scope = $rootScope.$new()
FooterController = $controller('FooterController', {$scope: $scope})
FooterController = $controller('FooterController', { $scope: $scope })
}))

it('should exist', function () {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/header/header.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('HEADER Testing', function () {
// Authenticate in UserFactory class constructor
$httpBackend.flush()
var $scope = $rootScope.$new()
HeaderController = $controller('HeaderController', {$scope: $scope})
HeaderController = $controller('HeaderController', { $scope: $scope })
}))

it('should exist', function () {
Expand Down
2 changes: 1 addition & 1 deletion client/modules/user/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
vm.upload = function (file) {
Upload.upload({
url: '/api/photos/upload',
data: {file: file, 'user': UserFactory}
data: { file: file, 'user': UserFactory }
}).then(function (resp) {
console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data)
}, function (resp) {
Expand Down
12 changes: 6 additions & 6 deletions client/modules/user/user.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
$timeout(deferred.resolve(success.data))
} else {
$timeout(deferred.reject({message: 'No Response'}))
$timeout(deferred.reject({ message: 'No Response' }))
}
}, function (error) {
$timeout(deferred.reject(error))
Expand Down Expand Up @@ -81,7 +81,7 @@
})
}
UserClass.prototype.onIdentity = function (data) {
if (!data) return ({error: true})
if (!data) return ({ error: true })

self.user = data.user
self.token = data.token
Expand Down Expand Up @@ -142,7 +142,7 @@
logger.error(response.data.message)
vm.tokenCheck = true
}
)
)
}
UserClass.prototype.resetpassword = function (vm) {
$http.post('/api/user/reset/' + vm.resetToken, {
Expand Down Expand Up @@ -184,8 +184,8 @@
UserClass.prototype.checkLoggedin = function () {
getAuthenticate().then(function (data) {
if (data.authenticated === false) {
$state.go('signin', {'redirect': $location.path()})
logger.error('please sign in', {user: 'No User'}, 'Unauthenticated')
$state.go('signin', { 'redirect': $location.path() })
logger.error('please sign in', { user: 'No User' }, 'Unauthenticated')
}
})
}
Expand All @@ -205,7 +205,7 @@
if (data.user.roles && _.isArray(data.user.roles))roles = data.user.roles.indexOf('admin') === -1
if (data.authenticated !== true || roles) {
$state.go('index')
logger.error('requires access', {user: 'No User'}, 'Unauthorized')
logger.error('requires access', { user: 'No User' }, 'Unauthorized')
}
})
}
Expand Down
8 changes: 4 additions & 4 deletions client/modules/user/user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('USER Testing', function () {
$httpBackend.when('GET', /\/api\/user\/authenticate\?noCache=\d+/)
.respond(200, authResponse)
$httpBackend.when('GET', /\/api\/seo\/*/)
.respond(200, {})
.respond(200, {})
$httpBackend.when('GET', /modules\/[\d\w]+\/[\d\w]+\.view\.html\?noCache=\d+/)
.respond(200, '')
$httpBackend.when('GET', /modules\/index\/[\d\w]+\.view\.html\?noCache=\d+/)
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('USER Testing', function () {

beforeEach(inject(function ($rootScope, $controller) {
var $scope = $rootScope.$new()
UserController = $controller('UserController', {$scope: $scope})
UserController = $controller('UserController', { $scope: $scope })
}))

it('should exist', function () {
Expand Down Expand Up @@ -182,7 +182,7 @@ describe('USER Testing', function () {
$httpBackend.flush()
expect(UserFactory.user).to.be.empty

var payload = {email: 'testuser@test.com'}
var payload = { email: 'testuser@test.com' }

$httpBackend.when('POST', '/api/user/forgot')
.respond(200, authResponse)
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('USER Testing', function () {
})

it('vm.update() should update user correctly', function () {
UserController.editProfile = {profile: {}}
UserController.editProfile = { profile: {} }

// Simulate setting form input fields
UserController.editProfile.email = 'test@user.com'
Expand Down
Loading

0 comments on commit 4735aec

Please sign in to comment.