Skip to content

Commit

Permalink
[featuer] New onboarding flow
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Apr 29, 2024
1 parent cb95173 commit 8d5e47f
Show file tree
Hide file tree
Showing 20 changed files with 446 additions and 79 deletions.
20 changes: 19 additions & 1 deletion app/Domain/Auth/Controllers/UserInvite.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,31 @@ public function post(array $params): Response
return FrontcontrollerCore::redirect(BASE_URL . "/auth/userInvite/" . $invitationId . "?step=3");
}

if (isset($_POST["function"]) && isset($_POST["step"]) && $_POST["step"] == 3) {
if (isset($_POST["impact"]) && isset($_POST["step"]) && $_POST["step"] == 3) {
$userInvite = $this->authService->getUserByInviteLink($invitationId);

$challenge = $_POST["impact"];

$this->settingService->saveSetting("usersettings." . $userInvite['id'] . ".impact", $challenge);

return FrontcontrollerCore::redirect(BASE_URL . "/auth/userInvite/" . $invitationId . "?step=4");
}

if (isset($_POST["function"]) && isset($_POST["step"]) && $_POST["step"] == 4) {

$userInvite = $this->authService->getUserByInviteLink($invitationId);

$function = $_POST["function"];

$this->settingService->saveSetting("usersettings." . $userInvite['id'] . ".function", $function);

return FrontcontrollerCore::redirect(BASE_URL . "/auth/userInvite/" . $invitationId . "?step=5");
}

if (isset($_POST["complete"]) && isset($_POST["step"]) && $_POST["step"] == 5) {

$userInvite = $this->authService->getUserByInviteLink($invitationId);

$userInvite["status"] = "A";
$userInvite["password"] = "";
$userInvite["user"] = $userInvite["username"];
Expand Down
25 changes: 16 additions & 9 deletions app/Domain/Auth/Templates/userInvite.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class="progress-bar progress-bar-success tx-transition"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
style="width: 15%"
><span class="sr-only">30%</span></div>
style="width: 12%"
><span class="sr-only">12%</span></div>
</div>


<div class="step current" style="left: 15%;">
<div class="step current" style="left: 12%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -29,7 +29,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 50%;">
<div class="step " style="left: 37%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -39,7 +39,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 85%;">
<div class="step " style="left: 62%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -49,25 +49,32 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 88%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
<i class="fa-regular fa-circle"></i>
Step 4
</span>
</a>
</div>

</div>
</div>
<br /><br /><br />


<h2 style="font-size:var(--font-size-xxl);"><?php echo $tpl->language->__("headlines.your_account"); ?></h2>
<h2><?php echo $tpl->language->__("headlines.set_up_your_account"); ?></h2>

<?php $tpl->dispatchTplEvent('afterPageHeaderClose'); ?>
<div class="regcontent">
<?php $tpl->dispatchTplEvent('afterRegcontentOpen'); ?>


<form id="resetPassword" action="" method="post">
<?php $tpl->dispatchTplEvent('afterFormOpen'); ?>

<?php echo $tpl->displayInlineNotification(); ?>

<p><?php echo $tpl->language->__("text.welcome_to_leantime_2"); ?><br /><br /></p>

<input type="hidden" name="step" value="1"/>

<div class="">
Expand Down
35 changes: 22 additions & 13 deletions app/Domain/Auth/Templates/userInvite2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class="progress-bar progress-bar-success tx-transition"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
style="width: 50%"
style="width: 37%"
><span class="sr-only">50%</span></div>
</div>


<div class="step complete" style="left: 15%;">
<div class="step complete" style="left: 12%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -26,7 +26,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step current" style="left: 50%;">
<div class="step current" style="left: 37%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -35,7 +35,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 85%;">
<div class="step " style="left: 62%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -44,12 +44,21 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 88%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
<i class="fa-regular fa-circle"></i> Step 4
</span>
</a>
</div>

</div>
</div>
<br /><br /><br />


<h2 style="font-size:var(--font-size-xxl);">🩺 Where does it hurt? </h2>
<h2>{{ __("text.point_to_where_it_hurts") }}</h2>


<div class="regcontent">
Expand All @@ -59,33 +68,33 @@ class="progress-bar progress-bar-success tx-transition"

{{ $tpl->displayInlineNotification() }}

<p>Tell us about your main challenge rightnow<br /><br /></p>
<p>{{ __("text.challenges_brings_you_here") }}<br /><br /></p>


<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'organization'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">🤯</span> I have too many things to manage and organize
<span class="emoji">🤯</span> I have too many things to manage and organize
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'progress'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">📉</span> I don't feel like I'm making progress
<span class="emoji">📉</span> I don't feel like I'm making progress
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'adoption'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl"> 👥</span> I need a tool that my team will actually use
<span class="emoji"> 👥</span> I need a tool that my team will actually use
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'price'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">💰</span> My current tool is too expensive
<span class="emoji">💰</span> My current tool is too expensive
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'brain'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl"> 🧠</span> The other tools don't organize the way my brain does
<span class="emoji"> 🧠</span> The other tools don't organize the way my brain does
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'challenge'" :value="'collaboration'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl"> 🥸</span> I was just invited to collaborate
<span class="emoji"> 🥸</span> I was just invited to collaborate
</x-global::selectable>

<br /> <br />
<input type="submit" name="createAccount" value="<?php echo $tpl->language->__("buttons.next"); ?>" />


Expand Down
56 changes: 35 additions & 21 deletions app/Domain/Auth/Templates/userInvite3.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ class="progress-bar progress-bar-success tx-transition"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
style="width: 85%"
><span class="sr-only">80%</span></div>
style="width: 62%"
><span class="sr-only">62%</span></div>
</div>

<div class="step complete" style="left: 15%;">

<div class="step complete" style="left: 12%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -25,7 +26,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step complete" style="left: 50%;">
<div class="step complete" style="left: 37%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -34,7 +35,7 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step current" style="left: 85%;">
<div class="step current" style="left: 62%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
Expand All @@ -43,46 +44,59 @@ class="progress-bar progress-bar-success tx-transition"
</a>
</div>

<div class="step " style="left: 88%;">
<a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
<span class="innerCircle"></span>
<span class="title">
<i class="fa-regular fa-circle"></i> Step 4
</span>
</a>
</div>

</div>
</div>
<br /><br /><br />


<h2 style="font-size:var(--font-size-xxl);">🥷 What did you say you do here?</h2>

<h2>Managing work is about more than long To Do lists,<br />
it's about reaching goals and making impact</h2>

<div class="regcontent">

<form id="resetPassword" action="" method="post">

<input type="hidden" name="step" value="3"/>
<input type="hidden" name="step" value="3" />

{{ $tpl->displayInlineNotification() }}

<p>Describe the work you are managing.<br /><br /></p>
<p>
How will your life change if you solve your current challenges?<br /><br /></p>


<x-global::selectable :selected="false" :id="''" :name="'function'" :value="'ic'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">🤓</span> I manage only my own work
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'accomplish'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji">🚀</span> I feel like I get to accomplish something
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'function'" :value="'pm'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">🧙</span> I manage a project for a team and my own work
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'manageable'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji">💪</span> Things will feel manageable
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'function'" :value="'pgm'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl"> 😸</span> I manage multiple projects for several teams
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'teamWork'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji"> 👥</span> My team will work better together
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'function'" :value="'business'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl">♟️</span> I manage a business (unit)
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'safeMoney'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji">💰</span> I will safe money
</x-global::selectable>

<x-global::selectable :selected="false" :id="''" :name="'function'" :value="'no_answer'" :label="''" class="tw-w-full tw-text-left">
<span class="tw-text-2xl"> 🤷</span> Heck, if I knew
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'relateTasks'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji">🎯</span> I will be able to relate my tasks to the goals I have
</x-global::selectable>

<input type="submit" name="createAccount" value="Complete Sign up" />
<x-global::selectable :selected="false" :id="''" :name="'impact'" :value="'justWork'" :label="''" class="tw-w-full tw-text-left">
<span class="emoji"> 🥸</span> I just work here
</x-global::selectable>
<br /> <br />
<input type="submit" name="createAccount" value="<?php echo $tpl->language->__("buttons.next"); ?>" />


</form>
Expand Down
Loading

0 comments on commit 8d5e47f

Please sign in to comment.