mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: add last seen as sort option
This commit is contained in:
parent
6b742a0b92
commit
cc96134e2f
@ -117,6 +117,9 @@ export default class FeatureListComponent extends React.Component {
|
||||
<MenuItem disabled={settings.sort === 'created'} data-target="created">
|
||||
Created
|
||||
</MenuItem>
|
||||
<MenuItem disabled={settings.sort === 'Last seen'} data-target="Last seen">
|
||||
Last seen
|
||||
</MenuItem>
|
||||
<MenuItem disabled={settings.sort === 'strategies'} data-target="strategies">
|
||||
Strategies
|
||||
</MenuItem>
|
||||
|
@ -45,6 +45,8 @@ export const mapStateToPropsConfigurable = isFeature => state => {
|
||||
);
|
||||
} else if (settings.sort === 'created') {
|
||||
features = features.sort((a, b) => (new Date(a.createdAt) > new Date(b.createdAt) ? -1 : 1));
|
||||
} else if (settings.sort === 'Last seen') {
|
||||
features = features.sort((a, b) => (new Date(a.lastSeenAt) > new Date(b.lastSeenAt) ? -1 : 1));
|
||||
} else if (settings.sort === 'name') {
|
||||
features = features.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
|
Loading…
Reference in New Issue
Block a user