Skip to content
Open
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
10 changes: 4 additions & 6 deletions app/dashboard/controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Store from '@ember-data/store';
import { A } from '@ember/array';
import Controller from '@ember/controller';
import { action, computed } from '@ember/object';
import { alias, or } from '@ember/object/computed';
Expand All @@ -11,7 +10,6 @@ import config from 'ember-osf-web/config/environment';
import $ from 'jquery';
import Media from 'ember-responsive';

import Institution from 'ember-osf-web/models/institution';
import Node from 'ember-osf-web/models/node';
import { QueryHasManyResult } from 'ember-osf-web/models/osf-model';
import User from 'ember-osf-web/models/user';
Expand Down Expand Up @@ -46,7 +44,7 @@ export default class Dashboard extends Controller {
'failedLoading-noteworthy' = false;
'failedLoading-popular' = false;

institutions: Institution[] = A([]);
// institutions: Institution[] = A([]);
nodes?: QueryHasManyResult<Node>;
noteworthy!: QueryHasManyResult<Node>;
popular!: QueryHasManyResult<Node>;
Expand All @@ -65,16 +63,16 @@ export default class Dashboard extends Controller {
async setupTask() {
this.set('filter', null);

const institutions = this.store.findAll('institution');
// const institutions = this.store.findAll('institution');

await all([
institutions,
// institutions,
taskFor(this.findNodes).perform(),
taskFor(this.getPopularAndNoteworthy).perform(popularNode, 'popular'),
taskFor(this.getPopularAndNoteworthy).perform(noteworthyNode, 'noteworthy'),
]);

this.set('institutions', institutions.toArray());
// this.set('institutions', institutions.toArray());
}

@restartableTask
Expand Down
4 changes: 2 additions & 2 deletions app/models/sparse-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default class SparseNodeModel extends OsfModel {
@belongsTo('node', { inverse: 'children' })
parent!: AsyncBelongsTo<NodeModel> & NodeModel;

@belongsTo('node', { inverse: null })
root!: AsyncBelongsTo<NodeModel> & NodeModel;
@belongsTo('sparse-node', { inverse: null })
root!: AsyncBelongsTo<SparseNodeModel> & SparseNodeModel;

@belongsTo('node', { inverse: null })
detail!: AsyncBelongsTo<NodeModel> & NodeModel;
Expand Down
Loading