Skip to content

Commit

Permalink
Merge pull request #44 from frolfr/gschorkopf/moor-deprecations
Browse files Browse the repository at this point in the history
Moor deprecations
  • Loading branch information
gschorkopf authored Aug 18, 2016
2 parents 6a74958 + e454772 commit 1b26a68
Show file tree
Hide file tree
Showing 60 changed files with 82 additions and 404 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ Make use of the many generators for code, try `ember help generate` for more det
* `ember build` (development)
* `ember build --environment production` (production)

### Deploying

You'll need to set up `deploy.json` and put in your app's main directory.

* `ember deploy --environment production`
* `ember deploy:activate --revision frolfr-client:REVISION_SHA --environment production`

## Further Reading / Useful Links

* [ember.js](http://emberjs.com/)
Expand Down
2 changes: 1 addition & 1 deletion app/components/scorecards-table-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var ScorecardsTableCell = Ember.Component.extend({
return this.get('scorecard').get('turns').find(function(turn) {
return turn.get('holeNumber') === holeNumber;
});
}.property('scorecard.turns.@each', 'holeNumber')
}.property('scorecard.turns.[]', 'holeNumber')
});

export default ScorecardsTableCell;
5 changes: 3 additions & 2 deletions app/controllers/course-rounds.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';

// TODO: Change to just Controller
var CourseRoundsController = Ember.ArrayController.extend({
// Pagination
page: 1,
Expand All @@ -16,7 +17,7 @@ var CourseRoundsController = Ember.ArrayController.extend({
var end = this.get('page') * this.get('perPage');

return this.get('filteredContent').slice(start, end);
}.property('filteredContent.@each', 'page', 'perPage'),
}.property('filteredContent.[]', 'page', 'perPage'),

isPaginated: function() {
return this.get('filteredContent').length > this.get('perPage');
Expand Down Expand Up @@ -47,7 +48,7 @@ var CourseRoundsController = Ember.ArrayController.extend({
} else {
return this.get('completedScorecards');
}
}.property('arrangedContent.@each', 'includeIncompleteScorecards', 'completedScorecards.@each'),
}.property('arrangedContent.[]', 'includeIncompleteScorecards', 'completedScorecards.[]'),

completedScorecards: function() {
return this.get('arrangedContent').filter(function(scorecard) {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/courses/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var CoursesIndexController = Ember.ArrayController.extend({
var CoursesIndexController = Ember.Controller.extend({
queryParams: ["page"],

pageBinding: "content.page",
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/courses/new.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var CoursesNewController = Ember.ObjectController.extend({
var CoursesNewController = Ember.Controller.extend({
stateAbbreviations: ["","AK","AL","AR","AZ","CA","CO",
"CT","DC","DE","FL","GA","GU","HI","IA","ID","IL",
"IN","KS","KY","LA","MA","MD","ME","MH","MI","MN",
Expand Down
1 change: 1 addition & 0 deletions app/controllers/current-user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';

// TODO: Update to simply 'Controller' after getting rid of janky auth
var CurrentUserController = Ember.ObjectController.extend({
isAuthenticated: function() {
return this.get('model.isLoaded');
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/friendable-users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var FriendableUsersController = Ember.ArrayController.extend({
var FriendableUsersController = Ember.Controller.extend({
selection: null,
query: null,

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/friends.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import pagedArray from 'ember-cli-pagination/computed/paged-array';

var FriendsController = Ember.ArrayController.extend({
var FriendsController = Ember.Controller.extend({
pagedContent: pagedArray("content", {infinite: true}),

hasNextPage: function() {
Expand Down
7 changes: 4 additions & 3 deletions app/controllers/password/edit.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import Ember from 'ember';

var PasswordEditController = Ember.ObjectController.extend({
var PasswordEditController = Ember.Controller.extend({
needs: "sessions",
showPasswordError: false,

actions: {
changePassword: function() {
var _this = this,
password = this.get('model'),
isValidPassword = this.get('password') === this.get('passwordConfirmation');
isValidPassword = password.get('password') === password.get('passwordConfirmation');

if (isValidPassword) {
password.save().then(function(user) {
var email = user.get('email'),
password = _this.get('password');
password = user.get('password');

_this.get('controllers.sessions').send('loginWithCredentials', email, password);
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/profile/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var ProfileSettingsController = Ember.ObjectController.extend({
var ProfileSettingsController = Ember.Controller.extend({
actions: {
saveChanges: function() {
this.get('model').save();
Expand Down
22 changes: 0 additions & 22 deletions app/controllers/public-round.js

This file was deleted.

22 changes: 0 additions & 22 deletions app/controllers/review/edit.js

This file was deleted.

37 changes: 0 additions & 37 deletions app/controllers/reviews/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions app/controllers/reviews/new.js

This file was deleted.

18 changes: 1 addition & 17 deletions app/controllers/round.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
import Ember from 'ember';

var RoundController = Ember.ObjectController.extend({
publicRoundUrl: function () {
return 'http://frolfr.com/public/rounds/' + this.get('model.id');
}.property(),

actions: {
makePrivate: function() {
this.get('model').set('publicRecap', false);
this.get('model').save();
},

publish: function() {
this.get('model').set('publicRecap', true);
this.get('model').save();
}
}
});
var RoundController = Ember.Controller.extend({});

export default RoundController;
10 changes: 5 additions & 5 deletions app/controllers/round/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import Ember from 'ember';

var RoundIndexController = Ember.ObjectController.extend({
var RoundIndexController = Ember.Controller.extend({
columnWidth: function() {
var scorecardColumns = this.get('scorecards.length');
var scorecardColumns = this.get('model.scorecards.length');
var scorecardColumnPercentage = 100 / scorecardColumns;

return 'width: ' + scorecardColumnPercentage + '%;';
}.property('scorecards.length'),
}.property('model.scorecards.length'),

holeNumbers: function() {
var turnsCount = this.get('scorecards.firstObject.turns.length');
var turnsCount = this.get('model.scorecards.firstObject.turns.length');
var holeNumbers = new Array(turnsCount)
.join().split(',')
.map(function(item, index){ return ++index; });

return holeNumbers;
}.property('scorecards.firstObject.turns.length')
}.property('model.scorecards.firstObject.turns.length')

});

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/round/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default Ember.Controller.extend({
return friends.filter(function(friend) {
return !player_ids.contains(friend.get("id"));
});
}.property('roundPlayers.@each', 'friends.@each'),
}.property('roundPlayers.[]', 'friends.[]'),

actions: {
addPlayer: function() {
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/rounds/new.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Ember from 'ember';

var RoundsNewController = Ember.ObjectController.extend({
var RoundsNewController = Ember.Controller.extend({
selectedPlayer: null,
query: null,
nearestCourses: false,

potentialPlayers: function() {
var friends = this.get('friends');
var players = this.get('players');
var players = this.get('model.players');
players.forEach(function(p) { friends.removeObject(p); });

return friends;
}.property('friends.@each', 'players.@each'),
}.property('friends.[]', 'model.players.[]'),


noPlayerSelected: function() {
Expand All @@ -20,13 +20,13 @@ var RoundsNewController = Ember.ObjectController.extend({

actions: {
addPlayer: function() {
this.get('players').addObject(this.get('selectedPlayer'));
this.get('model.players').addObject(this.get('selectedPlayer'));
this.set('selectedPlayer', null);
this.set('query', null);
},

removePlayer: function(player) {
this.get('players').removeObject(player);
this.get('model.players').removeObject(player);
},

updateCourseInput: function(nearestCourse) {
Expand All @@ -38,7 +38,7 @@ var RoundsNewController = Ember.ObjectController.extend({

createRound: function() {
var _this = this;
this.set('model.course', this.get('model.course.content'));

this.get('model').save().then(function(round) {
_this.controllerFor('application').set('currentRound', round);
_this.controllerFor('application').set('currentHole', '1');
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/turns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var TurnsController = Ember.ArrayController.extend({
var TurnsController = Ember.Controller.extend({
holeNumber: Ember.computed.alias('model.firstObject.holeNumber'),

holePar: Ember.computed.alias('model.firstObject.par'),
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/users/new.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var UsersNewController = Ember.ObjectController.extend({
var UsersNewController = Ember.Controller.extend({
needs: "sessions",

actions: {
Expand All @@ -9,9 +9,9 @@ var UsersNewController = Ember.ObjectController.extend({
user = this.get('model');

if (user.get('hasValidPassword')) {
user.save().then(function() {
var email = self.get('email'),
password = self.get('password');
user.save().then(function(user) {
var email = user.get('email'),
password = user.get('password');

self.get('controllers.sessions').send("loginWithCredentials", email, password);
});
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/display-date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
/* global moment */

export default Ember.Handlebars.makeBoundHelper(function(value) {
export default Ember.Helper.helper(function([value]) {
return moment(value).format('dddd, MMM Do YYYY');
});
2 changes: 1 addition & 1 deletion app/helpers/display-score.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

export default Ember.Handlebars.makeBoundHelper(function(score) {
export default Ember.Helper.helper(function([score]) {
if (score > 0) {
return "+" + score;
} else if (Math.abs(score) === 0) {
Expand Down
7 changes: 0 additions & 7 deletions app/helpers/formatted-address.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/helpers/ranking-from-index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';

export default Ember.Handlebars.makeBoundHelper(function(index) {
export default Ember.Helper.helper(function([index]) {
return index + 1 + ".";
});
1 change: 0 additions & 1 deletion app/models/course.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var Course = DS.Model.extend({
scorecards: DS.hasMany('scorecard', { async: true }),
holes: DS.hasMany('hole', { async: true }),
holeCount: DS.attr('number'),
reviews: DS.hasMany('review', { async: true }),
photos: DS.hasMany('photo', {async: true}),

isApproved: function() {
Expand Down
Loading

0 comments on commit 1b26a68

Please sign in to comment.