Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sashko9807/podkrepibg-frontend in…
Browse files Browse the repository at this point in the history
…to new-donation-flow
  • Loading branch information
sashko9807 committed Oct 9, 2024
2 parents 8a71aef + 767f4ec commit 964030b
Show file tree
Hide file tree
Showing 170 changed files with 6,169 additions and 1,318 deletions.
37 changes: 37 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,43 @@
"contributions": [
"code"
]
},
{
"login": "teodorazhelyazkova",
"name": "Teodora Zhelyazkova",
"avatar_url": "https://avatars.githubusercontent.com/u/103574320?v=4",
"profile": "https://github.com/teodorazhelyazkova",
"contributions": [
"code"
]
},
{
"login": "Martbul",
"name": "Martin Kovachki",
"avatar_url": "https://avatars.githubusercontent.com/u/99181339?v=4",
"profile": "https://martbul.github.io/MartinKovachki/",
"contributions": [
"code",
"test"
]
},
{
"login": "viiktorstefanov",
"name": "Viktor Stefanov",
"avatar_url": "https://avatars.githubusercontent.com/u/122864734?v=4",
"profile": "https://github.com/viiktorstefanov",
"contributions": [
"code"
]
},
{
"login": "velnachev",
"name": "velnachev",
"avatar_url": "https://avatars.githubusercontent.com/u/60844919?v=4",
"profile": "https://github.com/velnachev",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 10,
Expand Down
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
"name": "NodeJS",
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.2.0",
"forwardPorts": [], // Forward ports
"containerEnv": {
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars
},
"postStartCommand": "yarn", // Install dependencies
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
},
"mounts": ["source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"]
}
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ PAYPAL_CLIENT_ID=sb
###########
GHOST_API_URL=https://blog.podkrepi.bg
GHOST_CONTENT_KEY=86ec17c4b9660acd66b6034682
[email protected]
PODKREPI_PASSWORD=$ecurePa33
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ module.exports = {
endOfLine: 'auto',
},
],
'no-restricted-imports': ["error", {
"name": "react-i18next",
"message": "Please use next-i18next"
}]
'no-restricted-imports': [
'error',
{
name: 'react-i18next',
message: 'Please use next-i18next',
},
],
},
}
8 changes: 4 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Run db
- name: Run db and keycloak
working-directory: ./api
run: docker compose up -d pg-db
run: docker compose up -d pg-db keycloak

- name: Run stripe webhook
working-directory: ./api
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Install Frontend Dependencies
working-directory: ./frontend
run: yarn install --immutable

- name: Install e2e Dependencies
working-directory: ./frontend/e2e
run: yarn install --immutable
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
name: playwright-report
path: ./frontend/e2e/test-results/
retention-days: 14

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
file: Dockerfile.maintenance
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
run: echo "VERSION=master-$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
env:
NODE_ENV: production
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
env:
NODE_ENV: production
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: false
file: Dockerfile.maintenance
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Watch releases of this repository to be notified about future updates:
## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-80-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-84-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Please check [contributors guide](https://github.com/podkrepi-bg/frontend/blob/master/CONTRIBUTING.md) for:
Expand Down Expand Up @@ -221,6 +221,12 @@ Thanks goes to these wonderful people:
<td align="center" valign="top" width="10%"><a href="https://github.com/iliyan90"><img src="https://avatars.githubusercontent.com/u/74927065?v=4?s=100" width="100px;" alt="iliyan90"/><br /><sub><b>iliyan90</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=iliyan90" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/gparlakov"><img src="https://avatars.githubusercontent.com/u/3482199?v=4?s=100" width="100px;" alt="Georgi Parlakov"/><br /><sub><b>Georgi Parlakov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=gparlakov" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="10%"><a href="https://github.com/teodorazhelyazkova"><img src="https://avatars.githubusercontent.com/u/103574320?v=4?s=100" width="100px;" alt="Teodora Zhelyazkova"/><br /><sub><b>Teodora Zhelyazkova</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=teodorazhelyazkova" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://martbul.github.io/MartinKovachki/"><img src="https://avatars.githubusercontent.com/u/99181339?v=4?s=100" width="100px;" alt="Martin Kovachki"/><br /><sub><b>Martin Kovachki</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=Martbul" title="Code">💻</a> <a href="https://github.com/podkrepi-bg/frontend/commits?author=Martbul" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/viiktorstefanov"><img src="https://avatars.githubusercontent.com/u/122864734?v=4?s=100" width="100px;" alt="Viktor Stefanov"/><br /><sub><b>Viktor Stefanov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=viiktorstefanov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/velnachev"><img src="https://avatars.githubusercontent.com/u/60844919?v=4?s=100" width="100px;" alt="velnachev"/><br /><sub><b>velnachev</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=velnachev" title="Code">💻</a></td>
</tr>
</tbody>
</table>

Expand Down
4 changes: 2 additions & 2 deletions e2e/pages/web-pages/base.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ export class BasePage {
await this.clearInputFieldBySelector(elementSelector)
}
if (slowTyping) {
await this.page.type(elementSelector, inputValueToFill.toString().trim(), { delay: 100 })
await this.page.fill(elementSelector, inputValueToFill.toString().trim())
} else {
await this.page.type(elementSelector, inputValueToFill.toString().trim())
await this.page.fill(elementSelector, inputValueToFill.toString().trim())
}
if (pressEnterKey) {
await this.page.press(elementSelector, 'Enter')
Expand Down
7 changes: 3 additions & 4 deletions e2e/pages/web-pages/external/stripe-checkout.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ export class StripeCheckoutPage extends BasePage {
private readonly productSummaryTotalAmount = '#ProductSummary-totalAmount span'
private readonly checkoutPaymentForm = '.CheckoutPaymentForm'
private readonly emailReadonlyInputField = this.checkoutPaymentForm + ' .ReadOnlyFormField-title'
private readonly cardNumberFieldSet = this.checkoutPaymentForm + ' #cardNumber-fieldset'
private readonly cardNumberInputField = this.cardNumberFieldSet + ' #cardNumber'
private readonly cardExpDateInputField = this.cardNumberFieldSet + ' #cardExpiry'
private readonly cardCvcInputField = this.cardNumberFieldSet + ' #cardCvc'
private readonly cardNumberInputField = this.checkoutPaymentForm + ' #cardNumber'
private readonly cardExpDateInputField = this.checkoutPaymentForm + ' #cardExpiry'
private readonly cardCvcInputField = this.checkoutPaymentForm + ' #cardCvc'
private readonly billingNameInputField = this.checkoutPaymentForm + ' #billingName'
private readonly billingCountryDropdown = this.checkoutPaymentForm + ' #billingCountry'
private readonly submitPayButton = this.checkoutPaymentForm + ' button.SubmitButton'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { test, expect } from '../../../utils/fixtures'

test.describe('Create campaign application', () => {
test('should see list of applications', async ({ page, baseURL }) => {
await page.goto(`${baseURL}/admin/campaign-applications`)

await expect(page.getByRole('heading')).toHaveText('Кандидат Кампании')
// await expect(page.getByRole('row')).toHaveCount(1); // just title b/c no campaign applications yet
})
})
2 changes: 1 addition & 1 deletion e2e/tests/regression/campaign-flow/campaign-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.describe.serial(
})

test('Particular campaign can be opened through the Campaign page', async () => {
await headerPage.clickDonateHeaderNavButton()
await headerPage.clickDonateHeaderNavButton(LanguagesEnum.EN)
await campaignsPage.clickCampaignCardByIndex(0)

expect(
Expand Down
30 changes: 30 additions & 0 deletions e2e/utils/fixtures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test as base } from '@playwright/test'
import dotenv from 'dotenv'

dotenv.config({ path: '../.env.local' })
dotenv.config({ path: '../.env' })

const email = process.env.PODKREPI_EMAIL!
const password = process.env.PODKREPI_PASSWORD!

export const test = base.extend({
storageState: async ({ browser, baseURL }, use) => {
const page = await browser.newPage()
await page.goto(`${baseURL}/login`)

await page.locator('[name=email]').fill(email)
await page.locator('[name=password]').fill(password)

await page.locator('[type=submit]').click()
await page.waitForURL((url) => !url.pathname.includes('login'))

const state = await page.context().storageState()

await page.close()

use(state)
},
})

/** export the expect for consistency i.e. to be able to do `import { test, expect } from '../utils/fixtures'` */
export { expect } from 'playwright/test'
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
"sitemap": "next-sitemap"
},
"dependencies": {
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.11.4",
"@emotion/cache": "^11.13.1",
"@emotion/react": "^11.13.3",
"@emotion/server": "^11.4.0",
"@emotion/styled": "^11.11.5",
"@emotion/styled": "^11.13.0",
"@mdxeditor/editor": "^0.14.2",
"@mui/icons-material": "^5.15.19",
"@mui/icons-material": "^6.1.1",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.19",
"@mui/material": "^6.1.1",
"@mui/material-nextjs": "^6.1.1",
"@mui/styles": "^5.15.19",
"@mui/x-data-grid": "^6.16.1",
"@mui/x-date-pickers": "^6.16.1",
Expand All @@ -45,21 +46,22 @@
"@stripe/stripe-js": "^3.3.0",
"@tanstack/react-query": "^4.16.1",
"@tryghost/content-api": "^1.11.4",
"axios": "^1.6.8",
"axios": "^1.7.4",
"axios-hooks": "2.7.0",
"chart.js": "^4.4.0",
"chartjs-plugin-annotation": "^3.0.1",
"chartjs-plugin-datalabels": "^2.2.0",
"date-fns": "2.24.0",
"dompurify": "^3.0.3",
"dompurify": "^3.1.3",
"formik": "2.2.9",
"formik-persist-values": "^1.4.1",
"i18next": "^23.5.1",
"jwt-decode": "^3.1.2",
"latest": "^0.2.0",
"lodash": "^4.17.21",
"mobx": "6.3.2",
"mobx-react": "7.2.0",
"next": "14.1.1",
"next": "^14.2.13",
"next-auth": "^4.24.5",
"next-i18next": "^14.0.3",
"nookies": "^2.5.2",
Expand Down Expand Up @@ -122,6 +124,7 @@
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
"lint-staged": "11.0.0",
"msw": "1",
"next-sitemap": "^3.1.52",
"prettier": "2.3.0",
"shx": "^0.3.3",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/img/ArtboardRotate.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified public/img/team-photos/AnaNikolova.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/team-photos/ZhivkoNedyalkov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/team-photos/discord-team-image.jpg
Binary file not shown.
4 changes: 3 additions & 1 deletion public/locales/bg/about-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@
"finance-report-page": {
"financeReport": "Финансови отчети на Сдружение Подкрепи.бг",
"finance-report-2021": "Годишен финансов отчет за 2021 г.:",
"finance-report-2022-january-june": "Финансов отчет за полугодие Януари-Юни 2022 г.:",
"finance-report-2022-january-june": "Финансов отчет за полугодие януари-юни 2022 г.:",
"finance-report-2022": "Годишен финансов отчет за 2022 г.:",
"finance-report-2023": "Годишен финансов отчет за 2023 г.:",
"finance-report-2024-january-june": "Финансов отчет за полугодие януари-юни 2024 г.:",
"download-from-here": "Свалете от тук"
}
}
40 changes: 3 additions & 37 deletions public/locales/bg/about.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,15 @@
{
"about": {
"title": "Кои сме ние?",
"management-board-members": "Членове на управителен съвет",
"supervisory-board-members": "Членове на надзорен съвет",
"management-board-members": "Членове на Управителен съвет",
"supervisory-board-members": "Членове на Надзорен съвет",
"active-team-members": "Активни членове на екипа",
"association-members": "Членове на сдружението",
"linkedIn": "LinkedIn",
"about-the-team": "За екипа",
"team-description": "Ние сме група доброволци от IT средите, юристи, счетоводители, маркетолози, медици, НПО представители. Обединява ни желанието да създадем подобрена дарителска среда в България, създавайки максимално прозрачна платформа за дарения. Целта ни е платформата да се издържа от членски внос и дарения към нея, а не от процент комисиона от кампаниите, които тя обслужва.",
"avatar-alt-text": "Аватар на член на екипа",
"see-less": "Вижте по-малко",
"see-more": "Вижте повече"
},
"principlesThatUniteUs": {
"title": "Принципи, които ни обединяват",
"voluntary": {
"heading": "ДОБРОВОЛНО И ПРО БОНО",
"content": "Създаваме дарителска платформа в полза на нуждаещите се и организациите, които им помагат. Не търсим финансови или други облаги от това, освен удовлетвореност от осъществените кампании и подкрепените нуждаещи се."
},
"proactivity": {
"heading": "ПРОАКТИВНОСТ",
"content": "Не чакаме да ни се подаде задача - взимаме си директно. Стремежът в културата ни на работа е адекватна проява на свободна воля, правилен избор и извършване на задачи, без нуждата някой да ги създава и поставя."
},
"transparency": {
"heading": "ПРОЗРАЧНОСТ",
"content": "Дарителите ни се доверяват, защото осигуряваме прозрачност чрез отворен код, отворени данни/трансакции, отворени решения. Нуждаещите ни се доверяват, защото правим кандидатстването честно, лесно и прозрачно, чрез ясни критерии. Обществото ни се доверява, защото всичко е прозрачно, в това число - и целият ни работен процес. Ние си имаме доверие, защото има ясни и прозрачни принципи на работа помежду ни."
},
"respect": {
"heading": "УВАЖЕНИЕ",
"content": "Внимателни сме към хората около нас, уважаваме ги и ако можем, им помагаме. Мнението на всеки има значение, затова слушаме и се опитваме да разберем, какво казват другите."
},
"expertise": {
"heading": "ЕКСПЕРТНОСТ",
"content": "Когато правим избор или вземаме трудни решения, ги базираме на мнението на експерти с опит в конкретната тема."
},
"privacy": {
"heading": "ПОВЕРИТЕЛНОСТ",
"content": "Уважаваме и пазим личните данни на всеки нуждаещ се, даряващ или помагащ в процеса, все едно са нашите собствени. Ясно дефинираме кой има права за достъп до оперативните данни, като хората, разработващи проекта, няма да имат достъп до личните такива."
},
"awareness": {
"heading": "ОСЪЗНАТОСТ",
"content": "Търсим най-доброто решение и когато даряваме труда си, го правим с пълното съзнание, че не всичко, което правим, ще влезе в употреба. Ако се случи така, че да не се одобри планът или предложението ти, продължаваш с усмивка към следващата задача. Ако някой друг се справя по-добре в ролята ти, то на драго сърце го препоръчваш да я оглави, а ти му помагаш с каквото можеш."
},
"sharing": {
"heading": "СПОДЕЛЯНЕ НА ЗНАНИЯ",
"content": "Ако участник в проекта има нужда от помощ или разяснение, обясняваме или споделяме линк към документацията на проекта, даващ необходимата информация. Хората с по-малко опит имат възможност да се включат и да възприемат знания от по-опитните."
}
}
}
1 change: 0 additions & 1 deletion public/locales/bg/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
},
"fields": {
"email": "Email",
"email-descriptive": "Въведи email адрес",
"password": "Парола",
"confirm-password": "Потвърждение на парола",
"first-name": "Име",
Expand Down
Loading

0 comments on commit 964030b

Please sign in to comment.