Skip to content

Commit

Permalink
#91 Sort analyzers list by name in the analyzers page
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 12, 2018
1 parent 0a3a733 commit cbbbdb7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion www/src/app/pages/analyzers/analyzers.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export default class AnalyzersController extends PageController {
this.SearchService.configure({
objectType: 'analyzer',
filter: this.buildQuery(),
range: this.buildRange()
range: this.buildRange(),
sort: '+name'
})
.search()
.then(response => {
Expand Down
30 changes: 17 additions & 13 deletions www/src/app/pages/analyzers/analyzers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,23 @@ export default class AnalyzerService {
list() {
let defered = this.$q.defer();

this.$http.get('./api/analyzer', { params: { range: 'all' } }).then(
response => {
this.analyzers = response.data;
this.dataTypes = _.sortBy(
_.uniq(_.flatten(_.map(response.data, 'dataTypeList')))
);

defered.resolve(response.data);
},
response => {
defered.reject(response);
}
);
this.$http
.get('./api/analyzer', {
params: { range: 'all', sort: '+name' }
})
.then(
response => {
this.analyzers = response.data;
this.dataTypes = _.sortBy(
_.uniq(_.flatten(_.map(response.data, 'dataTypeList')))
);

defered.resolve(response.data);
},
response => {
defered.reject(response);
}
);

return defered.promise;
}
Expand Down

0 comments on commit cbbbdb7

Please sign in to comment.