Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@

<script>

import orderBy from 'lodash/orderBy';
import sortBy from 'lodash/sortBy';
import { mapActions, mapGetters } from 'vuex';
import camelCase from 'lodash/camelCase';
Expand Down Expand Up @@ -468,7 +469,7 @@
return this.translateConstant(masteryModel);
},
sortedTags() {
return sortBy(this.node.tags, '-count');
return orderBy(this.node.tags, ['count'], ['desc']);
},
license() {
return Licenses.get(this.node.license);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
import debounce from 'lodash/debounce';
import difference from 'lodash/difference';
import isEqual from 'lodash/isEqual';
import sortBy from 'lodash/sortBy';
import union from 'lodash/union';
import { RouteNames } from '../../constants';
import CatalogFilters from './CatalogFilters';
Expand Down Expand Up @@ -189,7 +190,9 @@
return RouteNames.CATALOG_DETAILS;
},
channels() {
return this.getChannels(this.page.results);
// Sort again by the same ordering used on the backend - name.
// Have to do this because of how we are getting the object data via getChannels.
return sortBy(this.getChannels(this.page.results), 'name');
},
selectedCount() {
return this.page.count - this.excluded.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script>

import { mapGetters, mapActions } from 'vuex';
import sortBy from 'lodash/sortBy';
import orderBy from 'lodash/orderBy';
import { RouteNames, CHANNEL_PAGE_SIZE } from '../../constants';
import ChannelItem from './ChannelItem';
import LoadingText from 'shared/views/LoadingText';
Expand Down Expand Up @@ -83,13 +83,16 @@
if (!channels) {
return [];
}
const sortFields = ['-modified'];
const sortFields = ['modified'];
const orderFields = ['desc'];
if (this.listType === ChannelListTypes.PUBLIC) {
sortFields.unshift('-priority');
sortFields.unshift('priority');
orderFields.unshift('desc');
}
return sortBy(
return orderBy(
this.channels.filter(channel => channel[this.listType] && !channel.deleted),
sortFields
sortFields,
orderFields
);
},
isEditable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@

<script>

import sortBy from 'lodash/sortBy';
import orderBy from 'lodash/orderBy';
import DetailsRow from './DetailsRow';
import { SCALE_TEXT, SCALE, CHANNEL_SIZE_DIVISOR } from './constants';
import {
Expand Down Expand Up @@ -348,7 +348,7 @@
});
},
kindCount() {
return sortBy(this.details.kind_count, ['-count', 'kind_id']);
return orderBy(this.details.kind_count, ['count', 'kind_id'], ['desc', 'asc']);
},
createdDate() {
return this.$formatDate(this.details.created, {
Expand All @@ -361,7 +361,7 @@
return Object.keys(this.details).length;
},
sortedTags() {
return sortBy(this.details.tags, '-count');
return orderBy(this.details.tags, ['count'], ['desc']);
},
includesPrintable() {
const includes = [];
Expand Down