Skip to content

Commit

Permalink
Merge pull request #355 from lanedirt/350-remove-first-step-from-crea…
Browse files Browse the repository at this point in the history
…te-wizard

Remove first step from create wizard
  • Loading branch information
lanedirt authored Nov 11, 2024
2 parents 46b0d7b + 37bc557 commit 24f6168
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.

This file was deleted.

14 changes: 2 additions & 12 deletions src/AliasVault.Client/Auth/Pages/Setup/Setup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="flex-grow p-6 pt-4 lg:pt-6 pb-28 lg:pb-4">
<div class="flex justify-between items-center mb-4">
<div>
<button @onclick="GoBack" class="text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 @(_currentStep == SetupStep.Welcome ? "invisible" : "")">
<button @onclick="GoBack" class="text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
</svg>
Expand All @@ -35,9 +35,6 @@
<EditForm Model="@_setupData" OnValidSubmit="HandleSubmit">
@switch (_currentStep)
{
case SetupStep.Welcome:
<WelcomeStep />
break;
case SetupStep.TermsAndConditions:
<TermsAndConditionsStep
AgreedToTerms="@_setupData.AgreedToTerms"
Expand Down Expand Up @@ -80,15 +77,14 @@
</div>

@code {
private SetupStep _currentStep = SetupStep.Welcome;
private SetupStep _currentStep = SetupStep.TermsAndConditions;
private readonly SetupData _setupData = new();

/// <summary>
/// Determines if the "Continue" button is enabled based on the current step and setup data.
/// </summary>
private bool IsNextEnabled => _currentStep switch
{
SetupStep.Welcome => true,
SetupStep.TermsAndConditions => _setupData.AgreedToTerms,
SetupStep.Username => !string.IsNullOrWhiteSpace(_setupData.Username),
SetupStep.Password => !string.IsNullOrWhiteSpace(_setupData.Password),
Expand All @@ -104,7 +100,6 @@
{
return step switch
{
SetupStep.Welcome => "Welcome to AliasVault",
SetupStep.TermsAndConditions => "Using AliasVault",
SetupStep.Username => "Choose Username",
SetupStep.Password => "Set Password",
Expand All @@ -130,9 +125,6 @@
{
switch (_currentStep)
{
case SetupStep.TermsAndConditions:
_currentStep = SetupStep.Welcome;
break;
case SetupStep.Username:
_currentStep = SetupStep.TermsAndConditions;
break;
Expand All @@ -152,7 +144,6 @@
{
_currentStep = _currentStep switch
{
SetupStep.Welcome => SetupStep.TermsAndConditions,
SetupStep.TermsAndConditions => SetupStep.Username,
SetupStep.Username => SetupStep.Password,
SetupStep.Password => SetupStep.Creating,
Expand Down Expand Up @@ -186,7 +177,6 @@
/// </summary>
private enum SetupStep
{
Welcome,
TermsAndConditions,
Username,
Password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ public async Task UserSetupProcessTest()
var createVaultButton = await WaitForAndGetElement("a:has-text('Create new vault')");
await createVaultButton.ClickAsync();

// Wait for the setup page to load.
await WaitForUrlAsync("user/setup", "Welcome to AliasVault");

// Press the continue button.
var continueButton = await WaitForAndGetElement("button:has-text('Continue')");
await continueButton.ClickAsync();

// Wait for the terms and conditions to load.
await WaitForUrlAsync("user/setup", "Terms and Conditions");

Expand All @@ -50,7 +43,7 @@ public async Task UserSetupProcessTest()
await Task.Delay(100);

// Press the continue button.
continueButton = await WaitForAndGetElement("button:has-text('Continue')");
var continueButton = await WaitForAndGetElement("button:has-text('Continue')");
await continueButton.ClickAsync();

// Wait for the username step to load.
Expand Down Expand Up @@ -100,13 +93,6 @@ public async Task UserSetupUsernameExistsTest()
var createVaultButton = await WaitForAndGetElement("a:has-text('Create new vault')");
await createVaultButton.ClickAsync();

// Wait for the setup page to load.
await WaitForUrlAsync("user/setup", "Welcome to AliasVault");

// Press the continue button.
var continueButton = await WaitForAndGetElement("button:has-text('Continue')");
await continueButton.ClickAsync();

// Wait for the terms and conditions to load.
await WaitForUrlAsync("user/setup", "Terms and Conditions");

Expand All @@ -118,7 +104,7 @@ public async Task UserSetupUsernameExistsTest()
await Task.Delay(100);

// Press the continue button.
continueButton = await WaitForAndGetElement("button:has-text('Continue')");
var continueButton = await WaitForAndGetElement("button:has-text('Continue')");
await continueButton.ClickAsync();

// Wait for the username step to load.
Expand Down

0 comments on commit 24f6168

Please sign in to comment.