Skip to content

Commit

Permalink
Export Hosted Collectives: Release + add new fields (#10796)
Browse files Browse the repository at this point in the history
* refact: add new fields to ExportHostedCollectives

* chore: update schema and langs

* refact: release ExportHostedCollectivesCSV
  • Loading branch information
kewitz authored Nov 14, 2024
1 parent 38a30a9 commit 4189eae
Show file tree
Hide file tree
Showing 24 changed files with 219 additions and 60 deletions.
29 changes: 12 additions & 17 deletions components/dashboard/sections/collectives/HostedCollectives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import { integer, isMulti } from '../../../../lib/filters/schemas';
import { API_V2_CONTEXT } from '../../../../lib/graphql/helpers';
import type { Collective, HostedCollectivesQueryVariables } from '../../../../lib/graphql/types/v2/graphql';
import { HostFeeStructure } from '../../../../lib/graphql/types/v2/graphql';
import useLoggedInUser from '../../../../lib/hooks/useLoggedInUser';
import useQueryFilter from '../../../../lib/hooks/useQueryFilter';
import formatCollectiveType from '../../../../lib/i18n/collective-type';
import { formatHostFeeStructure } from '../../../../lib/i18n/host-fee-structure';
import { PREVIEW_FEATURE_KEYS } from '../../../../lib/preview-features';

import { Drawer } from '../../../Drawer';
import MessageBoxGraphqlError from '../../../MessageBoxGraphqlError';
Expand Down Expand Up @@ -116,7 +114,6 @@ const filters: FilterComponentConfigs<z.infer<typeof schema>> = {

const HostedCollectives = ({ accountSlug: hostSlug, subpath }: DashboardSectionProps) => {
const intl = useIntl();
const { LoggedInUser } = useLoggedInUser();
const router = useRouter();
const [displayExportCSVModal, setDisplayExportCSVModal] = React.useState(false);
const [showCollectiveOverview, setShowCollectiveOverview] = React.useState<Collective | undefined | string>(
Expand Down Expand Up @@ -211,20 +208,18 @@ const HostedCollectives = ({ accountSlug: hostSlug, subpath }: DashboardSectionP
<DashboardHeader
title={<FormattedMessage id="HostedCollectives" defaultMessage="Hosted Collectives" />}
actions={
LoggedInUser?.hasPreviewFeatureEnabled(PREVIEW_FEATURE_KEYS.EXPORT_COLLECTIVES) && (
<ExportHostedCollectivesCSVModal
open={displayExportCSVModal}
setOpen={setDisplayExportCSVModal}
queryFilter={queryFilter}
account={data?.host}
isHostReport
trigger={
<Button size="sm" variant="outline" onClick={() => setDisplayExportCSVModal(true)}>
<FormattedMessage id="Export.Format" defaultMessage="Export {format}" values={{ format: 'CSV' }} />
</Button>
}
/>
)
<ExportHostedCollectivesCSVModal
open={displayExportCSVModal}
setOpen={setDisplayExportCSVModal}
queryFilter={queryFilter}
account={data?.host}
isHostReport
trigger={
<Button size="sm" variant="outline" onClick={() => setDisplayExportCSVModal(true)}>
<FormattedMessage id="Export.Format" defaultMessage="Export {format}" values={{ format: 'CSV' }} />
</Button>
}
/>
}
/>
<Filterbar {...queryFilter} />
Expand Down
5 changes: 5 additions & 0 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "This is an incognito recurring contribution, only you can see it.",
"RecurringContributions.customAmount": "Custom amount",
"RecurringContributions.minAmount": "Min. amount: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "Manually credit Collective budgets with funds received outside the platform (e.g., cash, historical transactions, or third party channels like a shop).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "Application {name} deleted",
"vbFuLO": "Get a tax-deductible receipt with your donation",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Card successfully created",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Pressupost anual",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
5 changes: 5 additions & 0 deletions lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "This is an incognito recurring contribution, only you can see it.",
"RecurringContributions.customAmount": "Custom amount",
"RecurringContributions.minAmount": "Min. amount: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "Manually credit Collective budgets with funds received outside the platform (e.g., cash, historical transactions, or third party channels like a shop).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "Application {name} deleted",
"vbFuLO": "Get a tax-deductible receipt with your donation",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Card successfully created",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Roční rozpočet",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
5 changes: 5 additions & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "This is an incognito recurring contribution, only you can see it.",
"RecurringContributions.customAmount": "Custom amount",
"RecurringContributions.minAmount": "Min. amount: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "Manually credit Collective budgets with funds received outside the platform (e.g., cash, historical transactions, or third party channels like a shop).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "Application {name} deleted",
"vbFuLO": "Get a tax-deductible receipt with your donation",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Karte erfolgreich erstellt",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Jährliches Budget",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
5 changes: 5 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "This is an incognito recurring contribution, only you can see it.",
"RecurringContributions.customAmount": "Custom amount",
"RecurringContributions.minAmount": "Min. amount: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "Manually credit Collective budgets with funds received outside the platform (e.g., cash, historical transactions, or third party channels like a shop).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "Application {name} deleted",
"vbFuLO": "Get a tax-deductible receipt with your donation",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Card successfully created",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Yearly budget",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
5 changes: 5 additions & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "Esta es una contribución recurrente incógnita, sólo tú puedes verla.",
"RecurringContributions.customAmount": "Monto personalizado",
"RecurringContributions.minAmount": "Monto mínimo: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activado como independiente",
"sPZVmW": "Para las colaboraciones: el ID fiscal del colaborador.",
"SqpA8z": "Acredita manualmente los presupuestos de Colectivos con fondos recibidos fuera de la plataforma (por ejemplo, efectivo, transacciones históricas o canales de terceros como una tienda).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "Ver tokens personales",
"vAzArE": "Aplicación {name} eliminada",
"vbFuLO": "Obtén un recibo deducible de impuestos con tu donación",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Tarjeta correctamente creada",
"YdUvAv": "¿Quién debe tener acceso a esta actualización y recibir notificaciones al respecto?",
"ydZSPT": "Categorías sugeridas",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Presupuesto anual",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "¿Qué tal tu experiencia? ¿Qué se puede mejorar?",
Expand Down
5 changes: 5 additions & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "Il s'agit d'une contribution récurrente incognito, seul vous pouvez la voir.",
"RecurringContributions.customAmount": "Montant personnalisé",
"RecurringContributions.minAmount": "Montant minimum : {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activé en tant qu'indépendant",
"sPZVmW": "Pour les contributions : l'identifiant fiscal du contributeur.",
"SqpA8z": "Créditer manuellement les budgets du Collectif avec des fonds reçus en dehors de la plateforme (par exemple, d'anciennes transactions, de l'argent liquide ou une boutique en ligne).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "Voir les jetons d'accès personnels",
"vAzArE": "Application {name} supprimée",
"vbFuLO": "Obtenez un reçu pour la déduction des impôts avec votre don",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Carte créée avec succès !",
"YdUvAv": "Qui doit avoir accès et être informé de cette mise à jour ?",
"ydZSPT": "Catégories suggérées",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Budget annuel",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "Comment se passe votre expérience ? Que pouvons-nous améliorer ?",
Expand Down
5 changes: 5 additions & 0 deletions lang/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "זאת תרומה מחזורית אנונימית, פרטיה מוצגים רק לך.",
"RecurringContributions.customAmount": "סכום מותאם אישית",
"RecurringContributions.minAmount": "סכום מינימלי: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "עדכון הכנסות ידנית לגבי כספים שהקבוצה קיבלה מחוץ למערכת (למשל מזומן, הכנסות מהעבר, או הכנסות מצד ג' כמו חנות וכד').",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "האפליקציה {name} נמחקה",
"vbFuLO": "לאחר התרומה תוכל להשתמש בקבלת התרומה המוכרת לצורך זיכוי מס",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "הכרטיס נוצר בהצלחה",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "תקציב שנתי",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
5 changes: 5 additions & 0 deletions lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,7 @@
"receivedTotalAllTime": "Total Received (All Time)",
"receivedTotalMonthlyAverage": "Avg. Monthly Received",
"receivedTotalYear": "Total Received (1 year)",
"receivedTotalYearlyAverage": "Avg. Yearly Received",
"RecurringContribution.Incognito": "This is an incognito recurring contribution, only you can see it.",
"RecurringContributions.customAmount": "Importo personalizzato",
"RecurringContributions.minAmount": "Min. amount: {minAmount}",
Expand Down Expand Up @@ -3301,6 +3302,7 @@
"spentTotalAllTime": "Total Spent (All Time)",
"spentTotalMonthlyAverage": "Avg. Monthly Spent",
"spentTotalYear": "Total Spent (1 year)",
"spentTotalYearlyAverage": "Avg. Yearly Spent",
"sPXJ/7": "Activated as independent",
"sPZVmW": "For contributions: the contributor tax ID.",
"SqpA8z": "Manually credit Collective budgets with funds received outside the platform (e.g., cash, historical transactions, or third party channels like a shop).",
Expand Down Expand Up @@ -3739,6 +3741,8 @@
"valueOfExpensesYear": "Total Value of Expenses (1 year)",
"valueOfHostFeeAllTime": "Host Fee Paid (All Time)",
"valueOfHostFeeYear": "Host Fee Paid (1 year)",
"valueOfRefundedContributionsAllTime": "Total Refunded Value (All Time)",
"valueOfRefundedContributionsYear": "Total Refunded Value (1 year)",
"vaSCOx": "View personal tokens",
"vAzArE": "Application {name} deleted",
"vbFuLO": "Get a tax-deductible receipt with your donation",
Expand Down Expand Up @@ -3984,6 +3988,7 @@
"YdC/Ok": "Card successfully created",
"YdUvAv": "Who should have access and be notified about this update?",
"ydZSPT": "Suggested categories",
"YearlyAverage.Tooltip": "The average is calculated over the number of years since the collective was approved on your host",
"YearlyBudget": "Budget annuale",
"YesI6+": "Select a different set of filters to enable the export to work.",
"YFnrx/": "How is your experience? What can be improved?",
Expand Down
Loading

0 comments on commit 4189eae

Please sign in to comment.