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

debt: Remove some OCF legacy #10481

Merged
merged 1 commit into from
Nov 22, 2024
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
25 changes: 0 additions & 25 deletions scripts/compile-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,6 @@ data['report.platform'] = {
hostCurrency: 'USD',
collectives: 1171,
},
{
host: 'foundation',
currency: 'USD',
HostCollectiveId: 11049,
backers: 54,
activeCollectives: 16,
totalRevenue: 826084,
hostFees: 39252,
platformFeesPaypal: 0,
platformFeesStripe: 24380,
platformFeesManual: 14947,
platformFeesDue: 14947,
platformFees: 39327,
hostCurrency: 'USD',
collectives: 55,
},
{
host: 'faly',
currency: 'CHF',
Expand Down Expand Up @@ -497,15 +481,6 @@ data['collective.member.created'] = {
},
},
};
data['collective.apply.foundation'] = {
collective: {
name: 'TheCollective',
},
host: {
slug: 'foundation',
name: 'foundation',
},
};

const defaultData = {
config: {
Expand Down
58 changes: 0 additions & 58 deletions scripts/ocf/freeze-collectives.ts

This file was deleted.

10 changes: 2 additions & 8 deletions server/lib/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,7 @@ const generateEmailFromTemplate = (
}

if (template === 'collective.approved') {
if (['foundation', 'the-social-change-nest'].includes(hostSlug)) {
template = `${template}.${hostSlug}`;
}
}

if (template === 'collective.apply') {
if (hostSlug === 'foundation') {
if (['the-social-change-nest'].includes(hostSlug)) {
template = `${template}.${hostSlug}`;
}
}
Expand All @@ -332,7 +326,7 @@ const generateEmailFromTemplate = (
if (template === activities.ORDER_THANKYOU) {
if (slug.match(/wwcode/)) {
template = `${activities.ORDER_THANKYOU}.wwcode`;
} else if (['foundation', 'opensource'].includes(hostSlug)) {
} else if (['opensource'].includes(hostSlug)) {
template = `${activities.ORDER_THANKYOU}.${hostSlug}`;
} else if (includes(['laprimaire', 'lesbarbares', 'enmarchebe', 'monnaie-libre'], slug)) {
template = `${activities.ORDER_THANKYOU}.fr`;
Expand Down
7 changes: 0 additions & 7 deletions server/lib/emailTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ export const templateNames = [
'order.canceled.archived.collective',
'github.signup',
'collective.apply',
'collective.apply.foundation',
'collective.apply.for.host',
'collective.approved',
'collective.approved.foundation',
'collective.approved.the-social-change-nest',
'collective.rejected',
'collective.comment.created',
Expand Down Expand Up @@ -59,19 +57,15 @@ export const templateNames = [
'event.reminder.1d',
'event.reminder.7d',
'expense-accounting-category-educational',
'fund.created.foundation',
'fund.approved.foundation',
'host.application.contact',
'host.application.comment.created',
'host.report',
'member.invitation',
'oauth.application.authorized',
'onboarding.day2',
'onboarding.day2.foundation',
'onboarding.day2.opensource',
'onboarding.day2.organization',
'onboarding.day3',
'onboarding.day3.foundation',
'onboarding.day3.opensource',
'onboarding.noExpenses',
'onboarding.noExpenses.opensource',
Expand Down Expand Up @@ -107,7 +101,6 @@ export const templateNames = [
'order.thankyou',
'order.thankyou.wwcode',
'order.thankyou.fr',
'order.thankyou.foundation',
'order.thankyou.opensource',
'user.card.claimed',
'user.card.invited',
Expand Down
21 changes: 0 additions & 21 deletions server/lib/notifications/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,16 +525,6 @@ export const notifyByEmail = async (activity: Activity) => {
break;

case ActivityTypes.COLLECTIVE_APPROVED:
// Funds MVP
if (get(activity, 'data.collective.type') === 'FUND' || get(activity, 'data.collective.settings.fund') === true) {
if (get(activity, 'data.host.slug') === 'foundation') {
await notify.collective(activity, {
collectiveId: activity.CollectiveId,
template: 'fund.approved.foundation',
});
}
break;
}
await notify.collective(activity, {
collectiveId: activity.CollectiveId,
replyTo: activity.data.host.data?.replyToEmail || undefined,
Expand Down Expand Up @@ -590,17 +580,6 @@ export const notifyByEmail = async (activity: Activity) => {
break;

case ActivityTypes.COLLECTIVE_CREATED:
// Funds MVP
if (get(activity, 'data.collective.type') === 'FUND' || get(activity, 'data.collective.settings.fund') === true) {
if (get(activity, 'data.host.slug') === 'foundation') {
await notify.collective(activity, {
collectiveId: activity.CollectiveId,
template: 'fund.created.foundation',
});
}
break;
}

// Disable for the-social-change-nest
if (get(activity, 'data.host.slug') === 'the-social-change-nest') {
break;
Expand Down
5 changes: 0 additions & 5 deletions server/lib/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ async function processCollective(collective, template) {
template = `${template}.opensource`;
}

const host = await collective.getHostCollective();
if (host && host.slug === 'foundation' && templateNames.includes(`${template}.foundation`)) {
template = `${template}.foundation`;
}

// if the collective created is an ORGANIZATION, we only send an onboarding email if there is one specific to organizations
if (collective.type === 'ORGANIZATION') {
const orgTemplate = `${template}.${collective.type.toLowerCase()}`;
Expand Down
1 change: 0 additions & 1 deletion server/lib/sanitize-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ const isTrustedLinkUrl = (url: string): boolean => {
const trustedDomains = [
new RegExp(`^(.+\\.)?${config.host.website.replace(/^https?:\/\//, '')}$`),
/^(.+\.)?opencollective.com$/,
/^(.+\.)?opencollective.foundation$/,
/^(.+\.)?oscollective.org$/,
/^(.+\.)?github.com$/,
/^(.+\.)?meetup.com$/,
Expand Down
17 changes: 0 additions & 17 deletions templates/emails/collective.apply.foundation.hbs

This file was deleted.

30 changes: 0 additions & 30 deletions templates/emails/collective.approved.foundation.hbs

This file was deleted.

23 changes: 0 additions & 23 deletions templates/emails/fund.approved.foundation.hbs

This file was deleted.

21 changes: 0 additions & 21 deletions templates/emails/fund.created.foundation.hbs

This file was deleted.

32 changes: 0 additions & 32 deletions templates/emails/onboarding.day2.foundation.hbs

This file was deleted.

33 changes: 0 additions & 33 deletions templates/emails/onboarding.day3.foundation.hbs

This file was deleted.

Loading
Loading