Skip to content

Commit

Permalink
Merge branch 'main' into form-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis authored Sep 18, 2024
2 parents 036c3d7 + 80bac74 commit ba64f60
Show file tree
Hide file tree
Showing 313 changed files with 12,822 additions and 7,449 deletions.
7 changes: 7 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ DATABASE_PASSWORD="postgres"

SECRET_KEY='secret'
DEBUG='1'

ACTIVIST_EMAIL="[email protected]"
EMAIL_HOST="smtp.activist.org"
EMAIl_PORT="587"
EMAIL_HOST_USER="[email protected]"
EMAIL_HOST_PASSWORD="activist123!?"
EMAIL_USE_TLS="True"
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/localization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ body:
- type: markdown
attributes:
value: |
Thanks for your efforts to bring activist to other languages!
Thanks for your efforts to bring activist to other languages! Please join us in the [localization project on Weblate](https://hosted.weblate.org/projects/activist/activist) and the [Localization channel on Matrix](https://matrix.to/#/!DzbdYyfhjinQBWXgQe:matrix.org?via=matrix.org) to get involved!
30 changes: 30 additions & 0 deletions .github/workflows/pr_ci_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,28 @@ on:
- main
types: [opened, reopened, synchronize]

env:
SECRET_KEY: "ONLY_FOR_TESTING"
DATABASE_PORT: 5432
DATABASE_HOST: localhost
DATABASE_NAME: postgres
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres


jobs:
backend:
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: ${{ env.DATABASE_USER }}
POSTGRES_PASSWORD: ${{ env.DATABASE_PASSWORD }}
POSTGRES_DB: ${{ env.DATABASE_NAME }}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

name: Run PR Backend Check
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -39,3 +59,13 @@ jobs:
- name: Run mypy - Static Type Checking
if: always()
run: mypy ./backend --config-file ./backend/pyproject.toml

- name: Run pytest - Unit Tests
if: always()
run: pytest ./backend -vv

- name: Run Django Migrations - Database Migrations Check
run: |
. .venv/bin/activate
python ./backend/manage.py makemigrations
python ./backend/manage.py migrate
22 changes: 16 additions & 6 deletions .github/workflows/pr_ci_i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,21 @@ jobs:
with:
python-version: "3.11"

- name: Execute Repeat i18n Value Script
working-directory: ./frontend/i18n
run: python check_repeat_i18n_values.py
- name: Execute i18n Key Identifiers Check
working-directory: ./frontend/i18n/check
run: python i18n_check_key_identifiers.py

- name: Execute Unused i18n Key Script
- name: Execute i18n Unused Keys Check
if: always()
working-directory: ./frontend/i18n
run: python check_unused_i18n_keys.py
working-directory: ./frontend/i18n/check
run: python i18n_check_unused_keys.py

- name: Execute i18n Non Source Keys Check
if: always()
working-directory: ./frontend/i18n/check
run: python i18n_check_non_source_keys.py

- name: Execute i18n Repeat Values Check
if: always()
working-directory: ./frontend/i18n/check
run: python i18n_check_repeat_values.py
24 changes: 23 additions & 1 deletion .github/workflows/pr_ci_playwright_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- name: Run Docker Compose
run: docker compose --env-file .env.dev up --build -d

- name: Check Docker Container Logs
run: docker compose --env-file .env.dev logs

- name: Setup Node environment
uses: actions/setup-node@v4
with:
Expand All @@ -52,7 +55,26 @@ jobs:
- name: Wait for web server to be ready
working-directory: ./frontend
run: |
yarn wait-on http://localhost:3000
MAX_ATTEMPTS=3
WAIT_TIME=30
ATTEMPT=1
while [[ $ATTEMPT -le $MAX_ATTEMPTS ]]; do
echo "Attempt $ATTEMPT of $MAX_ATTEMPTS"
yarn wait-on http://localhost:3000 --timeout ${WAIT_TIME}000
STATUS=$?
if [[ $STATUS -eq 0 ]]; then
echo "Server is ready!"
break
else
echo "Server not ready, retrying..."
ATTEMPT=$((ATTEMPT + 1))
if [[ $ATTEMPT -gt $MAX_ATTEMPTS ]]; then
echo "Server failed to start after $MAX_ATTEMPTS attempts."
exit 1
fi
sleep 1
fi
done
- name: Run Playwright tests
working-directory: ./frontend
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# - id: pretty-format-json

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"eslint.validate": ["javascript", "typescript", "vue"]
"eslint.validate": ["javascript", "typescript", "vue"],
"typescript.tsdk": "./frontend/node_modules/typescript/lib"
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).

- Localization switching is achieved via a dropdown with routing applied to links.
- All platform texts are written in JSON files for easy localization.
- A localization process has been set up with [Transifex](https://www.transifex.com/).
- A localization process has been set up with [Weblate](https://weblate.org).
- Aria labels are written using translatable strings for localized accessibility.

### ♻️ Code Quality
Expand Down
39 changes: 34 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If you have questions or would like to communicate with the team, please [join u
- [Learning the tech stack](#learning-the-tech)
- [Development environment](#dev-env)
- [Style guide](#style-guide)
- [Testing](#testing)
- [Linting](#linting)
- [Issues and projects](#issues-projects)
- [Bug reports](#bug-reports)
Expand Down Expand Up @@ -63,7 +64,7 @@ The following are the current and planned technologies for [activist.org](https:

### Localization

- [Nuxt I18n](https://github.com/nuxt-modules/i18n)[Transifex](https://www.transifex.com/) ([activist on Transifex](https://explore.transifex.com/activist-org/activist))
- [Nuxt I18n](https://github.com/nuxt-modules/i18n)[Weblate](https://weblate.org) ([activist on Weblate](https://hosted.weblate.org/projects/activist/activist))

### Analytics

Expand Down Expand Up @@ -303,6 +304,35 @@ From there you'll be able to visit http://localhost:6006/ to view the documentat

Please see the [activist style guide](https://github.com/activist-org/activist/blob/main/STYLEGUIDE.md) for details about how to follow the code style for the project. We made these guidelines to assure that we as a community write clean, cohesive code that's easy to write and review. Suggestions for the style guide are welcome.
<a id="testing"></a>
## Testing [`⇧`](#contents)
### Backend
Please run the following commands from the project root to test the backend:
```bash
# Start the Docker container:
docker compose --env-file .env.dev up backend --build -d # -d to hide logs
# Enter the backend container:
docker exec -it django_backend sh
# Run backend tests:
pytest
# Once tests are finished:
exit
```
### Frontend
Running frontend tests locally is currently WIP.
> [!NOTE]
> When working on the frontend, activist recommends manual typechecking. From within the `frontend` directory run `yarn run postinstall` followed by `yarn nuxi typecheck` to confirm your changes are type-safe. Existing TS errors may be ignored. PRs to fix these are always welcome!
<a id="linting"></a>
## Linting [`⇧`](#contents)
Expand Down Expand Up @@ -405,9 +435,6 @@ When making a contribution, adhering to the [GitHub flow](https://docs.github.co
git pull --rebase upstream <dev-branch>
```

> [!NOTE]
> When working on the frontend, activist recommends manual typechecking. From within the `frontend` directory run `yarn run postinstall` followed by `yarn nuxi typecheck` to confirm your changes are type-safe. Existing TS errors may be ignored. PRs to fix these are always welcome!

6. Push your topic branch up to your fork:

```bash
Expand All @@ -422,7 +449,9 @@ Thank you in advance for your contributions!

## Localization [`⇧`](#contents)

Localization for activist happens within our [public localization project on Transifex](https://explore.transifex.com/activist-org/activist). Join us there if you'd like to help bring activist to other languages!
<a href="https://hosted.weblate.org/projects/activist/activist"><img src="https://raw.githubusercontent.com/activist-org/Organization/main/resources/images/logos/WeblateLogo.png" height="100" alt="Visit Weblate project" align="right"></a>

Localization for activist happens on our [public localization project on Weblate](https://hosted.weblate.org/projects/activist/activist). Join us there if you'd like to help bring activist to other languages!
To find issues related to localization, please see the [`localization`](https://github.com/activist-org/activist/issues?q=is%3Aopen+is%3Aissue+label%3Alocalization) label in the [issues](https://github.com/activist-org/activist/issues), and to report a localization issue use the [localization issue form](https://github.com/activist-org/activist/issues/new?assignees=&labels=localization&projects=activist-org%2F1&template=localization.yml). Please also see the [style guide](https://github.com/activist-org/activist/blob/main/STYLEGUIDE.md) for more information on how to create new localization keys.
Expand Down
33 changes: 33 additions & 0 deletions LOCALIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Localizing via Weblate

<a href="https://hosted.weblate.org/projects/activist/activist"><img src="https://raw.githubusercontent.com/activist-org/Organization/main/resources/images/logos/WeblateLogo.png" height="100" alt="Visit Weblate project" align="right"></a>

[Weblate](https://weblate.org) localization is as easy as making an account and jumping into the activist project!

1. First [register at Weblate](https://hosted.weblate.org/accounts/register/) (you can also authenticate with GitHub or other accounts)

- We suggest that you do link your GitHub account so you get credit for the localization commits!

2. Navigate to the activist project at [weblate.org/projects/activist/activist](https://hosted.weblate.org/projects/activist/activist)

3. Click on a language you want to start translating

4. You can browse the available strings or start translating directly

- When translating a word, be sure to check the glossary context if you're not sure what the string's use is

- You can also make use of Automatic suggestions to see machine translations if you need help

5. Hit `Save and continue` when you're ready to move to the next string

6. Maintainers will open up pull requests from [Weblate](https://weblate.org) to the activist repo to bring in the new strings

- Changes are also automatically sent every 24 hours

Thanks so much for your interest in supporting activist's localization!

### Localization coverage

<a href="https://hosted.weblate.org/projects/activist/activist">
<img src="https://hosted.weblate.org/widget/activist/activist/multi-auto.svg" alt="Translation status" />
</a>
45 changes: 36 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
[![platforms](https://img.shields.io/badge/Web-0183DC.svg?logo=windows-terminal&logoColor=ffffff)](https://github.com/activist-org/activist)
[![netlify](https://img.shields.io/netlify/f184f5a7-e9a8-4e3a-be26-70fefb50d4cb?label=%20&logo=netlify&logoColor=ffffff)](https://app.netlify.com/sites/activist-org)
[![issues](https://img.shields.io/github/issues/activist-org/activist?label=%20&logo=github)](https://github.com/activist-org/activist/issues)
[![django](https://img.shields.io/badge/Django%204-092E20.svg?logo=django&logoColor=ffffff)](#tech-stack)
[![django](https://img.shields.io/badge/Django%205-092E20.svg?logo=django&logoColor=ffffff)](#tech-stack)
[![nuxt](https://img.shields.io/badge/Nuxt%203-41b883.svg?logo=nuxt.js&logoColor=ffffff)](#tech-stack)
[![vue](https://img.shields.io/badge/Vue%203-41b883.svg?logo=vue.js&logoColor=ffffff)](#tech-stack)
[![tailwind](https://img.shields.io/badge/Tailwind%203-38BDF8.svg?logo=tailwindcss&logoColor=ffffff)](#tech-stack)
[![license](https://img.shields.io/github/license/activist-org/activist-iOS.svg?label=%20)](https://github.com/activist-org/activist/blob/main/LICENSE.txt)
[![license](https://img.shields.io/github/license/activist-org/activist.svg?label=%20)](https://github.com/activist-org/activist/blob/main/LICENSE.txt)
[![coc](https://img.shields.io/badge/Contributor%20Covenant-ff69b4.svg)](https://github.com/activist-org/activist/blob/main/.github/CODE_OF_CONDUCT.md)
[![instagram](https://img.shields.io/badge/Instagram-8134AF.svg?logo=instagram&logoColor=ffffff)](https://instagram.com/activist_org)
[![weblate](https://img.shields.io/badge/Weblate-144D3F.svg?logo=weblate&logoColor=ffffff)](https://hosted.weblate.org/projects/activist/activist)
[![matrix](https://img.shields.io/badge/Matrix-000000.svg?logo=matrix&logoColor=ffffff)](https://matrix.to/#/#activist_community:matrix.org)

<details><summary>🌐 Language</summary>
Expand Down Expand Up @@ -108,7 +109,7 @@ We would be happy to discuss granting you further rights as a contributor after
- [Reporting bugs](https://github.com/activist-org/activist/issues/new?assignees=&labels=bug&template=bug_report.yml) as they're found 🐞
- Working with us on [new features](https://github.com/activist-org/activist/issues?q=is%3Aissue+is%3Aopen+label%3Afeature)
- [Localizing](https://github.com/activist-org/activist/issues?q=is%3Aissue+is%3Aopen+label%3Alocalization) content for the platform 🌐
- Please join our [public localization project on Transifex](https://explore.transifex.com/activist-org/activist)!
- Please join our [public localization project on Weblate](https://hosted.weblate.org/projects/activist/activist)!
- [Documentation](https://github.com/activist-org/activist/issues?q=is%3Aissue+is%3Aopen+label%3Adocumentation) for onboarding and project cohesion 📝
- [Sharing activist.org](https://github.com/activist-org/activist/issues/23) with others! 🚀

Expand Down Expand Up @@ -181,24 +182,40 @@ git remote add upstream https://github.com/activist-org/activist.git
- `origin` (forked repository)
- `upstream` (activist repository)

4. Start your docker images with the following:
4. Create a virtual environment for the backend, activate it and install dependencies:

```bash
# Unix or MacOS:
python3 -m venv venv
source venv/bin/activate

# Windows:
python -m venv venv
venv\Scripts\activate.bat

# After activating venv:
pip install --upgrade pip
pip install -r backend/requirements-dev.txt
```

5. Start your docker images with the following:

```bash
docker compose --env-file .env.dev up
# Or with new dependencies:
# Or with new dependencies or backend model changes:
# docker compose --env-file .env.dev up --build
# And to stop the containers when you're done working:
# docker compose --env-file .env.dev down
```

5. You can then visit <http://localhost:3000> to see the development frontend build once the container is up and running.
6. You can then visit <http://localhost:3000> to see the development frontend build once the container is up and running.

> [!NOTE]
> Feel free to contact the team in the [Development room on Matrix](https://matrix.to/#/!CRgLpGeOBNwxYCtqmK:matrix.org?via=matrix.org&via=acter.global&via=chat.0x7cd.xyz) if you're having problems getting your environment setup! If you're having issues with Docker and just want to get the frontend or backend up and running, please see [the section on this in the contributing guide](https://github.com/activist-org/activist/blob/main/CONTRIBUTING.md#using-yarn-or-python).

6. Install [pre-commit](https://pre-commit.com/) to ensure that each of your commits is properly checked against our linter and formatters:
7. Install [pre-commit](https://pre-commit.com/) to ensure that each of your commits is properly checked against our linter and formatters:

```bash
# In the project root:
Expand Down Expand Up @@ -235,7 +252,7 @@ The following are the current and planned technologies for [activist.org](https:

### Internationalization

- [Nuxt I18n](https://github.com/nuxt-modules/i18n) • [Transifex](https://www.transifex.com/) ([activist on Transifex](https://explore.transifex.com/activist-org/activist))
- [Nuxt I18n](https://github.com/nuxt-modules/i18n) • [Weblate](https://weblate.org) ([activist on Weblate](https://hosted.weblate.org/projects/activist/activist))

### Analytics

Expand Down Expand Up @@ -356,10 +373,20 @@ We are still developing our operating principles and will always update them bas

# Localization [`⇧`](#contents)

<a href="https://hosted.weblate.org/projects/activist/activist"><img src="https://raw.githubusercontent.com/activist-org/Organization/main/resources/images/logos/WeblateLogo.png" height="100" alt="Visit Weblate project" align="right"></a>

We need to break down language barriers in order to mobilize larger and more diverse coalitions. Translation requests will be available for several assets on the platform - organization profiles, events and resources - and we are growing our network of volunteer contributors to facilitate this.

> [!NOTE]
> Want to join our translators working group? Please join our [public localization project on Transifex](https://explore.transifex.com/activist-org/activist).
> Want to join our translators working group? Please join us in the [localization project on Weblate](https://hosted.weblate.org/projects/activist/activist) and the [Localization channel on Matrix](https://matrix.to/#/!DzbdYyfhjinQBWXgQe:matrix.org?via=matrix.org) to get involved!

Localization of activist is done via [Weblate](https://weblate.org). Please see the [localization guide](https://github.com/activist-org/activist/blob/main/LOCALIZATION.md) for information on how to get started!

### Localization coverage [`⇧`](#contents)

<a href="https://hosted.weblate.org/projects/activist/activist">
<img src="https://hosted.weblate.org/widget/activist/activist/multi-auto.svg" alt="Translation status" />
</a>

<a id="supporters-partners"></a>

Expand Down
3 changes: 2 additions & 1 deletion README/README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
[![platforms](https://img.shields.io/badge/Web-0183DC.svg?logo=windows-terminal&logoColor=ffffff)](https://github.com/activist-org/activist)
[![netlify](https://img.shields.io/netlify/f184f5a7-e9a8-4e3a-be26-70fefb50d4cb?label=%20&logo=netlify&logoColor=ffffff)](https://app.netlify.com/sites/activist-org)
[![issues](https://img.shields.io/github/issues/activist-org/activist?label=%20&logo=github)](https://github.com/activist-org/activist/issues)
[![django](https://img.shields.io/badge/Django%204-092E20.svg?logo=django&logoColor=ffffff)](#tech-stack)
[![django](https://img.shields.io/badge/Django%205-092E20.svg?logo=django&logoColor=ffffff)](#tech-stack)
[![nuxt](https://img.shields.io/badge/Nuxt%203-41b883.svg?logo=nuxt.js&logoColor=ffffff)](#tech-stack)
[![vue](https://img.shields.io/badge/Vue%203-41b883.svg?logo=vue.js&logoColor=ffffff)](#tech-stack)
[![tailwind](https://img.shields.io/badge/Tailwind%203-38BDF8.svg?logo=tailwindcss&logoColor=ffffff)](#tech-stack)
[![license](https://img.shields.io/github/license/activist-org/activist-iOS.svg?label=%20)](https://github.com/activist-org/activist/blob/main/LICENSE.txt)
[![coc](https://img.shields.io/badge/Contributor%20Covenant-ff69b4.svg)](https://github.com/activist-org/activist/blob/main/.github/CODE_OF_CONDUCT.md)
[![instagram](https://img.shields.io/badge/Instagram-8134AF.svg?logo=instagram&logoColor=ffffff)](https://instagram.com/activist_org)
[![weblate](https://img.shields.io/badge/Weblate-144D3F.svg?logo=weblate&logoColor=ffffff)](https://hosted.weblate.org/projects/activist/activist)
[![matrix](https://img.shields.io/badge/Matrix-000000.svg?logo=matrix&logoColor=ffffff)](https://matrix.to/#/#activist_community:matrix.org)

<details><summary>🌐 Sprache</summary>
Expand Down
Loading

0 comments on commit ba64f60

Please sign in to comment.