Skip to content

Update Ember.js #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 65 commits into from
Nov 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7882a4e
update ember-app
stefanpenner May 7, 2015
29c621c
cleanup + some es6ification
stefanpenner May 7, 2015
ac43647
update editorconfig
stefanpenner May 7, 2015
1fbc979
update some whitespace pre request (and now aligned with the .editorc…
stefanpenner May 7, 2015
e2514b8
restore traliing comma
stefanpenner May 7, 2015
ec9091b
fix indentation
stefanpenner May 7, 2015
3a80288
make start:ui appear as a refinement to start, rather then an entirel…
stefanpenner May 7, 2015
5b57458
fix /crates deprecations
stefanpenner May 7, 2015
1a572fe
render “crates-list” -> {{crates-list component
stefanpenner May 7, 2015
5656b85
remove more deprecation from index
stefanpenner May 7, 2015
6429889
fix more deprecations
stefanpenner May 7, 2015
a112e0e
* fixup more object proxy properties
stefanpenner May 7, 2015
f3aff4f
use new each form
stefanpenner May 7, 2015
8f4283f
remove some bind-attr
stefanpenner May 7, 2015
1183aad
render “crate-row” -> {{crate-row component
stefanpenner May 7, 2015
8ba8a7f
remove more proxy usage
stefanpenner May 7, 2015
0e6779b
introduce link-to-dep
stefanpenner May 7, 2015
828ea42
remove more bind-attr usage
stefanpenner May 7, 2015
51ae402
prefer new param form each
stefanpenner May 7, 2015
e78b2af
Merge remote-tracking branch 'upstream/master' into ember-update
Turbo87 Nov 3, 2015
fe3adf5
Update "broccoli-sass" dependency
Turbo87 Nov 3, 2015
1e935f9
TravisCI: Install missing bower dependencies
Turbo87 Nov 3, 2015
6a37bc0
TravisCI: Use node v0.12
Turbo87 Nov 3, 2015
be3d543
TravisCI: Cache node_modules folder
Turbo87 Nov 3, 2015
0e917d3
TravisCI: Use "npm test" instead of "ember test"
Turbo87 Nov 3, 2015
53dc29d
TravisCI: Use "install" and "before_install" sections
Turbo87 Nov 3, 2015
8409c31
TravisCI: Use preinstalled phantomjs package
Turbo87 Nov 3, 2015
83e8c60
TravisCI: Use npm v2.x
Turbo87 Nov 3, 2015
7ac948e
Update ember-cli to v1.13.8
Turbo87 Nov 3, 2015
7576e03
Replace "needs" with injection
Turbo87 Nov 3, 2015
d4a2c6f
Use synchronous relationships in ember-data
Turbo87 Nov 3, 2015
2818774
Replace deprecated resource() calls with route()
Turbo87 Nov 3, 2015
c6b917e
Replace deprecated "bind-attr" with bound attributes
Turbo87 Nov 3, 2015
ee55fbb
controllers/install: Fix/Simplify link() function
Turbo87 Nov 3, 2015
96aba4c
npm: Replace broccoli-sass with ember-cli-sass
Turbo87 Nov 3, 2015
39d44b3
npm: Remove unused dependencies
Turbo87 Nov 3, 2015
ffa6b30
templates/crate/index: Fix keyword rendering
Turbo87 Nov 3, 2015
59ae8a6
templates/keyword: Fix typo
Turbo87 Nov 3, 2015
262e18f
templates/keyword: Fix dropdown element
Turbo87 Nov 3, 2015
3cc3f47
templates/keywords: Fix keyword rendering
Turbo87 Nov 3, 2015
1d92ab0
templates: Use non-binding {{each}}
Turbo87 Nov 3, 2015
5084db6
templates/crate/versions: Fix rendering
Turbo87 Nov 3, 2015
7d431cb
helpers: Replace makeBoundsHelper() with Helper class
Turbo87 Nov 3, 2015
9b32659
npm: Disable ember-cli-content-security-policy for now
Turbo87 Nov 3, 2015
a00cc18
templates/search: Fix pagination links
Turbo87 Nov 3, 2015
2b60dc7
templates/crate: Fix proxy deprecation
Turbo87 Nov 3, 2015
577bac7
controllers/crate: Fix @each property deprecation
Turbo87 Nov 3, 2015
182dc30
templates/crate/reverse-dependencies: Fix links
Turbo87 Nov 3, 2015
24afb69
controllers: Replace deprecated ArrayControllers
Turbo87 Nov 3, 2015
06385e8
templates/crate: Replace {{link-to ... this}}
Turbo87 Nov 3, 2015
2b66d81
controllers: Replace deprecated ObjectControllers
Turbo87 Nov 3, 2015
9838286
services/session: Derive from Service class
Turbo87 Nov 3, 2015
38b0acc
routes: Replace deprecated store.push() calls
Turbo87 Nov 3, 2015
fccf81d
templates/crates: Replace deprecated {{view 'select'}} with emberx-se…
Turbo87 Nov 4, 2015
58923f0
templates: Replace deprecated "action=" with "enter=" on input elements
Turbo87 Nov 4, 2015
430a32b
Replace deprecated find() calls and findQuery() implementations
Turbo87 Nov 4, 2015
ccdb185
templates/dashboard: Fix update feed rendering
Turbo87 Nov 4, 2015
9bd7969
routes/dashboard: Replace deprecated find() with query() call
Turbo87 Nov 4, 2015
f895ae6
templates: Replace my-crate-list template with crate-downloads-list c…
Turbo87 Nov 4, 2015
21aaf26
controllers/dashboard: Replace deprecated store.pushMany() calls
Turbo87 Nov 4, 2015
88c3b7a
Update dependencies to fix remaining deprecation warnings
Turbo87 Nov 4, 2015
3527f2b
components/crate-row: Flatten div tree
Turbo87 Nov 6, 2015
ce6181f
Downgrade "ember-data" to v1.13.9
Turbo87 Nov 6, 2015
4b2f353
templates/me: Fix API token rendering
Turbo87 Nov 6, 2015
7cbe2cf
templates/crate: Add missing "tan-button" style
Turbo87 Nov 6, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
indent_size = 4

[*.js]
indent_style = space
indent_size = 2
indent_size = 4

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2
indent_size = 4

[*.css]
indent_style = space
indent_size = 2
indent_size = 4

[*.html]
indent_style = space
indent_size = 2
indent_size = 4

[*.md]
[*.{diff,md}]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# dependencies
/node_modules
/bower_components/*
/bower_components

# misc
/.sass-cache
Expand Down
16 changes: 7 additions & 9 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"predef": {
"document": true,
"window": true,
"-Promise": true,
"moment": true,
"google": true
},
"browser" : true,
"boss" : true,
"predef": [
"document",
"window",
"-Promise"
],
"browser": true,
"boss": true,
"curly": true,
"debug": false,
"devel": true,
Expand Down
21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ language: rust
rust: nightly
sudo: false

before_script:
cache:
directories:
- node_modules

before_install:
- nvm install 0.12
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"

install:
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
- psql -c 'create database cargo_registry_test;' -U postgres
- npm install -g phantomjs ember-cli
- npm install -g bower
- npm install
- bower install

before_script:
- psql -c 'create database cargo_registry_test;' -U postgres

script:
- cargo build
- cargo test
- ember test
- npm test

after_success:
- travis-cargo coveralls --no-sudo
Expand Down
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp"]
}
23 changes: 0 additions & 23 deletions Brocfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ which enables tweaking the UI of the site without actually having the server
running locally. To get up and running with just the UI, run:

```
npm run startui
npm run start:ui
```

This will give you a local server to browse while using the staging backend
Expand Down
4 changes: 2 additions & 2 deletions app/adapters/dependency.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ApplicationAdapter from './application';

export default ApplicationAdapter.extend({
findQuery: function(store, type, query) {
query(store, type, query) {
if (!query.reverse) {
return this._super(store, type, query);
return this._super(...arguments);
}
delete query.reverse;
var crate = query.crate;
Expand Down
8 changes: 6 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

var App;

Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
});

loadInitializers(App, config.modulePrefix);
Ember.$.ajaxSetup({cache: false});
Ember.$.ajaxSetup({
cache: false
});

export default App;
5 changes: 5 additions & 0 deletions app/components/crate-row.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Component.extend({
classNames: ['crate', 'row']
});
14 changes: 7 additions & 7 deletions app/components/user-avatar.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import Ember from 'ember';

const { computed } = Ember;

export default Ember.Component.extend({
size: 'small',
user: null,
attributeBindings: ['src', 'width', 'height'],
tagName: 'img',

width: function() {
width: computed('size', function() {
if (this.get('size') === 'small') {
return 22;
} else if (this.get('size') === 'medium-small') {
return 32;
} else {
return 85; // medium
}
}.property('size'),
}),

height: function() {
return this.get('width');
}.property('width'),
height: computed.readOnly('width'),

src: function() {
src: computed('size', 'user', function() {
return this.get('user.avatar') + '&s=' + this.get('width');
}.property('size', 'user'),
})
});
11 changes: 5 additions & 6 deletions app/components/user-link.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import Ember from 'ember';

const { computed } = Ember;

export default Ember.Component.extend({
user: null,
attributeBindings: ['title', 'href'],
tagName: 'a',

title: function() {
return this.get('user.login');
}.property('user'),

'href': function() {
title: computed.readOnly('user.login'),
href: computed('user', function() {
// TODO replace this with a link to a native crates.io profile
// page when they exist.
return this.get('user.url');
}.property('user'),
})
});
35 changes: 23 additions & 12 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,60 @@
import Ember from 'ember';

const { observer } = Ember;

export default Ember.Controller.extend({
needs: ['search'],
searchController: Ember.inject.controller('search'),

flashError: null,
nextFlashError: null,
showUserOptions: false,
search: Ember.computed.oneWay('controllers.search.q'),
search: Ember.computed.oneWay('searchController.q'),

stepFlash: function() {
stepFlash() {
this.set('flashError', this.get('nextFlashError'));
this.set('nextFlashError', null);
},

aboutToTransition: function() {
aboutToTransition() {
Ember.$(document).trigger('mousedown');
},

resetDropdownOption: function(controller, option) {
// don't use this from other controllers..
resetDropdownOption(controller, option) {
controller.set(option, !controller.get(option));
if (controller.get(option)) {
Ember.$(document).on('mousedown.useroptions', function(e) {
Ember.$(document).on('mousedown.useroptions', (e) => {
if (Ember.$(e.target).prop('tagName') === 'INPUT') {
return;
}
Ember.run.later(function() {
Ember.run.later(() => {
controller.set(option, false);
}, 150);
Ember.$(document).off('mousedown.useroptions');
});
}
},

currentPathChanged: function () {
_scrollToTop() {
window.scrollTo(0, 0);
}.observes('currentPath'),
},

// TODO: remove observer & DOM mutation in controller..
currentPathChanged: observer('currentPath', function () {
Ember.run.scheduleOnce('afterRender', this, this._scrollToTop);
}),

actions: {
search: function(query) {
search(q) {
this.transitionToRoute('search', {
queryParams: {q: query, page: 1}
queryParams: {
q,
page: 1
}
});
},

toggleUserOptions: function() {
toggleUserOptions() {
this.resetDropdownOption(this, 'showUserOptions');
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/catch-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Ember from 'ember';

export default Ember.Controller.extend({
actions: {
search: function(query) {
search(query) {
return this.transitionToRoute('search', {queryParams: {q: query}});
},
},
Expand Down
Loading