Skip to content

Add Dashboard checklist #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/app/Resources/Account/AccountResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ public function toArray(Request $request): array
'currency_code' => $this->getCurrencyCode(),
'timezone' => $this->getTimezone(),
'updated_at' => $this->getUpdatedAt(),
'stripe_connect_setup_complete' => $this->getStripeConnectSetupComplete(),

'is_account_email_confirmed' => $this->getAccountVerifiedAt() !== null,
'is_saas_mode_enabled' => config('app.saas_mode_enabled'),

$this->mergeWhen(config('app.saas_mode_enabled'), [
'stripe_account_id' => $this->getStripeAccountId(),
'stripe_connect_setup_complete' => $this->getStripeConnectSetupComplete(),
]),
$this->mergeWhen($this->getConfiguration() !== null, fn() => [
'configuration' => new AccountConfigurationResource($this->getConfiguration()),
]),
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/layouts/Event/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const EventLayout = () => {
</NavLink>
);
});

const handleStatusToggle = () => {
const message = event?.status === 'LIVE'
? t`Are you sure you want to make this event draft? This will make the event invisible to the public`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {useCreateOrGetStripeConnectDetails} from "../../../../../../queries/useC
import {useGetAccount} from "../../../../../../queries/useGetAccount.ts";
import {LoadingMask} from "../../../../../common/LoadingMask";
import {Anchor, Button, Grid, Group, Text, ThemeIcon, Title} from "@mantine/core";
import {StripeConnectDetails} from "../../../../../../types.ts";
import {Account} from "../../../../../../types.ts";
import paymentClasses from "./PaymentSettings.module.scss";
import classes from "../../ManageAccount.module.scss";
import {useEffect, useState} from "react";
Expand Down Expand Up @@ -79,8 +79,36 @@ const FeePlanDisplay = ({configuration}: FeePlanDisplayProps) => {
);
};

const ConnectStatus = (props: { stripeDetails: StripeConnectDetails }) => {
const ConnectStatus = ({account}: { account: Account }) => {
const [fetchStripeDetails, setFetchStripeDetails] = useState(false);
const [isReturningFromStripe, setIsReturningFromStripe] = useState(false);
const stripeDetailsQuery = useCreateOrGetStripeConnectDetails(
account.id,
!!account?.stripe_account_id || fetchStripeDetails
);

const stripeDetails = stripeDetailsQuery.data;
const error = stripeDetailsQuery.error as any;

if (error?.response?.status === 403) {
return (
<>
<Card className={classes.tabContent}>
<div className={paymentClasses.stripeInfo}>
<Group gap="xs" mb="md">
<ThemeIcon size="lg" radius="md" variant="light">
<IconAlertCircle size={20}/>
</ThemeIcon>
<Title order={2}>{t`Access Denied`}</Title>
</Group>
<Text size="md">
{error?.response?.data?.message}
</Text>
</div>
</Card>
</>
);
}

useEffect(() => {
if (typeof window === 'undefined') {
Expand All @@ -91,11 +119,19 @@ const ConnectStatus = (props: { stripeDetails: StripeConnectDetails }) => {
);
}, []);

useEffect(() => {
if (fetchStripeDetails && !stripeDetailsQuery.isLoading) {
setFetchStripeDetails(false);
window.location.href = String(stripeDetails?.connect_url);
}

}, [fetchStripeDetails, stripeDetailsQuery.isFetched]);

return (
<div className={paymentClasses.stripeInfo}>
<Title mb={10} order={3}>{t`Payment Processing`}</Title>

{props.stripeDetails?.is_connect_setup_complete ? (
{stripeDetails?.is_connect_setup_complete ? (
<>
<Group gap="xs" mb="md">
<ThemeIcon size="sm" variant="light" radius="xl" color="green">
Expand Down Expand Up @@ -145,8 +181,14 @@ const ConnectStatus = (props: { stripeDetails: StripeConnectDetails }) => {
size="sm"
leftSection={<IconBrandStripe size={20}/>}
onClick={() => {
if (typeof window !== 'undefined')
window.location.href = String(props.stripeDetails?.connect_url);
if (!stripeDetails) {
setFetchStripeDetails(true);
return;
} else {
if (typeof window !== 'undefined') {
window.location.href = String(stripeDetails?.connect_url)
}
}
}}
>
{(!isReturningFromStripe) && t`Connect with Stripe`}
Expand Down Expand Up @@ -184,29 +226,6 @@ const ConnectStatus = (props: { stripeDetails: StripeConnectDetails }) => {

const PaymentSettings = () => {
const accountQuery = useGetAccount();
const stripeDetailsQuery = useCreateOrGetStripeConnectDetails(accountQuery.data?.id);
const stripeDetails = stripeDetailsQuery.data;
const error = stripeDetailsQuery.error as any;

if (error?.response?.status === 403) {
return (
<>
<Card className={classes.tabContent}>
<div className={paymentClasses.stripeInfo}>
<Group gap="xs" mb="md">
<ThemeIcon size="lg" radius="md" variant="light">
<IconAlertCircle size={20}/>
</ThemeIcon>
<Title order={2}>{t`Access Denied`}</Title>
</Group>
<Text size="md">
{error?.response?.data?.message}
</Text>
</div>
</Card>
</>
);
}

return (
<>
Expand All @@ -216,10 +235,12 @@ const PaymentSettings = () => {
/>
<Card className={classes.tabContent}>
<LoadingMask/>
{(accountQuery.data?.configuration || stripeDetails) && (
{(accountQuery.data?.configuration) && (
<Grid gutter="xl">
<Grid.Col span={{base: 12, md: 6}}>
{stripeDetails && <ConnectStatus stripeDetails={stripeDetails}/>}
{accountQuery.isFetched && (
<ConnectStatus account={accountQuery.data}/>
)}
</Grid.Col>
<Grid.Col span={{base: 12, md: 6}}>
{accountQuery.data?.configuration && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,148 @@
margin-top: 0;
}
}

.setupCard {
margin-bottom: 20px;
margin-top: 20px;
overflow: hidden;
position: relative;
padding-top: 16px;
}

.dismissButton {
position: absolute;
top: 12px;
right: 12px;
width: 28px;
height: 28px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 10;
color: #757575;
transition: background-color 0.2s;

&:hover {
background-color: rgba(0, 0, 0, 0.05);
color: #303030;
}
}

.setupCardContent {
display: flex;
position: relative;
padding-right: 280px; // Make room for the rocket
}

.checklistContainer {
flex: 1;
padding-right: 20px;

h2 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
margin-top: 0;
color: #303030;
}

.setupDescription {
margin-bottom: 1.5rem;
color: #666;
}
}

.checklistItems {
display: flex;
flex-direction: column;
gap: 1.5rem;
margin-bottom: 1rem;
}

.checklistItem {
display: flex;
align-items: flex-start;
gap: 1rem;

h3 {
font-size: 1.1rem;
margin: 0 0 0.25rem 0;
color: #303030;
}

p {
margin: 0;
color: #666;
font-size: 0.9rem;
}
}

.checkboxContainer {
margin-top: 3px;
}

.checkbox {
width: 22px;
height: 22px;
border-radius: 50%;
border: 2px solid var(--tk-primary);
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s ease;
}

.checklistItemContent {
flex: 1;
}

.rocketImageContainer {
position: absolute;
right: 50px;
top: 75%;
transform: translateY(-50%);
width: 220px;
height: 220px;
display: flex;
align-items: center;
justify-content: center;
}

.rocketImage {
width: 100%;
height: auto;
object-fit: contain;
opacity: 0.9;
filter: hue-rotate(350deg);
}

// Media query for tablets
@media (max-width: 1024px) {
.setupCardContent {
padding-right: 180px;
}

.rocketImageContainer {
width: 160px;
height: 160px;
}
}

// Media query for mobile
@media (max-width: 768px) {
.setupCardContent {
flex-direction: column;
padding-right: 0;
}

.checklistContainer {
width: 100%;
padding-right: 0;
}

.rocketImageContainer {
display: none; // Hide the rocket on mobile
}
}
Loading
Loading