Skip to content

Change plan feedback modal #1393

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 23 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3398dd
Checkbox component can have its label styles
samejr Oct 3, 2024
ac81a9c
Improved the dialog footer
samejr Oct 3, 2024
d8c1872
Handle sending feedback to Slack using Plain
samejr Oct 3, 2024
22efefa
WIP making the modal conditional
samejr Oct 3, 2024
4bae709
Moved the Plain form action into the select plan file
samejr Oct 3, 2024
a0071b9
removed comment
samejr Oct 3, 2024
1d014af
Show a confirmation diaglog if you’re downgrading from Pro to Hobby
samejr Oct 4, 2024
51b437b
Downgrading to Hobby works
samejr Oct 4, 2024
431eafb
Use redirectWithErrorMessage instead of throw error
samejr Oct 6, 2024
fd01de8
The cancel form now submits the data correctly
samejr Oct 8, 2024
049d126
Modals don’t trigger when you upgrade
samejr Oct 8, 2024
ac2c6d7
Copy improvements
samejr Oct 8, 2024
9adffd1
Added a tooltip to explain the link to the pricing page
samejr Oct 8, 2024
b837b5a
Squashed commit of the following:
samejr Oct 8, 2024
c976813
Squashed commit of the following:
samejr Oct 8, 2024
cc9615d
Revert "Squashed commit of the following:"
nicktrn Oct 8, 2024
61cb4a7
Merge remote-tracking branch 'origin/main' into change-plan-feedback-…
nicktrn Oct 8, 2024
5e9f241
Removed console logs
samejr Oct 9, 2024
db7bf32
cleaned up conditionals
samejr Oct 9, 2024
255af74
Unlock free plan state
samejr Oct 9, 2024
0877a70
Fixed subscribe button if you’re already github verified
samejr Oct 10, 2024
300f14a
Simplified the downgrade reasons logic
samejr Oct 10, 2024
64b08db
made periodEnd required
samejr Oct 10, 2024
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
5 changes: 4 additions & 1 deletion apps/webapp/app/components/primitives/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export type CheckboxProps = Omit<
description?: string;
badges?: string[];
className?: string;
labelClassName?: string;
onChange?: (isChecked: boolean) => void;
};

Expand All @@ -78,6 +79,7 @@ export const CheckboxWithLabel = React.forwardRef<HTMLInputElement, CheckboxProp
badges,
disabled,
className,
labelClassName: externalLabelClassName,
...props
},
ref
Expand Down Expand Up @@ -148,7 +150,8 @@ export const CheckboxWithLabel = React.forwardRef<HTMLInputElement, CheckboxProp
htmlFor={id}
className={cn(
props.readOnly || disabled ? "cursor-default" : "cursor-pointer",
labelClassName
labelClassName,
externalLabelClassName
)}
onClick={(e) => e.preventDefault()}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/components/primitives/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DialogHeader.displayName = "DialogHeader";

const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
className={cn("flex flex-col-reverse sm:flex-row sm:justify-between sm:space-x-2", className)}
{...props}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default function ChoosePlanPage() {
subscription={v3Subscription}
organizationSlug={organizationSlug}
hasPromotedPlan={false}
periodEnd={periodEnd}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { z } from "zod";
import { RouteErrorDisplay } from "~/components/ErrorDisplay";
import { MainBody } from "~/components/layout/AppLayout";
import { SideMenu } from "~/components/navigation/SideMenu";
import { featuresForRequest } from "~/features.server";
import { useOptionalOrganization } from "~/hooks/useOrganizations";
import { useTypedMatchesData } from "~/hooks/useTypedMatchData";
import { useUser } from "~/hooks/useUser";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ export async function loader({ params, request }: LoaderFunctionArgs) {

const currentPlan = await getCurrentPlan(organization.id);

return typedjson({ ...plans, ...currentPlan, organizationSlug });
const periodEnd = new Date();
periodEnd.setMonth(periodEnd.getMonth() + 1);

return typedjson({ ...plans, ...currentPlan, organizationSlug, periodEnd });
}

export default function ChoosePlanPage() {
const { plans, v3Subscription, organizationSlug } = useTypedLoaderData<typeof loader>();
const { plans, v3Subscription, organizationSlug, periodEnd } =
useTypedLoaderData<typeof loader>();

return (
<MainCenteredContainer className="flex max-w-[80rem] flex-col items-center gap-8 p-3">
Expand All @@ -52,6 +56,7 @@ export default function ChoosePlanPage() {
organizationSlug={organizationSlug}
hasPromotedPlan
showGithubVerificationBadge
periodEnd={periodEnd}
/>
</MainCenteredContainer>
);
Expand Down
Loading