Skip to content
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

Fb fundraisers #3272

Draft
wants to merge 94 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
8ee337a
apply types
ap-justin Oct 25, 2024
63fe8c0
Disable tracking in `/donate-widget` (#3163)
ap-justin Jul 19, 2024
77efbbc
Auth redirect (#3165)
ap-justin Jul 23, 2024
46efb3e
Email bugs (#3184)
ap-justin Jul 25, 2024
ffe28a1
Chariot prod key requirements (#3198)
ap-justin Aug 3, 2024
6874289
BG-1511: Fix Oauth stuck on /auth-redirector (#3204)
ap-justin Aug 5, 2024
fdd8b4f
Cherry fixes (#3219)
ap-justin Aug 8, 2024
f129612
Auth redirect (#3165)
ap-justin Jul 23, 2024
20801e7
Fund opt in setting (#3182)
ap-justin Jul 25, 2024
97cd92d
Create fund UI Iteration 1 (#3185)
ap-justin Jul 31, 2024
16dfc52
List funds (#3192)
ap-justin Jul 31, 2024
6198e11
Add fundraise target (#3194)
ap-justin Jul 31, 2024
f2b8a18
Rc v2.5 update (#3220)
ap-justin Aug 8, 2024
8cc4e4a
Fund editor, fund profile (#3196)
ap-justin Aug 12, 2024
d6aa492
Chariot prod key requirements (#3198)
ap-justin Aug 3, 2024
bca234e
lint fix
ap-justin Aug 12, 2024
f9567f2
revert linkedin
ap-justin Sep 2, 2024
34eafd4
update icons
ap-justin Sep 4, 2024
40647c3
Disable tracking in `/donate-widget` (#3163)
ap-justin Jul 19, 2024
9322f45
Auth redirect (#3165)
ap-justin Jul 23, 2024
cb20207
Email bugs (#3184)
ap-justin Jul 25, 2024
3873407
Chariot prod key requirements (#3198)
ap-justin Aug 3, 2024
e802b3a
BG-1511: Fix Oauth stuck on /auth-redirector (#3204)
ap-justin Aug 5, 2024
86a2680
Cherry fixes (#3219)
ap-justin Aug 8, 2024
715a9e7
Auth redirect (#3165)
ap-justin Jul 23, 2024
d320f0f
Create fund UI Iteration 1 (#3185)
ap-justin Jul 31, 2024
b804d14
List funds (#3192)
ap-justin Jul 31, 2024
51b5031
Add fundraise target (#3194)
ap-justin Jul 31, 2024
dd78961
Rc v2.5 update (#3220)
ap-justin Aug 8, 2024
562a542
Fund editor, fund profile (#3196)
ap-justin Aug 12, 2024
8c4b371
Chariot prod key requirements (#3198)
ap-justin Aug 3, 2024
3f556ab
Create fund UI Iteration 1 (#3185)
ap-justin Jul 31, 2024
ffd835d
Fund editor, fund profile (#3196)
ap-justin Aug 12, 2024
dfb0781
npo funds page
ap-justin Aug 12, 2024
e2f6129
expiration in active status
ap-justin Aug 12, 2024
fba99b2
remove extra index.ts file
ap-justin Sep 2, 2024
197d49b
linkedin tracking
ap-justin Sep 2, 2024
9b72cf7
remove duplicate
ap-justin Sep 14, 2024
066c530
updated
ap-justin Oct 3, 2024
e3730cc
convert to valibot
ap-justin Oct 4, 2024
9be268b
fix file and date schema
ap-justin Oct 5, 2024
73731a2
use fundraiser lib
ap-justin Oct 5, 2024
3c6bd83
params input str
ap-justin Oct 5, 2024
1e40091
dummy file obj
ap-justin Oct 5, 2024
ec8bc2b
endow actions
ap-justin Oct 6, 2024
078ebf5
npo actions
ap-justin Oct 6, 2024
fe09551
approval prompts
ap-justin Oct 6, 2024
28f928e
use subgrid
ap-justin Oct 7, 2024
f642ab4
add padding bottom
ap-justin Oct 7, 2024
05c175d
fundraiser in profile
ap-justin Oct 8, 2024
4e7115b
only show fundraisers if lenght > 0
ap-justin Oct 8, 2024
5229ec3
add back missing fundraiser opt in
ap-justin Oct 8, 2024
6e85a08
fix type error
ap-justin Oct 8, 2024
7a3714b
apply 10 member limit
ap-justin Oct 8, 2024
2d8808a
fund opt in verbiage
ap-justin Oct 8, 2024
eed1ad4
update fundraiser lib
ap-justin Oct 25, 2024
4b01359
to imperative
ap-justin Oct 25, 2024
ef637ec
fund donate page
ap-justin Oct 27, 2024
89d5830
icon fixes
ap-justin Oct 28, 2024
7fadc52
Merge branch 'master' into FB-fundraisers
ap-justin Nov 14, 2024
db44e3b
Merge branch 'master' into FB-fundraisers
ap-justin Nov 18, 2024
851566f
desc rich text
ap-justin Nov 18, 2024
b629cb5
rich text edit desc
ap-justin Nov 18, 2024
bd60d1d
remove settings from form
ap-justin Nov 19, 2024
69dfad2
Merge branch 'master' into FB-fundraisers
ap-justin Nov 19, 2024
82d9ef4
rich text donate and prfoile page
ap-justin Nov 19, 2024
d4be11b
card not rich text
ap-justin Nov 19, 2024
c16ecb4
Merge branch 'master' into FB-fundraisers
ap-justin Nov 21, 2024
84c7f0d
fundraiser link
ap-justin Nov 21, 2024
11be86d
fund members
ap-justin Nov 21, 2024
d529d53
fund members
ap-justin Nov 22, 2024
16edc78
layout
ap-justin Nov 22, 2024
8ca0d24
new layout
ap-justin Nov 22, 2024
502b5dd
donate fund progress bar
ap-justin Nov 22, 2024
07fe402
Merge branch 'master' into FB-fundraisers
ap-justin Nov 24, 2024
3241d60
reuse target
ap-justin Nov 24, 2024
1bcb09b
simpler skeleton
ap-justin Nov 24, 2024
a560165
content
ap-justin Nov 24, 2024
134f1b5
videos in create fund
ap-justin Nov 25, 2024
f2779f4
videos edit
ap-justin Nov 25, 2024
5fff6b5
edit fund payload
ap-justin Nov 25, 2024
e580dbf
videos
ap-justin Nov 25, 2024
5f01236
donate section
ap-justin Nov 25, 2024
e90ee42
create links
ap-justin Nov 25, 2024
1c8fc65
remove create npo
ap-justin Nov 25, 2024
fdd7226
npo list verbiage
ap-justin Nov 25, 2024
e934617
loading text
ap-justin Nov 25, 2024
95fe382
profile fundraiser progress bar
ap-justin Nov 26, 2024
bea2799
back link
ap-justin Nov 26, 2024
565c00a
subgrid cards
ap-justin Nov 26, 2024
3ba668a
disable donate when closed
ap-justin Nov 26, 2024
c66d55f
fund card user banner and logo
ap-justin Nov 26, 2024
7222d96
fund profile banner
ap-justin Nov 27, 2024
a4c50d9
search placeholder text
ap-justin Nov 27, 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
},
"dependencies": {
"@better-giving/assets": "1.0.18",
"@better-giving/donation": "1.0.1",
"@better-giving/endowment": "1.0.29",
"@better-giving/fundraiser": "1.0.5",
"@better-giving/registration": "1.0.24",
"@better-giving/schemas": "1.0.1",
"@better-giving/types": "1.0.1",
Expand All @@ -58,7 +60,6 @@
"nprogress": "0.2.0",
"qrcode.react": "3.1.0",
"quill": "2.0.2",
"quill-delta": "5.1.0",
"react": "18.2.0",
"react-chariot-connect": "1.0.8",
"react-csv": "2.2.2",
Expand Down
6 changes: 6 additions & 0 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useScrollTop from "hooks/useScrollTop";
import NProgress from "nprogress";
import { adminRoute } from "pages/Admin";
import { routes as blogRoutes } from "pages/Blog";
import { fundsRoute } from "pages/Funds";
import { legalRoutes } from "pages/Legal";
import OAuthRedirector from "pages/OAuthRedirector";
import { profileRoute } from "pages/Profile";
Expand Down Expand Up @@ -39,6 +40,7 @@ const widgetRoutes: RO[] = [
const _appRoutes: RO[] = [
adminRoute,
regRoute,
fundsRoute,
userDashboardRoute,
...blogRoutes,
...legalRoutes,
Expand Down Expand Up @@ -93,6 +95,10 @@ const _appRoutes: RO[] = [

const rootRoutes: RO[] = [
{ path: `${appRoutes.donate}/:id`, lazy: () => import("pages/Donate") },
{
path: `${appRoutes.donate_fund}/:id`,
lazy: () => import("pages/donate-fund"),
},
//outlet-value: isInWidget/widgetVersion
{ element: <Layout />, children: _appRoutes },
{
Expand Down
13 changes: 5 additions & 8 deletions src/App/Header/UserMenu/EndowmentLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,25 @@ export function BookmarkLink({ endowId }: IBookmarkLink) {
error: <_Link id={endowId} route="profile" />,
}}
>
{(endow) => <_Link {...endow} id={endowId} route="profile" />}
{(endow) => <_Link {...endow} id={endowId} route={appRoutes.profile} />}
</QueryLoader>
);
}

export function EndowmentLink({ endowID, logo, name }: UserEndow) {
return <_Link id={endowID} logo={logo} name={name} route="admin" />;
return <_Link id={endowID} logo={logo} name={name} route={appRoutes.admin} />;
}

type LinkProps = {
id: number;
id: number | string;
name?: string;
logo?: string;
route: "admin" | "profile";
route: string;
};
const _Link = (props: LinkProps) => (
<MenuItem
as={Link}
to={
(props.route === "admin" ? appRoutes.admin : appRoutes.marketplace) +
`/${props.id}`
}
to={props.route + `/${props.id}`}
className="hover:text-blue-d1 text-sm flex items-center gap-2"
>
<Image src={props.logo} className="object-cover h-[20px] w-[20px]" />
Expand Down
5 changes: 5 additions & 0 deletions src/App/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const HEADER_LINKS: Link[] = [
href: appRoutes.marketplace,
end: true,
},
{
title: "Fundraisers",
href: appRoutes.funds,
end: true,
},
{
title: "Blog",
href: appRoutes.blog,
Expand Down
17 changes: 14 additions & 3 deletions src/components/RichText/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import Delta from "quill-delta";
import Quill, { Delta } from "quill/core";
import type { RichTextContent } from "types/components";

const quill = new Quill(document.createElement("div"));

export const parseContent = (content?: string): RichTextContent => {
if (!content) return { length: 0, value: "" };
try {
const ops = JSON.parse(content);
const delta = new Delta(ops);
return { value: content, length: delta.length() - 1 };
} catch (_) {
return { length: 0, value: "" };
return { length: content.length, value: content };
}
};

export const toDelta = (content: RichTextContent): Delta => {
try {
return new Delta(JSON.parse(content.value));
} catch (_) {
return new Delta();
return new Delta([{ insert: content.value }]);
}
};

export const toText = (content: RichTextContent): string => {
try {
quill.setContents(toDelta(content));
return quill.getText();
} catch (_) {
return content.value;
}
};
2 changes: 1 addition & 1 deletion src/components/RichText/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./RichTextEditor";
export { parseContent } from "./helpers";
export { parseContent, toDelta, toText } from "./helpers";
export { RichText } from "./RichText";
2 changes: 1 addition & 1 deletion src/components/VerifiedIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function VerifiedIcon({ size, classes = "" }: Props) {
return (
<Tooltip
tip={
<Content className="bg-navy-d4 text-white px-4 py-2 rounded text-sm shadow-md">
<Content className="bg-navy-d4 text-white px-4 py-2 rounded text-sm shadow-md z-10">
Verified
<Arrow className="fill-navy-d4" />
</Content>
Expand Down
10 changes: 5 additions & 5 deletions src/components/donation/Steps/DonateMethods/Crypto/Form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Crypto form: initial load", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};

Expand All @@ -43,7 +43,7 @@ describe("Crypto form: initial load", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "", progDonationsAllowed: false },
recipient: { id: "0", name: "", progDonationsAllowed: false },
mode: "live",
};

Expand All @@ -62,7 +62,7 @@ describe("Crypto form: initial load", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};

Expand Down Expand Up @@ -96,7 +96,7 @@ describe("Crypto form: initial load", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};

Expand All @@ -120,7 +120,7 @@ describe("Crypto form: initial load", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Form(props: CryptoFormStep) {
{(props.init.recipient.progDonationsAllowed ?? true) && (
<ProgramSelector
classes="my-2"
endowId={props.init.recipient.id}
endowId={+props.init.recipient.id}
program={program.value}
onChange={program.onChange}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/components/donation/Steps/DonateMethods/Daf/Form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("DAF form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};

Expand All @@ -39,7 +39,7 @@ describe("DAF form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "", progDonationsAllowed: false },
recipient: { id: "0", name: "", progDonationsAllowed: false },
mode: "live",
};
render(<_Form init={init} step="donate-form" />);
Expand All @@ -53,7 +53,7 @@ describe("DAF form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};
const details: DafDonationDetails = {
Expand All @@ -75,7 +75,7 @@ describe("DAF form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "", progDonationsAllowed: false },
recipient: { id: "0", name: "", progDonationsAllowed: false },
mode: "live",
};
render(<_Form init={init} step="donate-form" />);
Expand Down
2 changes: 1 addition & 1 deletion src/components/donation/Steps/DonateMethods/Daf/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Form(props: Props) {

{(props.init.recipient.progDonationsAllowed ?? true) && (
<ProgramSelector
endowId={props.init.recipient.id}
endowId={+props.init.recipient.id}
program={rhf.program.value}
onChange={rhf.program.onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("stocks form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};
render(<_Form init={init} step="donate-form" />);
Expand All @@ -42,7 +42,7 @@ describe("stocks form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "", progDonationsAllowed: false },
recipient: { id: "0", name: "", progDonationsAllowed: false },
mode: "live",
};
render(<_Form init={init} step="donate-form" />);
Expand All @@ -55,7 +55,7 @@ describe("stocks form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "" },
recipient: { id: "0", name: "" },
mode: "live",
};
const details: StocksDonationDetails = {
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("stocks form test", () => {
const init: Init = {
source: "bg-marketplace",
config: null,
recipient: { id: 0, name: "", progDonationsAllowed: false },
recipient: { id: "0", name: "", progDonationsAllowed: false },
mode: "live",
};
render(<_Form init={init} step="donate-form" />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function Form(props: StockFormStep) {
{(props.init.recipient.progDonationsAllowed ?? true) && (
<ProgramSelector
classes="mt-6 mb-4"
endowId={props.init.recipient.id}
endowId={+props.init.recipient.id}
program={program.value}
onChange={program.onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const init: Init = {
source: "bg-marketplace",
mode: "live",
recipient: {
id: 123456,
id: "123456",
name: "Example Endowment",
},
config: null,
Expand Down Expand Up @@ -93,7 +93,7 @@ describe("Stripe form test", () => {
source: "bg-marketplace",
mode: "live",
recipient: {
id: 123456,
id: "123456",
name: "Example Endowment",
progDonationsAllowed: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function Form({ currencies, defaultCurr, ...props }: FormProps) {
{(props.init.recipient.progDonationsAllowed ?? true) && (
<ProgramSelector
classes="mt-4"
endowId={props.init.recipient.id}
endowId={+props.init.recipient.id}
program={rhf.program.value}
onChange={rhf.program.onChange}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/components/donation/Steps/Steps.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("donation flow", () => {
const state: DonationState = {
step: "donate-form",
init: {
recipient: { id: 1, name: "test" },
recipient: { id: "1", name: "test" },
source: "bg-marketplace",
mode: "live",
config: null,
Expand Down Expand Up @@ -53,7 +53,7 @@ describe("donation flow", () => {
const state: DonationState = {
step: "donate-form",
init: {
recipient: { id: 1, name: "test", hide_bg_tip: true },
recipient: { id: "1", name: "test", hide_bg_tip: true },
source: "bg-marketplace",
mode: "live",
config: null,
Expand Down Expand Up @@ -86,7 +86,7 @@ describe("donation flow", () => {
const state: DonationState = {
step: "tip",
init: {
recipient: { id: 1, name: "test" },
recipient: { id: "1", name: "test" },
source: "bg-marketplace",
mode: "live",
config: null,
Expand Down Expand Up @@ -129,7 +129,7 @@ describe("donation flow", () => {
const state: DonationState = {
step: "tip",
init: {
recipient: { id: 1, name: "test" },
recipient: { id: "1", name: "test" },
source: "bg-marketplace",
mode: "live",
config: null,
Expand Down
Loading