import Route from '@ember/routing/route';

export default Route.extend({
  titleToken() {
    switch (this.get('params.users_status')) {
      case 'active':
        return this.get('l10n').t('Active');
      case 'deleted':
        return this.get('l10n').t('Deleted');
    }
  },
  beforeModel(transition) {
    this._super(...arguments);
    const userState = transition.params[transition.targetName].users_status;
    if (!['all', 'deleted', 'active'].includes(userState)) {
      this.replaceWith('admin.users.view', userState);
    }
  },
  model(params) {
    this.set('params', params);
    let filterOptions = [];
    if (params.users_status === 'active') {
      filterOptions = [
        {
          name : 'deleted-at',
          op   : 'eq',
          val  : null
        }
      ];
    } else if (params.users_status === 'deleted') {
      filterOptions = [
        {
          name : 'deleted-at',
          op   : 'ne',
          val  : null
        }
      ];
    }
    return this.get('store').query('user', {
      include      : 'events',
      get_trashed  : true,
      filter       : filterOptions,
      'page[size]' : 10
    });
  }
});

@@ -34,16 +34,45 @@
 /route';
+%0Aimport moment from 'moment';
 %0A%0Aexport
@@ -715,32 +715,67 @@
 s = %5B%0A        %7B%0A
+          and: %5B%0A            %7B%0A    
           name :
@@ -791,32 +791,36 @@
 -at',%0A          
+    
 op   : 'eq',%0A   
@@ -816,16 +816,20 @@
 : 'eq',%0A
+    
         
@@ -834,32 +834,216 @@
     val  : null%0A
+            %7D,%0A            %7B%0A              name : 'last-accessed-at',%0A              op   : 'ge',%0A              val  : moment().subtract(1, 'Y').toISOString()%0A            %7D%0A          %5D%0A
         %7D%0A      

Fix : Improving filter for admin/user active list (#2135)