diff --git a/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap
index 37263e937..aec3510fe 100644
--- a/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap
+++ b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap
@@ -496,7 +496,10 @@ exports[`sendEmailVariants sendAddedContributionMessageEmail result has the corr
Read and reply to message
-
To view and reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
+
+
„My message.“
+
To reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
+
To account
Please do not reply to this email.
@@ -667,8 +670,8 @@ exports[`sendEmailVariants sendContributionChangedByModeratorEmail result has th
Contribution details
-
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
-
Or copy the link into your browser window.
http://localhost/community/contributions
+
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
+
Or copy the link into your browser window.
https://gradido.net/contributions/own-contributions/1#contributionListItem-1
Please do not reply to this email.
@@ -839,8 +842,8 @@ exports[`sendEmailVariants sendContributionConfirmedEmail result has the correct
Contribution details
-
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
-
Or copy the link into your browser window.
http://localhost/community/contributions
+
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
+
Or copy the link into your browser window.
https://gradido.net/contributions/own-contributions/1#contributionListItem-1
Please do not reply to this email.
@@ -1011,8 +1014,8 @@ exports[`sendEmailVariants sendContributionDeletedEmail result has the correct h
Contribution details
-
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
-
Or copy the link into your browser window.
http://localhost/community/contributions
+
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
+
Or copy the link into your browser window.
https://gradido.net/contributions/own-contributions/1#contributionListItem-1
Please do not reply to this email.
@@ -1183,8 +1186,8 @@ exports[`sendEmailVariants sendContributionDeniedEmail result has the correct ht
Contribution details
-
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
-
Or copy the link into your browser window.
http://localhost/community/contributions
+
To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.
To account
+
Or copy the link into your browser window.
https://gradido.net/contributions/own-contributions/1#contributionListItem-1
Please do not reply to this email.
diff --git a/backend/src/emails/sendEmailVariants.test.ts b/backend/src/emails/sendEmailVariants.test.ts
index b264ddbf5..300885472 100644
--- a/backend/src/emails/sendEmailVariants.test.ts
+++ b/backend/src/emails/sendEmailVariants.test.ts
@@ -69,6 +69,8 @@ const sendEmailTranslatedSpy = jest.spyOn(sendEmailTranslatedApi, 'sendEmailTran
describe('sendEmailVariants', () => {
let result: any
+ const contributionFrontendLink =
+ 'https://gradido.net/contributions/own-contributions/1#contributionListItem-1'
describe('sendAddedContributionMessageEmail', () => {
beforeAll(async () => {
@@ -80,6 +82,8 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
+ contributionFrontendLink,
+ message: 'My message.',
})
})
@@ -97,9 +101,9 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
+ contributionFrontendLink,
+ message: 'My message.',
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
})
@@ -238,6 +242,7 @@ describe('sendEmailVariants', () => {
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
contributionAmount: new Decimal(23.54),
+ contributionFrontendLink,
})
})
@@ -256,9 +261,8 @@ describe('sendEmailVariants', () => {
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
contributionAmount: '23.54',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
+ contributionFrontendLink,
},
})
})
@@ -295,6 +299,7 @@ describe('sendEmailVariants', () => {
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
contributionMemoUpdated: 'This is a better contribution memo.',
+ contributionFrontendLink,
})
})
@@ -313,9 +318,8 @@ describe('sendEmailVariants', () => {
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
contributionMemoUpdated: 'This is a better contribution memo.',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
+ contributionFrontendLink,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
})
@@ -351,6 +355,7 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
+ contributionFrontendLink,
})
})
@@ -368,9 +373,8 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
+ contributionFrontendLink,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
})
@@ -406,6 +410,7 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
+ contributionFrontendLink,
})
})
@@ -423,9 +428,8 @@ describe('sendEmailVariants', () => {
senderFirstName: 'Bibi',
senderLastName: 'Bloxberg',
contributionMemo: 'My contribution.',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
+ contributionFrontendLink,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
})
@@ -535,7 +539,6 @@ describe('sendEmailVariants', () => {
senderEmail: 'bibi@bloxberg.de',
transactionMemo: 'You deserve it! 🙏🏼',
transactionAmount: '17.65',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
communityURL: CONFIG.COMMUNITY_URL,
},
@@ -594,7 +597,6 @@ describe('sendEmailVariants', () => {
senderLastName: 'Bloxberg',
senderEmail: 'bibi@bloxberg.de',
transactionAmount: '37.40',
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
communityURL: CONFIG.COMMUNITY_URL,
},
diff --git a/backend/src/emails/sendEmailVariants.ts b/backend/src/emails/sendEmailVariants.ts
index 3373f17ad..642f87387 100644
--- a/backend/src/emails/sendEmailVariants.ts
+++ b/backend/src/emails/sendEmailVariants.ts
@@ -5,7 +5,7 @@ import { decimalSeparatorByLanguage } from '@/util/utilities'
import { sendEmailTranslated } from './sendEmailTranslated'
-export const sendAddedContributionMessageEmail = (data: {
+export interface ContributionEmailCommonData {
firstName: string
lastName: string
email: string
@@ -13,22 +13,35 @@ export const sendAddedContributionMessageEmail = (data: {
senderFirstName: string
senderLastName: string
contributionMemo: string
-}): Promise | boolean | null> => {
+ contributionFrontendLink: string
+}
+
+function toContributionEmailLocales(data: ContributionEmailCommonData): Record {
+ return {
+ firstName: data.firstName,
+ lastName: data.lastName,
+ locale: data.language,
+ senderFirstName: data.senderFirstName,
+ senderLastName: data.senderLastName,
+ contributionMemo: data.contributionMemo,
+ contributionFrontendLink: data.contributionFrontendLink,
+ supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
+ }
+}
+
+export const sendAddedContributionMessageEmail = (
+ data: ContributionEmailCommonData & {
+ message: string
+ },
+): Promise | boolean | null> => {
return sendEmailTranslated({
receiver: {
to: `${data.firstName} ${data.lastName} <${data.email}>`,
},
template: 'addedContributionMessage',
locals: {
- firstName: data.firstName,
- lastName: data.lastName,
- locale: data.language,
- senderFirstName: data.senderFirstName,
- senderLastName: data.senderLastName,
- contributionMemo: data.contributionMemo,
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
- supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
+ ...toContributionEmailLocales(data),
+ message: data.message,
},
})
}
@@ -79,111 +92,53 @@ export const sendAccountMultiRegistrationEmail = (data: {
})
}
-export const sendContributionConfirmedEmail = (data: {
- firstName: string
- lastName: string
- email: string
- language: string
- senderFirstName: string
- senderLastName: string
- contributionMemo: string
- contributionAmount: Decimal
-}): Promise | boolean | null> => {
+export const sendContributionConfirmedEmail = (
+ data: ContributionEmailCommonData & {
+ contributionAmount: Decimal
+ },
+): Promise | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionConfirmed',
locals: {
- firstName: data.firstName,
- lastName: data.lastName,
- locale: data.language,
- senderFirstName: data.senderFirstName,
- senderLastName: data.senderLastName,
- contributionMemo: data.contributionMemo,
+ ...toContributionEmailLocales(data),
contributionAmount: decimalSeparatorByLanguage(data.contributionAmount, data.language),
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
- supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
}
-export const sendContributionChangedByModeratorEmail = (data: {
- firstName: string
- lastName: string
- email: string
- language: string
- senderFirstName: string
- senderLastName: string
- contributionMemo: string
- contributionMemoUpdated: string
-}): Promise | boolean | null> => {
+export const sendContributionChangedByModeratorEmail = (
+ data: ContributionEmailCommonData & {
+ contributionMemoUpdated: string
+ },
+): Promise | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionChangedByModerator',
locals: {
- firstName: data.firstName,
- lastName: data.lastName,
- locale: data.language,
- senderFirstName: data.senderFirstName,
- senderLastName: data.senderLastName,
- contributionMemo: data.contributionMemo,
+ ...toContributionEmailLocales(data),
contributionMemoUpdated: data.contributionMemoUpdated,
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
- supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
},
})
}
-export const sendContributionDeletedEmail = (data: {
- firstName: string
- lastName: string
- email: string
- language: string
- senderFirstName: string
- senderLastName: string
- contributionMemo: string
-}): Promise | boolean | null> => {
+export const sendContributionDeletedEmail = (
+ data: ContributionEmailCommonData,
+): Promise | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionDeleted',
- locals: {
- firstName: data.firstName,
- lastName: data.lastName,
- locale: data.language,
- senderFirstName: data.senderFirstName,
- senderLastName: data.senderLastName,
- contributionMemo: data.contributionMemo,
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
- supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
- },
+ locals: toContributionEmailLocales(data),
})
}
-export const sendContributionDeniedEmail = (data: {
- firstName: string
- lastName: string
- email: string
- language: string
- senderFirstName: string
- senderLastName: string
- contributionMemo: string
-}): Promise | boolean | null> => {
+export const sendContributionDeniedEmail = (
+ data: ContributionEmailCommonData,
+): Promise | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionDenied',
- locals: {
- firstName: data.firstName,
- lastName: data.lastName,
- locale: data.language,
- senderFirstName: data.senderFirstName,
- senderLastName: data.senderLastName,
- contributionMemo: data.contributionMemo,
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
- supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
- communityURL: CONFIG.COMMUNITY_URL,
- },
+ locals: toContributionEmailLocales(data),
})
}
@@ -234,7 +189,6 @@ export const sendTransactionLinkRedeemedEmail = (data: {
senderEmail: data.senderEmail,
transactionMemo: data.transactionMemo,
transactionAmount: decimalSeparatorByLanguage(data.transactionAmount, data.language),
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
communityURL: CONFIG.COMMUNITY_URL,
},
@@ -264,7 +218,6 @@ export const sendTransactionReceivedEmail = (data: {
senderLastName: data.senderLastName,
senderEmail: data.senderEmail,
transactionAmount: decimalSeparatorByLanguage(data.transactionAmount, data.language),
- overviewURL: CONFIG.EMAIL_LINK_OVERVIEW,
supportEmail: CONFIG.COMMUNITY_SUPPORT_MAIL,
communityURL: CONFIG.COMMUNITY_URL,
},
diff --git a/backend/src/emails/templates/addedContributionMessage/html.pug b/backend/src/emails/templates/addedContributionMessage/html.pug
index ff7c89c30..df5ba35c4 100644
--- a/backend/src/emails/templates/addedContributionMessage/html.pug
+++ b/backend/src/emails/templates/addedContributionMessage/html.pug
@@ -7,8 +7,10 @@ block content
p= t('emails.addedContributionMessage.commonGoodContributionMessage', { senderFirstName, senderLastName, contributionMemo })
.content
h2= t('emails.addedContributionMessage.readMessage')
- div(class="p_content")= t('emails.addedContributionMessage.toSeeAndAnswerMessage')
+ div(class="p_content")
+ p= t('emails.addedContributionMessage.message', { message })
+ p= t('emails.addedContributionMessage.toSeeAndAnswerMessage')
- a.button-3(href=`${communityURL}/community/contributions`) #{t('emails.general.toAccount')}
+ a.button-3(href=`${contributionFrontendLink}`) #{t('emails.general.toAccount')}
include ../includes/doNotReply.pug
diff --git a/backend/src/emails/templates/includes/contributionDetailsCTA.pug b/backend/src/emails/templates/includes/contributionDetailsCTA.pug
index 0a3bd395d..ae3b77e6a 100644
--- a/backend/src/emails/templates/includes/contributionDetailsCTA.pug
+++ b/backend/src/emails/templates/includes/contributionDetailsCTA.pug
@@ -1,7 +1,7 @@
//-
h2= t('emails.general.contributionDetails')
div(class="p_content")= t('emails.contribution.toSeeContributionsAndMessages')
-a.button-3(href=`${communityURL}/community/contributions`) #{t('emails.general.toAccount')}
+a.button-3(href=`${contributionFrontendLink}`) #{t('emails.general.toAccount')}
div(class="p_content")= t('emails.general.orCopyLink')
-a.clink(href=`${communityURL}/community/contributions`) #{`${communityURL}/community/contributions`}
\ No newline at end of file
+a.clink(href=`${contributionFrontendLink}`) #{`${contributionFrontendLink}`}
\ No newline at end of file
diff --git a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts
index 74af7acc7..a9aa3fa91 100644
--- a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts
+++ b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts
@@ -252,9 +252,11 @@ describe('ContributionMessageResolver', () => {
lastName: 'Bloxberg',
email: 'bibi@bloxberg.de',
language: 'de',
+ message: 'Admin Test',
senderFirstName: 'Peter',
senderLastName: 'Lustig',
contributionMemo: 'Test env contribution',
+ contributionFrontendLink: `http://localhost/contributions/own-contributions/1#contributionListItem-${result.data.createContribution.id}`,
})
})
diff --git a/backend/src/graphql/resolver/ContributionMessageResolver.ts b/backend/src/graphql/resolver/ContributionMessageResolver.ts
index 4444a0ef0..505711b9e 100644
--- a/backend/src/graphql/resolver/ContributionMessageResolver.ts
+++ b/backend/src/graphql/resolver/ContributionMessageResolver.ts
@@ -24,6 +24,8 @@ import { LogError } from '@/server/LogError'
import { Context, getUser } from '@/server/context'
import { getLogger } from 'log4js'
import { LOG4JS_RESOLVER_CATEGORY_NAME } from '.'
+
+import { contributionFrontendLink } from './util/contributions'
import { findContributionMessages } from './util/findContributionMessages'
const db = AppDatabase.getInstance()
@@ -183,6 +185,11 @@ export class ContributionMessageResolver {
senderFirstName: moderator.firstName,
senderLastName: moderator.lastName,
contributionMemo: finalContribution.memo,
+ contributionFrontendLink: await contributionFrontendLink(
+ finalContribution.id,
+ finalContribution.createdAt,
+ ),
+ message: finalContributionMessage.message,
})
}
diff --git a/backend/src/graphql/resolver/ContributionResolver.test.ts b/backend/src/graphql/resolver/ContributionResolver.test.ts
index 90858cfa3..8bdbd98a8 100644
--- a/backend/src/graphql/resolver/ContributionResolver.test.ts
+++ b/backend/src/graphql/resolver/ContributionResolver.test.ts
@@ -881,6 +881,7 @@ describe('ContributionResolver', () => {
senderFirstName: 'Peter',
senderLastName: 'Lustig',
contributionMemo: 'Test contribution to deny',
+ contributionFrontendLink: `http://localhost/contributions/own-contributions/1#contributionListItem-${contributionToDeny.data.createContribution.id}`,
})
})
})
@@ -1958,6 +1959,7 @@ describe('ContributionResolver', () => {
senderFirstName: 'Peter',
senderLastName: 'Lustig',
contributionMemo: 'Das war leider zu Viel!',
+ contributionFrontendLink: `http://localhost/contributions/own-contributions/1#contributionListItem-${creation?.id}`,
})
})
})
@@ -2124,6 +2126,7 @@ describe('ContributionResolver', () => {
senderLastName: 'Lustig',
contributionMemo: 'Herzlich Willkommen bei Gradido liebe Bibi!',
contributionAmount: expect.decimalEqual(450),
+ contributionFrontendLink: `http://localhost/contributions/own-contributions/1#contributionListItem-${creation?.id}`,
})
})
diff --git a/backend/src/graphql/resolver/ContributionResolver.ts b/backend/src/graphql/resolver/ContributionResolver.ts
index 328a70dc7..687aa0196 100644
--- a/backend/src/graphql/resolver/ContributionResolver.ts
+++ b/backend/src/graphql/resolver/ContributionResolver.ts
@@ -51,7 +51,11 @@ import { LOG4JS_RESOLVER_CATEGORY_NAME } from '@/graphql/resolver'
import { ContributionMessageType } from '@enum/ContributionMessageType'
import { AppDatabase } from 'database'
import { getLogger } from 'log4js'
-import { loadAllContributions, loadUserContributions } from './util/contributions'
+import {
+ contributionFrontendLink,
+ loadAllContributions,
+ loadUserContributions,
+} from './util/contributions'
import { getOpenCreations, getUserCreation, validateContribution } from './util/creations'
import { extractGraphQLFields } from './util/extractGraphQLFields'
import { findContributions } from './util/findContributions'
@@ -325,6 +329,10 @@ export class ContributionResolver {
senderLastName: moderator.lastName,
contributionMemo: updateUnconfirmedContributionContext.getOldMemo(),
contributionMemoUpdated: contribution.memo,
+ contributionFrontendLink: await contributionFrontendLink(
+ contribution.id,
+ contribution.createdAt,
+ ),
})
}
@@ -411,6 +419,10 @@ export class ContributionResolver {
senderFirstName: moderator.firstName,
senderLastName: moderator.lastName,
contributionMemo: contribution.memo,
+ contributionFrontendLink: await contributionFrontendLink(
+ contribution.id,
+ contribution.createdAt,
+ ),
})
return !!res
@@ -521,6 +533,10 @@ export class ContributionResolver {
senderLastName: moderatorUser.lastName,
contributionMemo: contribution.memo,
contributionAmount: contribution.amount,
+ contributionFrontendLink: await contributionFrontendLink(
+ contribution.id,
+ contribution.createdAt,
+ ),
})
} catch (e) {
await queryRunner.rollbackTransaction()
@@ -604,6 +620,10 @@ export class ContributionResolver {
senderFirstName: moderator.firstName,
senderLastName: moderator.lastName,
contributionMemo: contributionToUpdate.memo,
+ contributionFrontendLink: await contributionFrontendLink(
+ contributionToUpdate.id,
+ contributionToUpdate.createdAt,
+ ),
})
return !!res
diff --git a/backend/src/graphql/resolver/const/const.ts b/backend/src/graphql/resolver/const/const.ts
index b97694221..2d4532cf5 100644
--- a/backend/src/graphql/resolver/const/const.ts
+++ b/backend/src/graphql/resolver/const/const.ts
@@ -10,3 +10,5 @@ export const CONTRIBUTIONLINK_NAME_MAX_CHARS = 100
export const CONTRIBUTIONLINK_NAME_MIN_CHARS = 5
export const MEMO_MAX_CHARS = 255
export const MEMO_MIN_CHARS = 5
+export const DEFAULT_PAGINATION_PAGE_SIZE = 25
+export const FRONTEND_CONTRIBUTIONS_ITEM_ANCHOR_PREFIX = 'contributionListItem-'
diff --git a/backend/src/graphql/resolver/util/contributions.ts b/backend/src/graphql/resolver/util/contributions.ts
index 58e0914ba..adf9da800 100644
--- a/backend/src/graphql/resolver/util/contributions.ts
+++ b/backend/src/graphql/resolver/util/contributions.ts
@@ -1,7 +1,12 @@
+import { CONFIG } from '@/config'
import { Order } from '@/graphql/enum/Order'
+import {
+ DEFAULT_PAGINATION_PAGE_SIZE,
+ FRONTEND_CONTRIBUTIONS_ITEM_ANCHOR_PREFIX,
+} from '@/graphql/resolver/const/const'
import { Paginated } from '@arg/Paginated'
import { Contribution as DbContribution } from 'database'
-import { FindManyOptions, In } from 'typeorm'
+import { FindManyOptions, In, MoreThan } from 'typeorm'
// TODO: combine with Pagination class for all queries to use
function buildPaginationOptions(paginated: Paginated): FindManyOptions {
@@ -91,3 +96,18 @@ export const loadAllContributions = async (
})
*/
}
+
+export const contributionFrontendLink = async (
+ contributionId: number,
+ _createdAt: Date,
+): Promise => {
+ // TODO: page is sometimes wrong, use page 1 for now, and fix later with more time at hand
+ // simplified, don't account for order by id, so when the nearly impossible case occur that createdAt is the same for two contributions,
+ // maybe it is the wrong page
+ //const countBefore = await DbContribution.count({
+ // where: { createdAt: MoreThan(createdAt) },
+ //})
+ // const page = Math.floor(countBefore / DEFAULT_PAGINATION_PAGE_SIZE) + 1
+ const anchor = `${FRONTEND_CONTRIBUTIONS_ITEM_ANCHOR_PREFIX}${contributionId}`
+ return `${CONFIG.COMMUNITY_URL}/contributions/own-contributions/1#${anchor}`
+}
diff --git a/backend/src/locales/de.json b/backend/src/locales/de.json
index 8c0c8ff0c..8b34f61f4 100644
--- a/backend/src/locales/de.json
+++ b/backend/src/locales/de.json
@@ -21,7 +21,8 @@
"readMessage": "Nachricht lesen und beantworten",
"subject": "Nachricht zu deinem Gemeinwohl-Beitrag",
"title": "Nachricht zu deinem Gemeinwohl-Beitrag",
- "toSeeAndAnswerMessage": "Um die Nachricht zu sehen und darauf zu antworten, gehe in deinem Gradido-Konto ins Menü „Schöpfen“ auf den Tab „Meine Beiträge“."
+ "message": "„{message}“",
+ "toSeeAndAnswerMessage": "Um auf die Nachricht zu antworten, gehe in deinem Gradido-Konto ins Menü „Schöpfen“ auf den Tab „Meine Beiträge“."
},
"contribution": {
"toSeeContributionsAndMessages": "Um deine Gemeinwohl-Beiträge und dazugehörige Nachrichten zu sehen, gehe in deinem Gradido-Konto ins Menü „Schöpfen“ auf den Tab „Meine Beiträge“."
diff --git a/backend/src/locales/en.json b/backend/src/locales/en.json
index 9b6b2a4cf..fb90a0334 100644
--- a/backend/src/locales/en.json
+++ b/backend/src/locales/en.json
@@ -21,7 +21,8 @@
"readMessage": "Read and reply to message",
"subject": "Message about your common good contribution",
"title": "Message about your common good contribution",
- "toSeeAndAnswerMessage": "To view and reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab."
+ "message": "„{message}“",
+ "toSeeAndAnswerMessage": "To reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab."
},
"contribution": {
"toSeeContributionsAndMessages": "To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab."
diff --git a/frontend/src/components/Inputs/InputPassword.spec.js b/frontend/src/components/Inputs/InputPassword.spec.js
index 9d6f5481d..94e50e026 100644
--- a/frontend/src/components/Inputs/InputPassword.spec.js
+++ b/frontend/src/components/Inputs/InputPassword.spec.js
@@ -80,7 +80,7 @@ describe('InputPassword', () => {
})
it('has the placeholder "input-field-placeholder"', () => {
- expect(wrapper.find('input').attributes('placeholder')).toEqual('form.password')
+ expect(wrapper.find('input').attributes('placeholder')).toEqual('input-field-placeholder')
})
it('has the value ""', () => {
@@ -88,7 +88,7 @@ describe('InputPassword', () => {
})
it('has the label "input-field-label"', () => {
- expect(wrapper.find('label').text()).toEqual('form.password')
+ expect(wrapper.find('label').text()).toEqual('input-field-label')
})
it('has the label for "input-field-name-input-field"', () => {
diff --git a/frontend/src/components/Inputs/InputPassword.vue b/frontend/src/components/Inputs/InputPassword.vue
index b496d09a3..b7619045a 100644
--- a/frontend/src/components/Inputs/InputPassword.vue
+++ b/frontend/src/components/Inputs/InputPassword.vue
@@ -62,6 +62,14 @@ const props = defineProps({
type: Boolean,
default: false,
},
+ label: {
+ type: String,
+ default: null,
+ },
+ placeholder: {
+ type: String,
+ default: null,
+ },
})
const name = toRef(props, 'name')
@@ -73,8 +81,8 @@ const { value, errorMessage, meta, errors, validate } = useField(name, props.rul
const { t } = useI18n()
const defaultTranslations = computed(() => ({
- label: t('form.password'),
- placeholder: t('form.password'),
+ label: props.label || t('form.password'),
+ placeholder: props.placeholder || t('form.password'),
}))
const showPassword = ref(false)
diff --git a/frontend/src/layouts/templates/ContributionsTemplate.spec.js b/frontend/src/layouts/templates/ContributionsTemplate.spec.js
index 75448c0ae..30552edfc 100644
--- a/frontend/src/layouts/templates/ContributionsTemplate.spec.js
+++ b/frontend/src/layouts/templates/ContributionsTemplate.spec.js
@@ -40,9 +40,9 @@ describe('ContributionsTemplate', () => {
expect(wrapper.findComponent({ name: 'ContributionInfo' }).exists()).toBe(true)
})
- describe('mounted with parameter contributions', () => {
+ describe('mounted with parameter own-contributions', () => {
beforeEach(() => {
- wrapper = createWrapper('contributions')
+ wrapper = createWrapper('own-contributions')
})
it('has a header related to "my contributions"', () => {
@@ -73,9 +73,9 @@ describe('ContributionsTemplate', () => {
})
})
- describe('mounted with parameter community', () => {
+ describe('mounted with parameter all-contributions', () => {
beforeEach(() => {
- wrapper = createWrapper('community')
+ wrapper = createWrapper('all-contributions')
})
it('has a header related to "the community"', () => {
diff --git a/frontend/src/layouts/templates/ContributionsTemplate.vue b/frontend/src/layouts/templates/ContributionsTemplate.vue
index 85213c972..0e1692e69 100644
--- a/frontend/src/layouts/templates/ContributionsTemplate.vue
+++ b/frontend/src/layouts/templates/ContributionsTemplate.vue
@@ -12,7 +12,7 @@
-
+
{{ $t('community.myContributions') }}
@@ -26,7 +26,7 @@
-
+
{{ $t('navigation.community') }}