Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fastboot-log
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Nov 25, 2019
2 parents b72684b + 1ccd730 commit 5ebd4bc
Show file tree
Hide file tree
Showing 37 changed files with 585 additions and 132 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ env:
- JOBS=1 # See https://git.io/vdao3 for details.
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
- CARGO_TARGET_DIR=target
- CARGO_INCREMENTAL=0
- PERCY_PARALLEL_TOTAL=2
# Percy secrets are included here to enable Percy's GitHub integration
# on community-submitted PRs
- PERCY_TOKEN=0d8707a02b19aebbec79bb0bf302b8d2fa95edb33169cfe41b084289596670b1
- PERCY_PROJECT=crates-io/crates.io
- PGPORT=5433
- PATH=$HOME/.cargo/bin:$PATH
- RUSTFLAGS="-C debuginfo=0"

install:
- sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/11/main/pg_hba.conf
- sudo systemctl restart postgresql@11-main
- script/ci/cargo-clean-on-new-rustc-version.sh
- cargo install --force diesel_cli --vers `cat .diesel_version` --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
- which diesel || cargo install diesel_cli --vers `cat .diesel_version` --no-default-features --features postgres

before_script:
- diesel database setup --locked-schema
Expand Down
56 changes: 44 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions app/components/api-token-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ export default Component.extend({
serverError: null,

didInsertElement() {
let input = this.element.querySelector('input');
if (input.focus) {
input.focus();
if (this.get('api_token.isNew')) {
this.$('input').focus();
}
},

Expand Down
4 changes: 4 additions & 0 deletions app/components/crate-row.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import Component from '@ember/component';
import { computed } from '@ember/object';

export default Component.extend({
classNames: ['crate', 'row'],
crateTomlText: computed('crate.name', 'max_version', function() {
return `${this.get('crate.name')} = "${this.get('crate.max_version')}"`;
}),

'data-test-crate-row': true,
});
32 changes: 32 additions & 0 deletions app/components/crate-toml-copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Component from '@ember/component';
import { later } from '@ember/runloop';

export default Component.extend({
classNames: ['crate-toml-copy'],
copyText: '',
showSuccess: false,
showNotification: false,
toggleClipboardProps(isSuccess) {
this.setProperties({
showSuccess: isSuccess,
showNotification: true,
});
later(
this,
() => {
this.set('showNotification', false);
},
2000,
);
},
actions: {
copySuccess(event) {
event.clearSelection();
this.toggleClipboardProps(true);
},

copyError() {
this.toggleClipboardProps(false);
},
},
});
27 changes: 3 additions & 24 deletions app/controllers/crate/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Controller from '@ember/controller';
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
import ArrayProxy from '@ember/array/proxy';
import { computed, observer } from '@ember/object';
import { later } from '@ember/runloop';
import moment from 'moment';

const NUM_VERSIONS = 5;
Expand All @@ -25,6 +24,9 @@ export default Controller.extend({
fetchingFollowing: true,
following: false,
currentVersion: alias('model'),
crateTomlText: computed('crate.name', 'currentVersion.num', function() {
return `${this.get('crate.name')} = "${this.get('currentVersion.num')}"`;
}),
requestedVersion: null,
keywords: alias('crate.keywords'),
categories: alias('crate.categories'),
Expand Down Expand Up @@ -152,30 +154,7 @@ export default Controller.extend({
return data;
}),

toggleClipboardProps(isSuccess) {
this.setProperties({
showSuccess: isSuccess,
showNotification: true,
});
later(
this,
() => {
this.set('showNotification', false);
},
2000,
);
},

actions: {
copySuccess(event) {
event.clearSelection();
this.toggleClipboardProps(true);
},

copyError() {
this.toggleClipboardProps(false);
},

toggleFollow() {
this.set('fetchingFollowing', true);

Expand Down
1 change: 1 addition & 0 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default Route.extend({
},

setupController(controller) {
this.controllerFor('application').set('searchQuery', null);
controller.dataTask.perform();
},
});
1 change: 1 addition & 0 deletions app/routes/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default Route.extend({
},

setupController(controller, params) {
this.controllerFor('application').set('searchQuery', params.q);
controller.dataTask.perform(params);
},
});
Loading

0 comments on commit 5ebd4bc

Please sign in to comment.