diff --git a/.github/workflows/pr_ci_i18n.yaml b/.github/workflows/pr_ci_i18n.yaml index 1649d8407..dd863ea56 100644 --- a/.github/workflows/pr_ci_i18n.yaml +++ b/.github/workflows/pr_ci_i18n.yaml @@ -25,11 +25,21 @@ jobs: with: python-version: "3.11" - - name: Execute i18n Values Check + - name: Execute i18n Key Identifiers Check working-directory: ./frontend/i18n/check - run: python i18n_check_values.py + run: python i18n_check_key_identifiers.py - - name: Execute i18n Keys Check + - name: Execute i18n Unused Keys Check if: always() working-directory: ./frontend/i18n/check - run: python i18n_check_keys.py + 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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f45cb9eb5..7acc8ddd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json index 2d67d095e..fd1fc0f20 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "eslint.validate": ["javascript", "typescript", "vue"] + "eslint.validate": ["javascript", "typescript", "vue"], + "typescript.tsdk": "./frontend/node_modules/typescript/lib" } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45a702c9d..7c977ce57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) @@ -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. + + +## 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! + ## Linting [`⇧`](#contents) @@ -405,9 +435,6 @@ When making a contribution, adhering to the [GitHub flow](https://docs.github.co git pull --rebase upstream ``` -> [!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 diff --git a/README.md b/README.md index 60c948dfa..d28c5c081 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![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) @@ -203,7 +203,7 @@ git remote add upstream https://github.com/activist-org/activist.git ```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: diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 646533952..1e181607f 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -54,6 +54,9 @@ Vue files (`.vue`) are Single-File Components that have ` diff --git a/frontend/components/card/CardFAQEntry.vue b/frontend/components/card/CardFAQEntry.vue index 705c38c4c..51671d8bd 100644 --- a/frontend/components/card/CardFAQEntry.vue +++ b/frontend/components/card/CardFAQEntry.vue @@ -19,8 +19,8 @@ @closeModal="handleCloseModal" :faqEntry="faqEntry" :sectionsToEdit="[ - $t('components.card-faq-entry.question'), - $t('components.card-faq-entry.answer'), + $t('components.card_faq_entry.question'), + $t('components.card_faq_entry.answer'), ]" :textsToEdit="[faqEntry.question, faqEntry.answer]" :isOpen="modalIsOpen" diff --git a/frontend/components/card/CardLegalDisclaimer.vue b/frontend/components/card/CardLegalDisclaimer.vue index a22120fac..222a1d82d 100644 --- a/frontend/components/card/CardLegalDisclaimer.vue +++ b/frontend/components/card/CardLegalDisclaimer.vue @@ -12,7 +12,7 @@ :name="IconMap.LEGAL" class="fill-light-text dark:fill-dark-text" /> -

{{ $t("components.card-legal-disclaimer.header") }}

+

{{ $t("components.card_legal_disclaimer.header") }}

diff --git a/frontend/components/card/CardMetricsOverview.vue b/frontend/components/card/CardMetricsOverview.vue index f13dd1a40..d26def83c 100644 --- a/frontend/components/card/CardMetricsOverview.vue +++ b/frontend/components/card/CardMetricsOverview.vue @@ -2,7 +2,7 @@

- {{ $t("components.card-metics-overview.header") }} + {{ $t("components.card_metrics_overview.header") }}

@@ -15,21 +15,21 @@ backgroundColor="bg-light-layer-1 dark:bg-dark-layer-1 hover:bg-light-highlight dark:hover:bg-dark-highlight active:bg-light-layer-1 active:dark:bg-dark-layer-1" />
diff --git a/frontend/components/card/CardTopicSelection.vue b/frontend/components/card/CardTopicSelection.vue index cd53b300c..4009db825 100644 --- a/frontend/components/card/CardTopicSelection.vue +++ b/frontend/components/card/CardTopicSelection.vue @@ -1,22 +1,22 @@ diff --git a/frontend/components/modal/ModalBase.vue b/frontend/components/modal/ModalBase.vue index 4a3ee7e44..3254a17d7 100644 --- a/frontend/components/modal/ModalBase.vue +++ b/frontend/components/modal/ModalBase.vue @@ -24,7 +24,7 @@ v-if="imageModal" @click="closeModal()" class="focus-brand absolute right-0 mr-24 mt-8 rounded-full p-1 text-light-distinct-text hover:text-light-text dark:text-dark-distinct-text hover:dark:text-dark-text" - :aria-label="$t('components.modal-image.close-modal-aria-label')" + :aria-label="$t('components.modal_base.close_modal_aria_label')" > @@ -43,7 +43,7 @@ tabindex="0" role="button" class="focus-brand flex flex-col items-center justify-center" - :aria-label="$t('components.modal-image.close-modal-aria-label')" + :aria-label="$t('components.modal_base.close_modal_aria_label')" > @@ -57,23 +57,47 @@ diff --git a/frontend/components/modal/ModalCommandPalette.vue b/frontend/components/modal/ModalCommandPalette.vue index f44bb6782..2dfc24572 100644 --- a/frontend/components/modal/ModalCommandPalette.vue +++ b/frontend/components/modal/ModalCommandPalette.vue @@ -1,37 +1,15 @@ - - - - - -