Clarify importing accounts

This commit is contained in:
Andy Smith
2026-02-11 16:36:09 -06:00
parent 37d7f5c569
commit b786bf24e0
4 changed files with 63 additions and 17 deletions
+33
View File
@@ -0,0 +1,33 @@
@layer components {
.import-status {
--import-status-border-color: var(--color-ink-light);
--import-status-color: var(--color-ink);
border: 1px dashed var(--import-status-border-color);
border-radius: 1ch;
color: var(--import-status-color);
font-size: var(--text-medium);
padding: 1.5ch;
.btn {
font-size: var(--text-small);
margin-block-start: 1.5ch;
}
}
.import-status--success {
--import-status-border-color: var(--color-positive);
--import-status-color: var(--color-positive);
}
.import-status--error {
--import-status-border-color: var(--color-negative);
--import-status-color: var(--color-negative);
}
@keyframes dash {
to {
background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%;
}
}
}
+1
View File
@@ -32,6 +32,7 @@
.txt-link { color: var(--color-link); text-decoration: underline; }
.font-weight-normal { font-weight: normal; }
.font-weight-semibold { font-weight: 600; }
.font-weight-bold { font-weight: bold; }
.font-weight-black { font-weight: 900; }
+10 -4
View File
@@ -1,9 +1,15 @@
<% @page_title = "Import an account" %>
<div class="panel panel--centered flex flex-column gap">
<div class="panel panel--centered flex flex-column gap" style="--panel-size: 54ch;">
<header>
<h1 class="txt-x-large font-weight-black txt-tight-lines margin-block-end-half">Import a Fizzy account</h1>
<div>Create an account using data from a Fizzy export. Upload the exported .zip file below.</div>
<h1 class="txt-x-large font-weight-black txt-tight-lines margin-block-end-none">Import a Fizzy account</h1>
<% if Fizzy.saas? %>
<div class="font-weight-semibold margin-block-end">Move a self-hosted account to fizzy.do</div>
<div>Export your self-hosted account, then upload the .zip file below.</div>
<% else %>
<div class="font-weight-semibold margin-block-end">Move an account from fizzy.do to a self-hosted instance</div>
<div>Export your fizzy.do account, then upload the .zip file below.</div>
<% end %>
</header>
<%= form_with url: account_imports_path, class: "flex flex-column gap", data: { controller: "form upload-preview" }, multipart: true do |form| %>
+19 -13
View File
@@ -2,25 +2,31 @@
<%= turbo_stream_from @import %>
<div class="panel panel--centered flex flex-column gap-half">
<div class="panel panel--centered flex flex-column gap-half" style="--panel-size: 54ch;">
<h1 class="txt-x-large font-weight-black margin-block-end">Import status</h1>
<% case @import.status %>
<% when "pending", "processing" %>
<p class="txt-medium">Your import is in progress. This may take a while for large accounts.</p>
<div class="import-status">
Your import is in progress. This may take a while for large accounts.
</div>
<% when "completed" %>
<p class="txt-medium txt-positive">Your import has completed successfully!</p>
<%= link_to "Go to your account", landing_url(script_name: @import.account.slug), class: "btn btn--link center txt-medium" %>
<div class="import-status import-status--success">
<div><strong>Your import was successfull!</strong></div>
<%= link_to "Go to your account →", landing_url(script_name: @import.account.slug), class: "btn btn--link" %>
</div>
<% when "failed" %>
<p class="txt-medium txt-negative">Your import failed.</p>
<% if @import.failed_due_to_conflict? %>
<p class="txt-small">It looks like the account you are trying to import already exists.</p>
<% elsif @import.failed_due_to_invalid_export? %>
<p class="txt-small">The ZIP file isn't a Fizzy account export.</p>
<% else %>
<p class="txt-small">This may be due to corrupted export data or a conflict with existing data. Please try again with a fresh export.</p>
<% end %>
<%= link_to "Try again", new_account_import_path, class: "btn btn--plain center txt-medium" %>
<div class="import-status import-status--error">
<div><strong>Import failed</strong></div>
<% if @import.failed_due_to_conflict? %>
<div>The account youre trying to import already exists. Make sure youre importing a <%= Fizzy.saas? ? "self-hosted" : "fizzy.do" %> account.</div>
<% elsif @import.failed_due_to_invalid_export? %>
<div>The .zip file you uploaded doesnt look like a Fizzy account export.</div>
<% else %>
<div>This may be due to corrupted export data or a conflict with existing data. Please try again with a fresh export.</div>
<% end %>
<%= link_to "Try again", new_account_import_path, class: "btn" %>
</div>
<% end %>
</div>