mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: User fields required for existing users - Part 2 (#27172)
We want to allow admins to make new required fields apply to existing users. In order for this to work we need to have a way to make those users fill up the fields on their next page load. This is very similar to how adding a 2FA requirement post-fact works. Users will be redirected to a page where they can fill up the remaining required fields, and until they do that they won't be able to do anything else.
This commit is contained in:
@ -8,6 +8,12 @@ module PageObjects
|
||||
self
|
||||
end
|
||||
|
||||
def choose_requirement(requirement)
|
||||
form = page.find(".user-field")
|
||||
|
||||
form.choose(I18n.t("admin_js.admin.user_fields.requirement.#{requirement}.title"))
|
||||
end
|
||||
|
||||
def add_field(name: nil, description: nil, requirement: nil, preferences: [])
|
||||
page.find(".user-fields .btn-primary").click
|
||||
|
||||
|
12
spec/system/page_objects/pages/user_preferences_profile.rb
Normal file
12
spec/system/page_objects/pages/user_preferences_profile.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class UserPreferencesProfile < PageObjects::Pages::Base
|
||||
def visit(user)
|
||||
page.visit("/u/#{user.username}/preferences/profile")
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user