Skip to content

Commit

Permalink
feat: improved sign up/getting started workflow (resolves #2142) (#2184)
Browse files Browse the repository at this point in the history
* fix: prompt doesn't dismiss when action followed

* feat: add link to rewatch introduction video

* refactor: move prompts from getting started to dashboard

* feat: new getting started flow for Individuals

Work in progress, still missing tests, updates to interpretation files, and etc.

* feat: consolidate application form

* feat: update interpretation placeholder and seeder

* chore(localization): run localization

* style: fix trailing comma in json file

* test: update tests

* test: add test for individual getting started flow

fix: prompt doesn't dismiss when action followed
feat: add link to rewatch introduction video
feat: consolidate application form
  • Loading branch information
jobara authored Apr 15, 2024
1 parent c6010e2 commit 65dc0dc
Show file tree
Hide file tree
Showing 22 changed files with 639 additions and 272 deletions.
16 changes: 3 additions & 13 deletions app/Filament/Pages/ManageGeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,13 @@ public function form(Form $form): Form
->label(get_language_exonym('fr'))
->activeUrl(),
]),
Fieldset::make(__('Accessibility consultant application'))
Fieldset::make(__('Accessibility Consultant and Community Connector application'))
->schema([
TextInput::make('ac_application.en')
TextInput::make('ac_cc_application.en')
->label(get_language_exonym('en'))
->required()
->activeUrl(),
TextInput::make('ac_application.fr')
->label(get_language_exonym('fr'))
->activeUrl(),
]),
Fieldset::make(__('Community connector application'))
->schema([
TextInput::make('cc_application.en')
->label(get_language_exonym('en'))
->required()
->activeUrl(),
TextInput::make('cc_application.fr')
TextInput::make('ac_cc_application.fr')
->label(get_language_exonym('fr'))
->activeUrl(),
]),
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function showIntroduction(): View
$user = Auth::user();

$skipTo = match ($user->context) {
'individual' => localized_route('individuals.show-role-selection'),
'individual' => localized_route('dashboard'),
'organization' => $user->extra_attributes->get('invitation') ? localized_route('dashboard') : localized_route('organizations.show-type-selection'),
'regulated-organization' => $user->extra_attributes->get('invitation') ? localized_route('dashboard') : localized_route('regulated-organizations.show-type-selection'),
default => localized_route('dashboard'),
Expand All @@ -76,7 +76,7 @@ public function updateIntroductionStatus(UpdateUserIntroductionStatusRequest $re
$user->save();

$redirectTo = match (Auth::user()->context) {
'individual' => localized_route('individuals.show-role-selection'),
'individual' => localized_route('dashboard'),
'organization' => $user->extra_attributes->get('invitation') ? localized_route('dashboard') : localized_route('organizations.show-type-selection'),
'regulated-organization' => $user->extra_attributes->get('invitation') ? localized_route('dashboard') : localized_route('regulated-organizations.show-type-selection'),
default => localized_route('dashboard'),
Expand Down
4 changes: 0 additions & 4 deletions app/Http/Middleware/RedirectForOnboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ public function handle(Request $request, Closure $next): Response|RedirectRespon
{
$user = Auth::user();

if ($user->context === 'individual' && empty($user->individual->roles)) {
return redirect(localized_route('individuals.show-role-selection'));
}

if ($user->context === 'regulated-organization' && ! $user->regulatedOrganization && $user->extra_attributes->get('invitation')) {
return $next($request);
}
Expand Down
4 changes: 4 additions & 0 deletions app/Models/Individual.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ public function isReady(): bool
return false;
}

if (empty($this->roles)) {
return false;
}

if ($this->isParticipant() && $this->paymentTypes()->count() === 0 && blank($this->other_payment_type)) {
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions app/Settings/GeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ class GeneralSettings extends Settings

public array $fro_orientation;

public array $ac_application;

public array $cc_application;
public array $ac_cc_application;

public static function group(): string
{
Expand Down
71 changes: 51 additions & 20 deletions database/seeders/data/Interpretations.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,22 @@
"name": "Getting started",
"namespace": "getting_started"
},
{
"name": "Getting started",
"namespace": "getting_started-individual"
},
{
"name": "Current step",
"namespace": "getting_started"
},
{
"name": "Next steps",
"namespace": "getting_started"
},
{
"name": "Completed steps",
"namespace": "getting_started"
},
{
"name": "Customize this website’s accessibility",
"namespace": "getting_started-customize"
Expand All @@ -817,42 +833,57 @@
"namespace": "getting_started-invite_to_regulated_org"
},
{
"name": "Create a public page",
"namespace": "getting_started-individual",
"video": {
"asl": "https://vimeo.com/884468647/1b8077baf2"
}
"name": "Sign up and attend an orientation session",
"namespace": "getting_started-individual"
},
{
"name": "Enter your collaboration preferences",
"namespace": "getting_started-individual",
"name": "Sign up and attend an orientation session",
"namespace": "getting_started-individual-link"
},
{
"name": "Pick your role",
"namespace": "getting_started-individual"
},
{
"name": "Pick your role",
"namespace": "getting_started-individual-link"
},
{
"name": "This will show up once you pick your role.",
"namespace": "getting_started-individual"
},
{
"name": "Fill in your collaboration preferences",
"namespace": "getting_started-individual"
},
{
"name": "Fill in your collaboration preferences",
"namespace": "getting_started-individual-link",
"video": {
"asl": "https://vimeo.com/884468663/f81a471eee"
}
},
{
"name": "Sign up and attend an orientation session",
"namespace": "getting_started-individual",
"video": {
"asl": "https://vimeo.com/884468690/f0d7ff4d4a"
}
"name": "There are no next steps. After this you’ll be able to sign up for engagements!",
"namespace": "getting_started-individual"
},
{
"name": "I’ve gone to orientation, why isn’t this updated?",
"name": "Fill out and return your application",
"namespace": "getting_started-individual"
},
{
"name": "Fill out and return your application",
"namespace": "getting_started-individual",
"video": {
"asl": "https://vimeo.com/884468747/8d64e76e0e"
}
"namespace": "getting_started-individual-link"
},
{
"name": "Review and publish your public page",
"namespace": "getting_started-individual",
"name": "Create a public page",
"namespace": "getting_started-individual"
},
{
"name": "Create a public page",
"namespace": "getting_started-individual-link",
"video": {
"asl": "https://vimeo.com/884468760/2bc6aad695"
"asl": "https://vimeo.com/884468647/1b8077baf2"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
public function up(): void
{
$this->migrator->delete('general.ac_application');
$this->migrator->delete('general.cc_application');
$this->migrator->add('general.ac_cc_application', [
'en' => 'https://share.hsforms.com/1UZjxoUCFRJmcnK8ULsPowwdfpez',
'fr' => 'https://share.hsforms.com/1M0wCcgQwSQ27eBra_asFxwdfpez',
]);
}
};
2 changes: 1 addition & 1 deletion resources/css/_tokens.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 2024-03-04.
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 4/11/2024.
Tokens location: ./tailwind.config.js */
:root {
--space-0: 0;
Expand Down
22 changes: 22 additions & 0 deletions resources/css/components/_getting-started.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,25 @@ main .getting-started.box {
[data-theme="dark"] .getting-started .icon--green {
color: var(--color-green-2);
}

.getting-started .current-task__action {
font-size: var(--text-xl);
font-size: var(--text-fluid-lg);
font-weight: var(--font-normal);
}

.getting-started__task-list {
color: var(--fg, var(--color-graphite-8));
}

[data-theme="dark"] .getting-started__task-list {
color: var(--color-grey-1);
}

.getting-started__task-list li:not(:first-of-type) > :first-child::before {
border-block-start: var(--border) solid currentcolor;
content: "";
display: block;
margin-block-end: calc(var(--space, 1em) - 0.5em);
width: 100%;
}
Loading

0 comments on commit 65dc0dc

Please sign in to comment.