FEATURE: new 'staged' users list for admins

This commit is contained in:
Régis Hanol 2018-05-17 01:52:49 +02:00
parent bfbdee6a57
commit a9ebde5111
4 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@
{{nav-item route='adminUsersList.show' routeParam='suspended' label='admin.users.nav.suspended'}}
{{nav-item route='adminUsersList.show' routeParam='silenced' label='admin.users.nav.silenced'}}
{{nav-item route='adminUsersList.show' routeParam='suspect' label='admin.users.nav.suspect'}}
{{nav-item route='adminUsersList.show' routeParam='staged' label='admin.users.nav.staged'}}
{{nav-item route='groups' label='groups.index.title'}}
</ul>
</nav>

View File

@ -3496,6 +3496,7 @@ en:
suspended: 'Suspended'
silenced: 'Silenced'
suspect: 'Suspect'
staged: 'Staged'
approved: "Approved?"
approved_selected:
one: "approve user"
@ -3518,6 +3519,7 @@ en:
silenced: 'Silenced Users'
suspended: 'Suspended Users'
suspect: 'Suspect Users'
staged: 'Staged Users'
reject_successful:
one: "Successfully rejected 1 user."
other: "Successfully rejected %{count} users."

View File

@ -98,6 +98,7 @@ class AdminUserIndexQuery
when 'suspended' then @query.suspended
when 'pending' then @query.not_suspended.where(approved: false, active: true)
when 'suspect' then suspect_users
when 'staged' then @query.where(staged: true)
end
end

View File

@ -176,6 +176,17 @@ describe AdminUserIndexQuery do
end
describe "with a staged user" do
let!(:user) { Fabricate(:user, staged: true) }
it "finds the staged user" do
query = ::AdminUserIndexQuery.new(query: 'staged')
expect(query.find_users.count).to eq(1)
end
end
describe "filtering" do
context "exact email bypass" do