-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic self hosted onboarding (#1177)
* Add basic self hosted onboarding * Lint fix * Normalize translations
- Loading branch information
Showing
6 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ def initialize | |
end | ||
|
||
def reset_and_clear_data! | ||
reset_settings! | ||
clear_data! | ||
create_user! | ||
|
||
|
@@ -14,6 +15,7 @@ def reset_and_clear_data! | |
|
||
def reset_data! | ||
Family.transaction do | ||
reset_settings! | ||
clear_data! | ||
create_user! | ||
|
||
|
@@ -52,12 +54,17 @@ def reset_family! | |
end | ||
|
||
def clear_data! | ||
InviteCode.destroy_all | ||
User.find_by_email("[email protected]")&.destroy | ||
ExchangeRate.destroy_all | ||
Security.destroy_all | ||
Security::Price.destroy_all | ||
end | ||
|
||
def reset_settings! | ||
Setting.destroy_all | ||
end | ||
|
||
def create_user! | ||
family.users.create! \ | ||
email: "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<% | ||
header_title t(".title") | ||
%> | ||
|
||
<% if self_hosted_first_login? %> | ||
<div class="fixed inset-0 w-full h-fit bg-gray-25 p-5 border-b border-alpha-black-200 flex flex-col gap-3 items-center text-center mb-12"> | ||
<h2 class="font-bold text-xl"><%= t(".welcome_title") %></h2> | ||
<p class="text-gray-500 text-sm"><%= t(".welcome_body") %></p> | ||
</div> | ||
<% end %> | ||
|
||
<%= styled_form_with model: @user, url: registration_path, class: "space-y-4" do |form| %> | ||
<%= auth_messages form %> | ||
<%= form.email_field :email, autofocus: false, autocomplete: "email", required: "required", placeholder: "[email protected]", label: true %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters