From a58fa07f88700e842e7329184f6bf5e55eedc8d0 Mon Sep 17 00:00:00 2001
From: Martin Donnelly
Date: Thu, 7 Apr 2016 16:45:00 +0100
Subject: [PATCH] =?UTF-8?q?=E2=80=9D2016-04-07=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.jscsrc | 5 +--
.jshintrc | 16 +++++----
app/authorizers/application.js | 9 -----
app/controllers/company.js | 4 +--
app/controllers/newcompany.js | 3 +-
app/controllers/profile.js | 3 +-
app/helpers/eq.js | 4 ---
app/models/account.js | 2 --
app/models/application.js | 2 +-
app/models/page-content.js | 1 +
app/models/page.js | 1 +
app/router.js | 2 +-
app/serializers/useful.js | 61 +++++++++++++++++-----------------
app/styles/app.scss | 6 ++--
app/styles/profile.scss | 2 +-
app/styles/side-bar.scss | 7 ++--
app/templates/application.hbs | 7 ++--
app/templates/login.hbs | 22 +++---------
18 files changed, 68 insertions(+), 89 deletions(-)
diff --git a/.jscsrc b/.jscsrc
index acd4f65..798be96 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -39,8 +39,9 @@
"beforeOpeningCurlyBrace": true
},
"requireTrailingComma": false,
- "requireEarlyReturn": true,
+ "requireEarlyReturn": false,
"validateIndentation": 2,
"validateLineBreaks": "LF",
- "validateQuoteMarks": "'"
+ "validateQuoteMarks": "'",
+
}
diff --git a/.jshintrc b/.jshintrc
index 2f30d16..d58499a 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,10 +1,14 @@
{
- "predef": [
- "server",
- "document",
- "window",
- "-Promise"
- ],
+ "predef": {
+ "document": true,
+ "window": true,
+ "SprintStatusENV": true,
+ "Ember": true, // Added
+ "$": true, // ADDED
+ "Modernizr": true, // ADDED
+ "-Promise": true, // ADDED
+ "server": true // ADDED
+ },
"browser": true,
"boss": true,
"curly": true,
diff --git a/app/authorizers/application.js b/app/authorizers/application.js
index 3793c4f..dfa594b 100644
--- a/app/authorizers/application.js
+++ b/app/authorizers/application.js
@@ -1,12 +1,3 @@
-/*
-import Base from 'ember-simple-auth/authorizers/base';
-
-export default Base.extend({
- authorize(/!*data, block*!/) {
- }
-});
-*/
-
import OAuth2Bearer from 'ember-simple-auth/authorizers/oauth2-bearer';
diff --git a/app/controllers/company.js b/app/controllers/company.js
index 391a9e0..c1b3679 100644
--- a/app/controllers/company.js
+++ b/app/controllers/company.js
@@ -1,5 +1,3 @@
-'use strict';
-
import Ember from 'ember';
const {service} = Ember.inject;
export default Ember.Controller.extend({
@@ -10,6 +8,7 @@ export default Ember.Controller.extend({
editCompany: function() {
this.set('isEditing', true);
}, saveCompany: function() {
+ 'use strict';
this.set('isEditing', false);
var model = this.get('model');
@@ -19,6 +18,7 @@ export default Ember.Controller.extend({
});
}, cancelEdit: function() {
+ 'use strict';
var model = this.get('model');
model.rollbackAttributes();
this.set('isEditing', false);
diff --git a/app/controllers/newcompany.js b/app/controllers/newcompany.js
index f0e0352..62070a1 100644
--- a/app/controllers/newcompany.js
+++ b/app/controllers/newcompany.js
@@ -1,4 +1,3 @@
-'use strict';
import Ember from 'ember';
const { service } = Ember.inject;
export default Ember.Controller.extend({
@@ -6,7 +5,7 @@ export default Ember.Controller.extend({
sessionAccount: service('session-account'),
actions: {
saveCompany: function() {
-
+ 'use strict';
var model = this.get('model');
var account = this.get('sessionAccount.account');
diff --git a/app/controllers/profile.js b/app/controllers/profile.js
index 642a86e..8384339 100644
--- a/app/controllers/profile.js
+++ b/app/controllers/profile.js
@@ -1,4 +1,3 @@
-'use strict';
import Ember from 'ember';
const { service } = Ember.inject;
export default Ember.Controller.extend({
@@ -9,7 +8,7 @@ export default Ember.Controller.extend({
editProfile: function() {
this.set('isEditing', true);
}, saveProfile: function() {
-
+ 'use strict';
var model = this.get('model');
this.set('sessionAccount.account.forename', model.get('forename'));
diff --git a/app/helpers/eq.js b/app/helpers/eq.js
index e9c23d2..ed4b51f 100644
--- a/app/helpers/eq.js
+++ b/app/helpers/eq.js
@@ -1,9 +1,5 @@
import Ember from 'ember';
-/*export function eq(params/!*, hash*!/) {
- return params;
-}*/
-
const eq = (params) => params[0] === params[1];
export default Ember.Helper.helper(eq);
diff --git a/app/models/account.js b/app/models/account.js
index 69a740f..46a91f9 100644
--- a/app/models/account.js
+++ b/app/models/account.js
@@ -1,7 +1,5 @@
import DS from 'ember-data';
-//const { attr } = DS;
-
export default DS.Model.extend({
uid: DS.attr('string'),
login: DS.attr('string'),
diff --git a/app/models/application.js b/app/models/application.js
index af2db9b..ca6bd1b 100644
--- a/app/models/application.js
+++ b/app/models/application.js
@@ -1,5 +1,5 @@
import DS from 'ember-data';
export default DS.Model.extend({
-
+
});
diff --git a/app/models/page-content.js b/app/models/page-content.js
index 934f832..f31e035 100644
--- a/app/models/page-content.js
+++ b/app/models/page-content.js
@@ -1,6 +1,7 @@
'use strict';
import DS from 'ember-data';
+import Ember from 'ember';
export default DS.Model.extend({
page: DS.belongsTo('page'),
diff --git a/app/models/page.js b/app/models/page.js
index ddbe61d..300ea36 100644
--- a/app/models/page.js
+++ b/app/models/page.js
@@ -1,4 +1,5 @@
import DS from 'ember-data';
+import Ember from 'ember';
export default DS.Model.extend({
cid: DS.attr('string'),
diff --git a/app/router.js b/app/router.js
index 986eb2f..1870ad8 100644
--- a/app/router.js
+++ b/app/router.js
@@ -6,7 +6,7 @@ const Router = Ember.Router.extend({
});
Router.map(function() {
- this.route('index', {path:'/'});
+ this.route('index', {path: '/'});
this.route('login');
this.route('auth-error');
this.route('about');
diff --git a/app/serializers/useful.js b/app/serializers/useful.js
index 2775417..29faab3 100644
--- a/app/serializers/useful.js
+++ b/app/serializers/useful.js
@@ -1,37 +1,38 @@
import DS from 'ember-data';
+import Ember from 'ember';
export default DS.JSONAPISerializer.extend({
- serializeBelongsTo: function(record, json, relationship) {
- var key = relationship.key,
- belongsTo = Ember.get(record, key);
- key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo") : key;
+ serializeBelongsTo: function(record, json, relationship) {
+ var key = relationship.key;
+ var belongsTo = Ember.get(record, key);
+ key = this.keyForRelationship ? this.keyForRelationship(key, 'belongsTo') : key;
- if (relationship.options.embedded === 'always') {
- json[key] = belongsTo.serialize();
- }
- else {
- return this._super(record, json, relationship);
- }
- },
- serializeHasMany: function(record, json, relationship) {
- var key = relationship.key,
- hasMany = Ember.get(record, key),
- relationshipType = DS.RelationshipChange.determineRelationshipType(record.constructor, relationship);
-
- if (relationship.options.embedded === 'always') {
- if (hasMany && relationshipType === 'manyToNone' || relationshipType === 'manyToMany' ||
- relationshipType === 'manyToOne') {
-
- json[key] = [];
- hasMany.forEach(function(item, index){
- json[key].push(item.serialize());
- });
- }
-
- }
- else {
- return this._super(record, json, relationship);
- }
+ if (relationship.options.embedded === 'always') {
+ json[key] = belongsTo.serialize();
+ } else {
+ return this._super(record, json, relationship);
}
+ },
+ serializeHasMany: function(record, json, relationship) {
+ var key = relationship.key;
+ var hasMany = Ember.get(record, key);
+ var relationshipType = DS.RelationshipChange.determineRelationshipType(
+ record.constructor,
+ relationship);
+
+ if (relationship.options.embedded === 'always') {
+ if (hasMany && relationshipType === 'manyToNone' || relationshipType === 'manyToMany' ||
+ relationshipType === 'manyToOne') {
+
+ json[key] = [];
+ hasMany.forEach(function(item) {
+ json[key].push(item.serialize());
+ });
+ }
+
+ } else {
+ return this._super(record, json, relationship);
+ }
+ }
});
diff --git a/app/styles/app.scss b/app/styles/app.scss
index 15b01e3..5971f80 100644
--- a/app/styles/app.scss
+++ b/app/styles/app.scss
@@ -47,9 +47,9 @@ body {
width: 375px;
height: 667px;
border:1px solid grey;
- -webkit-box-shadow: 0px 4px 5px 0px rgba(0,0,0,0.43);
- -moz-box-shadow: 0px 4px 5px 0px rgba(0,0,0,0.43);
- box-shadow: 0px 4px 5px 0px rgba(0,0,0,0.43);
+ -webkit-box-shadow: 0 4px 5px 0 rgba(0,0,0,0.43);
+ -moz-box-shadow: 0 4px 5px 0 rgba(0,0,0,0.43);
+ box-shadow: 0 4px 5px 0 rgba(0,0,0,0.43);
border-radius: 0.25rem;
}
diff --git a/app/styles/profile.scss b/app/styles/profile.scss
index dd31233..3ca4e6a 100644
--- a/app/styles/profile.scss
+++ b/app/styles/profile.scss
@@ -8,7 +8,7 @@ img.avatar {
}
.only-bottom-margin {
- margin-top: 0px;
+ margin-top: 0;
}
.activity-mini {
diff --git a/app/styles/side-bar.scss b/app/styles/side-bar.scss
index 403f96f..968914d 100644
--- a/app/styles/side-bar.scss
+++ b/app/styles/side-bar.scss
@@ -117,9 +117,8 @@ h1.page-header {
padding: 0;
}
.side-menu #search .panel-body .navbar-form {
- padding: 0;
- padding-right: 50px;
- width: 100%;
+ padding: 0 50px 0 0;
+ width: 100%;
margin: 0;
position: relative;
border-top: 1px solid #e7e7e7;
@@ -162,7 +161,7 @@ h1.page-header {
position: relative;
height: 0;
min-height: 0;
- background-color:none !important;
+ background-color: none !important;
border-color: none !important;
}
.side-menu .brand-name-wrapper .navbar-brand {
diff --git a/app/templates/application.hbs b/app/templates/application.hbs
index 853a86e..73bf89a 100644
--- a/app/templates/application.hbs
+++ b/app/templates/application.hbs
@@ -5,10 +5,11 @@
{{outlet}}
diff --git a/app/templates/login.hbs b/app/templates/login.hbs
index ebfe630..f14fc53 100644
--- a/app/templates/login.hbs
+++ b/app/templates/login.hbs
@@ -1,3 +1,6 @@
+
+
\ No newline at end of file