Skip to content

Commit

Permalink
fix: filter for code
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Feb 15, 2024
1 parent 92c27b1 commit 5d38830
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions functions/src/cms4devfest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ function updatesStatus(id: string, company: any, status: any) {
.catch((err) => console.log(err));
}

export const getAllPublicSponsors = functions.https.onRequest(async (req, resp) => {
const data = await firestore.collection("companies-2024").get();
const partners = data.docs
.map((d) => ({
id: d.id,
...d.data(),
}))
.filter((p: any) => p.status.paid === StatusEnum.DONE && p.public && !!p.siteUrl && !!p.logoUrl);
resp.send(partners);
});

const relance = (
emailFactory: (partner: Record<string, any>, settings: Settings) => any,
partners: any[],
Expand All @@ -46,6 +57,7 @@ const relance = (
sendEmailToAllContacts(c, emailTemplate, settings);
});
};

export const relancePartnaireConventionASigner = functions.https.onCall(async (req, res) => {
const data = await firestore.collection("companies-2024").get();
const partners = data.docs.map((d) => d.data()).filter((p) => p.status.sign === StatusEnum.PENDING);
Expand Down
1 change: 1 addition & 0 deletions public/src/app/model/company.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface WorkflowStatus {
received?: State;
communicated?: State;
generated?: State;
code?: State;
}

export interface Company {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type FilterValueType =
| 'validated'
| 'paid'
| 'received'
| 'communicated';
| 'communicated'
| 'code';
type FilterByPackValueType = string;
type FilterByType = PartnerType | 'undefined';

Expand Down Expand Up @@ -69,6 +70,7 @@ export class DashboardComponent implements AfterViewInit {
'paid',
'received',
'communicated',
'code',
]);

shouldDisplayRelanceButton = computed(() => {
Expand Down Expand Up @@ -243,6 +245,7 @@ export class DashboardComponent implements AfterViewInit {
paid: 0,
received: 0,
communicated: 0,
code: 0,
};

partners.forEach((partner) => {
Expand All @@ -269,6 +272,10 @@ export class DashboardComponent implements AfterViewInit {
value: 'communicated',
label: `Communication (${counter['communicated']})`,
},
{
value: 'code',
label: `Code (${counter['code']})`,
},
];
}

Expand Down

0 comments on commit 5d38830

Please sign in to comment.