Skip to content
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

Bump Ember-Data to 2.14 #1173

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions app/components/add-ssh-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ export default Ember.Component.extend({
didInsertElement() {
let id = this.get('repo.id');
let store = this.get('store');
const model = store.peekRecord('ssh_key', id)
|| store.createRecord('ssh_key', { id });
const currentKey = store.peekRecord('ssh_key', id);
if (currentKey) {
store.unloadRecord(currentKey);
// It seems there's a bug in unloadRecord that prevents it from fully
// clearing the store, so we need to do more cleanup
let recordMap = store._internalModelsFor('ssh-key');
let internalModel = recordMap.get(currentKey.get('id'));
if (internalModel) {
recordMap.remove(internalModel, currentKey.get('id'));
}
}

return this.set('model', model);
return this.set('model', store.createRecord('ssh_key', { id }));
},

isValid() {
Expand Down
11 changes: 0 additions & 11 deletions app/templates/dashboard/repositories.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<div class="inner">
<!-- <div class="dashboard-header">
{{orgs-filter orgs=model.accounts selected=selectedOrg action="selectOrg"}}
{{sync-button}}
</div> -->

<div class="dashboard-repos">
<section class="dashboard-section dashboard-starred">
<h2 class="small-title">Starred repositories</h2>
Expand All @@ -30,11 +25,5 @@

{{pagination-navigation collection=model.repos route="dashboard.repositories"}}
</section>

<!-- <section class="dashboard-section dashboard-inactive">
<h2 class="small-title">Inactive repositories</h2>
<ul class="repo-list">
</ul>
</section> -->
</div>
</div>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"ember-cli-test-loader": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-concurrency": "0.8.5",
"ember-data": "2.12.2",
"ember-data": "emberjs/data#master",
"ember-data-filter": "1.13.0",
"ember-decorators": "1.1.0",
"ember-disable-proxy-controllers": "^1.0.1",
Expand Down
7 changes: 7 additions & 0 deletions tests/acceptance/repo/settings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { test } from 'qunit';
import moduleForAcceptance from 'travis/tests/helpers/module-for-acceptance';
import settingsPage from 'travis/tests/pages/settings';
import topPage from 'travis/tests/pages/top';
import Mirage from 'ember-cli-mirage';

moduleForAcceptance('Acceptance | repo settings', {
beforeEach() {
Expand Down Expand Up @@ -322,6 +323,12 @@ test('delete and set SSH keys', function (assert) {

server.delete('/settings/ssh_key/:id', function (schema, request) {
deletedIds.push(request.params.id);
schema.sshKeys
.where({ repositoryId: request.queryParams.id })
.models
.map(sshKey => sshKey.destroyRecord());

return new Mirage.Response(204, {}, {});
});

settingsPage.sshKey.delete();
Expand Down