Skip to content

Commit e32cea6

Browse files
committed
# This is a combination of 2 commits.
# This is the 1st commit message: feat: update how-to labels to library/project # The commit message #2 will be skipped: # fixup! feat: update how-to labels to library/project
1 parent 7a248b8 commit e32cea6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+123
-117
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This platform aims to tackle these problems by creating a strong unified communi
2828

2929
## ⚡️   What is this platform?
3030

31-
Our community platform helps people to grow communities and make it easier to collaborate on environmental projects in one single place. A place where people can meet, help each other, ask and answer questions, share their innovative ways of fixing problems, discover people around them, connect locally and more. It aims to provide the tools to connect both online and offline. Amongst other features we have How-to and Maps.
31+
Our community platform helps people to grow communities and make it easier to collaborate on environmental projects in one single place. A place where people can meet, help each other, ask and answer questions, share their innovative ways of fixing problems, discover people around them, connect locally and more. It aims to provide the tools to connect both online and offline. Amongst other features we have a library of projects, research, questions, commenting and a map.
3232

3333
### Have a look on our [website](https://platform.onearmy.earth) to have a clear overview
3434

functions/src/Integrations/firebase-discord.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import axios from 'axios'
22
import * as functions from 'firebase-functions'
3-
import { IResearchDB, ResearchUpdateStatus } from 'oa-shared/models/research'
43
import { IModerationStatus } from 'oa-shared'
4+
import { IResearchDB, ResearchUpdateStatus } from 'oa-shared/models/research'
55

66
import { CONFIG } from '../config/config'
77

88
import type { AxiosError, AxiosResponse } from 'axios'
9-
import type { IResearch, IMapPin } from 'oa-shared/models'
9+
import type { IMapPin,IResearch } from 'oa-shared/models'
1010

1111
const SITE_URL = CONFIG.deployment.site_url
1212
// e.g. https://dev.onearmy.world or https://community.preciousplastic.com
@@ -51,8 +51,8 @@ export const notifyHowtoPublished = functions
5151
const { _createdBy, title, slug } = info
5252
await axios
5353
.post(DISCORD_WEBHOOK_URL, {
54-
content: `📓 Yeah! New How To **${title}** by *${_createdBy}*
55-
check it out: <${SITE_URL}/how-to/${slug}>`,
54+
content: `📓 Yeah! New library project **${title}** by *${_createdBy}*
55+
check it out: <${SITE_URL}/library/${slug}>`,
5656
})
5757
.then(handleResponse, handleErr)
5858
.catch(handleErr)

functions/src/Integrations/firebase-slack.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { CONFIG } from '../config/config'
2-
import * as functions from 'firebase-functions'
31
import axios from 'axios'
2+
import * as functions from 'firebase-functions'
43
import { IModerationStatus } from 'oa-shared'
54

5+
import { CONFIG } from '../config/config'
6+
67
const SITE_URL = CONFIG.deployment.site_url
78
// e.g. https://dev.onearmy.world or https://community.preciousplastic.com
89

@@ -39,8 +40,8 @@ export const notifyHowtoAwaitingModeration = functions
3940

4041
return await axios
4142
.post(SLACK_WEBHOOK_URL, {
42-
text: `📓 Yeah! New How To *${title}* by _${user}_ awaiting moderation,
43-
check it out: ${SITE_URL}/how-to/${slug}`,
43+
text: `📓 Yeah! New library project *${title}* by _${user}_ awaiting moderation,
44+
check it out: ${SITE_URL}/library/${slug}`,
4445
})
4546
.catch((err) => {
4647
console.error(err)

functions/src/emailNotifications/createModerationEmails.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import * as functions from 'firebase-functions'
2-
import { QueryDocumentSnapshot } from 'firebase-admin/firestore'
3-
import { IModerationStatus, IModerable } from 'oa-shared'
2+
import { IModerationStatus } from 'oa-shared'
3+
4+
import { withErrorAlerting } from '../alerting/errorAlerting'
5+
import { MEMORY_LIMIT_512_MB } from '../consts'
46
import { db } from '../Firebase/firestoreDB'
57
import { DB_ENDPOINTS } from '../models'
68
import * as templates from './templateHelpers'
79
import { getUserAndEmail } from './utils'
8-
import { Change } from 'firebase-functions/v1'
9-
import { withErrorAlerting } from '../alerting/errorAlerting'
10-
import { MEMORY_LIMIT_512_MB } from '../consts'
11-
import { IHowtoDB } from 'oa-shared/models/howto'
12-
import { IMapPin } from 'oa-shared/models/maps'
10+
11+
import type { QueryDocumentSnapshot } from 'firebase-admin/firestore'
12+
import type { Change } from 'firebase-functions/v1'
13+
import type { IModerable } from 'oa-shared'
14+
import type { IHowtoDB } from 'oa-shared/models/howto'
15+
import type { IMapPin } from 'oa-shared/models/maps'
1316

1417
export async function handleModerationUpdate<T extends IModerable>(
1518
change: Change<QueryDocumentSnapshot<T>>,
@@ -33,7 +36,7 @@ export async function createHowtoModerationEmail(howto: IHowtoDB) {
3336
message: templates.getHowToApprovalEmail(toUser, howto),
3437
})
3538
} else if (howto.moderation === IModerationStatus.AWAITING_MODERATION) {
36-
// If a how to is resumbitted, send another submission confirmation email.
39+
// If a library project is resumbitted, send another submission confirmation email.
3740
await db.collection(DB_ENDPOINTS.emails).add({
3841
to: toUserEmail,
3942
message: templates.getHowToSubmissionEmail(toUser, howto),

functions/src/emailNotifications/createNotificationEmails.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('create email test', () => {
102102
userId: 'user_1',
103103
},
104104
relevantUrl: '/test',
105-
title: 'Test how-to',
105+
title: 'Test project',
106106
type: 'new_comment_discussion',
107107
}),
108108
notificationFactory('user_2', 'notification_2', {
@@ -139,7 +139,7 @@ describe('create email test', () => {
139139
userId: 'user_1',
140140
},
141141
relevantUrl: '/test',
142-
title: 'Test how-to',
142+
title: 'Test project',
143143
type: 'new_comment_discussion',
144144
}),
145145
]
@@ -218,8 +218,8 @@ describe('create email test', () => {
218218
to,
219219
} = doc.data()
220220
expect(html).toContain('https://community.preciousplastic.com/test')
221-
// 1st notification: how-to
222-
expect(html).toContain('how-to')
221+
// 1st notification: project
222+
expect(html).toContain('project')
223223
expect(html).toContain('https://community.preciousplastic.com/u/user_2')
224224
// 2nd notification: new comment
225225
expect(html).toContain('New comment')
@@ -263,7 +263,7 @@ describe('create email test', () => {
263263
// 1st notification: new comment
264264
expect(html).toContain('New comment')
265265
expect(html).toContain('https://community.preciousplastic.com/u/user_1')
266-
expect(html).toContain('Test how-to')
266+
expect(html).toContain('Test project')
267267
// 2nd notification: new comment
268268
expect(html).toContain('https://community.preciousplastic.com/u/user_3')
269269
expect(html).toContain('Test research')

functions/src/emailNotifications/createSubmissionEmails.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('Create howto submission emails', () => {
8585
})
8686
})
8787

88-
it('Does not create email for draft how tos', async () => {
88+
it('Does not create email for draft projects', async () => {
8989
const howto = getMockHowto('user_1', IModerationStatus.DRAFT)
9090
await createHowtoSubmissionEmail(howto)
9191

functions/src/emailNotifications/templateHelpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const getNotificationEmail = (
134134
}
135135
}
136136

137-
export const HOW_TO_APPROVAL_SUBJECT = 'Your how-to has been approved!'
137+
export const HOW_TO_APPROVAL_SUBJECT = 'Your project has been approved!'
138138
export const getHowToApprovalEmail = (
139139
user: IUserDB,
140140
howto: IHowtoDB,
@@ -183,7 +183,7 @@ export const getSenderMessageEmail = ({
183183
}
184184
}
185185

186-
export const HOW_TO_SUBMISSION_SUBJECT = 'Your how-to has been submitted'
186+
export const HOW_TO_SUBMISSION_SUBJECT = 'Your project has been submitted'
187187
export const getHowToSubmissionEmail = (
188188
user: IUserDB,
189189
howto: IHowtoDB,
@@ -234,7 +234,7 @@ export const getUserVerifiedBadgeAddedEmail = (user: IUserDB): Email => ({
234234
html: getEmailHtml('verified-badge-added', { user, site }),
235235
})
236236

237-
export const HOW_TO_REJECTED_SUBJECT = 'Your how-to has been rejected'
237+
export const HOW_TO_REJECTED_SUBJECT = 'Your project has been rejected'
238238
export const getHowToRejectedEmail = (
239239
user: IUserDB,
240240
howto: IHowtoDB,
@@ -257,7 +257,7 @@ export const getMapPinRejectedEmail = (user: IUserDB): Email => ({
257257
})
258258

259259
export const HOW_TO_NEEDS_IMPROVEMENTS_SUBJECT =
260-
'Your how-to needs improvements'
260+
'Your project needs improvements'
261261
export const getHowToNeedsImprovementsEmail = (
262262
user: IUserDB,
263263
howto: IHowtoDB,

functions/src/emailNotifications/templates/how-to-approval.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{#> layout}}
22

33
<p>Hey {{user.displayName}},</p>
4-
<p>Huzzah! Your How-To {{howto.title}} has been approved.</p>
4+
<p>Huzzah! Your project {{howto.title}} has been approved.</p>
55

66
<p>
77
It is visible on the community platform

functions/src/emailNotifications/templates/how-to-needs-improvements.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
<p>Hey {{user.displayName}},</p>
44

55
<p>
6-
Your How-to, <a href="{{site.url}}/how-to/{{howto.slug}}">{{howto.title}}</a>,
6+
Your project, <a href="{{site.url}}/how-to/{{howto.slug}}">{{howto.title}}</a>,
77
needs more work before we can publish it.
88
</p>
99

1010
{{#if howto.moderatorFeedback}}
11-
<p>Please review the following & re-submit your How-to:</p>
11+
<p>Please review the following & re-submit your project:</p>
1212
<b>{{howto.moderatorFeedback}}</b>
1313
{{/if}}
1414

1515
<p>
1616
Check the
1717
<a href="https://community.preciousplastic.com/academy/create/howto">
18-
How-to guidelines</a
18+
guidelines</a
1919
>
20-
to review our requirements. Until you update your information, your How-to
20+
to review our requirements. Until you update your information, your project
2121
will remain hidden from the community platform. We hope to see your edits
22-
soon, so we can get your How-to online as soon as possible 🙂
22+
soon, so we can get it online as soon as possible. 🙂
2323
</p>
2424

2525
<p>We look forward to hearing back from you.</p>

functions/src/emailNotifications/templates/how-to-rejected.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>Hey {{user.displayName}},</p>
44

55
<p>
6-
Thank you for submitting your How-To,
6+
Thank you for submitting your project,
77
<a href="{{site.url}}/how-to/{{howto.slug}}">{{howto.title}}</a>. We
88
appreciate your contribution and the time and effort you put into creating it.
99
</p>

0 commit comments

Comments
 (0)