Skip to content

Commit 4699a15

Browse files
committed
feat: change how-to urls to library
1 parent bf4aaa6 commit 4699a15

39 files changed

+228
-169
lines changed

functions/src/Integrations/firebase-discord.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { IResearchDB, ResearchUpdateStatus } from 'oa-shared/models/research'
66
import { CONFIG } from '../config/config'
77

88
import type { AxiosError, AxiosResponse } from 'axios'
9-
import type { IMapPin,IResearch } 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

functions/src/emailNotifications/createModerationEmails.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('Create howto moderation emails', () => {
9494
expect(html).toContain('Mock Howto')
9595
// Check that the email contains the correct howto link
9696
expect(html).toContain(
97-
'https://community.preciousplastic.com/how-to/00_user_1_howto',
97+
'https://community.preciousplastic.com/library/00_user_1_howto',
9898
)
9999
// Check that the email contains the correct PP signoff
100100
expect(html).toContain(PP_SIGNOFF)
@@ -134,7 +134,7 @@ describe('Create howto moderation emails', () => {
134134
expect(html).toContain('Mock Howto')
135135
// Check that the email contains the correct howto link
136136
expect(html).toContain(
137-
'https://community.preciousplastic.com/how-to/00_user_1_howto',
137+
'https://community.preciousplastic.com/library/00_user_1_howto',
138138
)
139139
// Check that the email contains the correct PP signoff
140140
expect(html).toContain(PP_SIGNOFF)
@@ -180,7 +180,7 @@ describe('Create howto moderation emails', () => {
180180
)
181181
// Check that the email contains the correct howto link
182182
expect(html).toContain(
183-
'https://community.preciousplastic.com/how-to/00_user_1_howto',
183+
'https://community.preciousplastic.com/library/00_user_1_howto',
184184
)
185185
// Check that the email contains the correct PP signoff
186186
expect(html).toContain(PP_SIGNOFF)
@@ -225,7 +225,7 @@ describe('Create howto moderation emails', () => {
225225
expect(html).toContain('Mock Howto')
226226
// Check that the email contains the correct howto link
227227
expect(html).toContain(
228-
'https://community.preciousplastic.com/how-to/00_user_1_howto',
228+
'https://community.preciousplastic.com/library/00_user_1_howto',
229229
)
230230
// Check that the email contains the correct howto guidelines link
231231
expect(html).toContain(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<p>
77
It is visible on the community platform
8-
<a href="{{site.url}}/how-to/{{howto.slug}}">here</a>.
8+
<a href="{{site.url}}/library/{{howto.slug}}">here</a>.
99
</p>
1010
<p>Users are now be able to comment and mark it as useful.</p>
1111

functions/src/emailNotifications/templates/how-to-needs-improvements.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-
Your project, <a href="{{site.url}}/how-to/{{howto.slug}}">{{howto.title}}</a>,
6+
Your project, <a href="{{site.url}}/library/{{howto.slug}}">{{howto.title}}</a>,
77
needs more work before we can publish it.
88
</p>
99

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<p>
66
Huzzah! Your project
7-
<a href="{{site.url}}/how-to/{{howto.slug}}">{{howto.title}}</a> has been
7+
<a href="{{site.url}}/library/{{howto.slug}}">{{howto.title}}</a> has been
88
submitted.
99
</p>
1010
<p>

packages/components/src/UserStatistics/UserStatistics.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('UserStatistics', () => {
3636
)
3737
const howtoLink = getByTestId('howto-link')
3838

39-
expect(howtoLink.getAttribute('href')).toBe('/how-to?q=Test User')
39+
expect(howtoLink.getAttribute('href')).toBe('/library?q=Test User')
4040
})
4141

4242
it('renders research link when on research stats', () => {

packages/components/src/UserStatistics/UserStatistics.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const UserStatistics = (props: UserStatisticsProps) => {
8383

8484
{props.howtoCount > 0 && (
8585
<InternalLink
86-
to={'/how-to?q=' + props.userName}
86+
to={'/library?q=' + props.userName}
8787
sx={{ color: 'black' }}
8888
data-testid="howto-link"
8989
>

packages/cypress/src/integration/common.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ describe('[Common]', () => {
1717
})
1818

1919
it('[Page Navigation]', () => {
20-
cy.visit('/how-to')
20+
cy.visit('/library')
2121
cy.wait(2000)
2222

2323
cy.step('Go to Academy page')
2424
cy.get('[data-cy=page-link]').contains('Academy').click()
2525
cy.wait(2000)
2626
cy.url().should('include', '/academy')
2727

28-
cy.get('[data-cy=page-link]').contains('How-to').click()
2928
cy.step('Go to library page')
29+
cy.get('[data-cy=page-link]').contains('Library').click()
3030
cy.wait(2000)
31-
cy.url().should('include', '/how-to')
31+
cy.url().should('include', '/library')
3232

3333
cy.step('Go to Map page')
3434
cy.get('[data-cy=page-link]').contains('Map').click()
@@ -38,12 +38,12 @@ describe('[Common]', () => {
3838

3939
describe('[User feeback button]', () => {
4040
it('[Desktop]', () => {
41-
cy.visit('/how-to')
41+
cy.visit('/library')
4242
cy.wait(2000)
4343
cy.get('[data-cy=feedback]').should('contain', 'Report a Problem')
4444
cy.get('[data-cy=feedback]')
4545
.should('have.attr', 'href')
46-
.and('contain', '/how-to?sort=Newest')
46+
.and('contain', '/library?sort=Newest')
4747

4848
cy.visit('/map')
4949
cy.wait(2000)
@@ -55,12 +55,12 @@ describe('[Common]', () => {
5555
it('[Mobile]', () => {
5656
cy.viewport('iphone-6')
5757

58-
cy.visit('/how-to')
58+
cy.visit('/library')
5959
cy.wait(2000)
6060
cy.get('[data-cy=feedback]').should('contain', 'Problem?')
6161
cy.get('[data-cy=feedback]')
6262
.should('have.attr', 'href')
63-
.and('contain', '/how-to?sort=Newest')
63+
.and('contain', '/library?sort=Newest')
6464

6565
cy.visit('/map')
6666
cy.wait(2000)
@@ -73,15 +73,15 @@ describe('[Common]', () => {
7373
describe('[User Menu]', () => {
7474
it('[By Anonymous]', () => {
7575
cy.step('Login and Join buttons are available')
76-
cy.visit('/how-to')
76+
cy.visit('/library')
7777
cy.wait(2000)
7878
cy.get('[data-cy=login]').should('be.visible')
7979
cy.get('[data-cy=join]').should('be.visible')
8080
cy.get('[data-cy=user-menu]').should('not.exist')
8181
})
8282

8383
it('[By Authenticated]', () => {
84-
cy.visit('/how-to')
84+
cy.visit('/library')
8585

8686
cy.step('Login and Join buttons are unavailable to logged-in users')
8787
const user = generateNewUserDetails()

packages/cypress/src/integration/howto/discussions.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const howtoDiscussion = Object.values(MOCK_DATA.discussions).find(
1717
describe('[Howto.Discussions]', () => {
1818
it('can open using deep links', () => {
1919
const firstComment = howtoDiscussion.comments[0]
20-
cy.visit(`/how-to/${item.slug}#comment:${firstComment._id}`)
20+
cy.visit(`/library/${item.slug}#comment:${firstComment._id}`)
2121
cy.wait(2000)
2222
cy.checkCommentItem(firstComment.text, 2)
2323
})
@@ -27,12 +27,12 @@ describe('[Howto.Discussions]', () => {
2727
cy.addHowto(howto, visitor)
2828
cy.signUpNewUser(visitor)
2929

30-
const newComment = `An interesting howto. ${visitor.username}`
31-
const updatedNewComment = `An interesting howto. The answer must be that when the sky is red, the apocalypse _might_ be on the way. Yours, ${visitor.username}`
30+
const newComment = `An interesting project. ${visitor.username}`
31+
const updatedNewComment = `An interesting project. The answer must be that when the sky is red, the apocalypse _might_ be on the way. Yours, ${visitor.username}`
3232
const newReply = `Thanks Dave and Ben. What does everyone else think? - ${visitor.username}`
3333
const updatedNewReply = `Anyone else? All the best, ${visitor.username}`
3434

35-
const howtoPath = `/how-to/howto-for-discussion-${visitor.username}`
35+
const howtoPath = `/library/howto-for-discussion-${visitor.username}`
3636

3737
cy.step('Can add comment')
3838
cy.visit(howtoPath)

0 commit comments

Comments
 (0)