Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 2-char lang code as Language primary key #129

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

lkeegan
Copy link
Member

@lkeegan lkeegan commented Oct 24, 2024

  • enforces uniqueness of languages
  • get languages now returns a list of these lang codes
  • remove langStore from frontend, instead we can now directly use the i18n-svelte library:
    • $locale for current lang_id
    • $locales for list of available lang_ids
  • update frontend and admin frontend accordingly
  • note: involves many changes to the database, probably easiest to just delete milestones.db
  • resolves Make Language primary key the 2-char code itself #128

@lkeegan lkeegan requested a review from MaHaWo October 24, 2024 10:40
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 52 lines in your changes missing coverage. Please review.

Project coverage is 24.29%. Comparing base (d9d7676) to head (b566083).

Files with missing lines Patch % Lines
frontend/src/lib/components/Admin/Languages.svelte 0.00% 11 Missing ⚠️
.../lib/components/Admin/EditUserQuestionModal.svelte 0.00% 7 Missing ⚠️
...ntend/src/lib/components/Admin/Translations.svelte 0.00% 7 Missing ⚠️
frontend/src/lib/components/Milestone.svelte 0.00% 7 Missing ⚠️
frontend/src/lib/i18n.ts 0.00% 6 Missing ⚠️
...ib/components/Admin/EditMilestoneGroupModal.svelte 0.00% 3 Missing ⚠️
...src/lib/components/Admin/EditMilestoneModal.svelte 0.00% 3 Missing ⚠️
...nd/src/lib/components/Admin/MilestoneGroups.svelte 0.00% 3 Missing ⚠️
...tend/src/lib/components/Admin/UserQuestions.svelte 0.00% 3 Missing ⚠️
...backend/src/mondey_backend/databases/milestones.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
+ Coverage   24.24%   24.29%   +0.05%     
==========================================
  Files          95       94       -1     
  Lines        3853     3836      -17     
  Branches      122      121       -1     
==========================================
- Hits          934      932       -2     
+ Misses       2850     2836      -14     
+ Partials       69       68       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- enforces uniqueness of languages
- get languages now returns a list of these lang codes
- remove langStore from frontend, instead we can now directly use the i18n-svelte library:
  - `$locale` for current lang_id
  - `$locales` for list of available lang_ids
- update frontend and admin frontend accordingly
- note: involves many changes to the database, probably easiest to just delete milestones.db
- resolves #128
@lkeegan lkeegan force-pushed the fix_128_use_lang_code_as_primary_key branch from 46febb3 to 544d137 Compare October 24, 2024 10:44
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

sonarcloud bot commented Oct 24, 2024

Copy link
Collaborator

@MaHaWo MaHaWo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lkeegan lkeegan merged commit 5fac037 into main Oct 24, 2024
5 checks passed
@lkeegan lkeegan deleted the fix_128_use_lang_code_as_primary_key branch October 24, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Language primary key the 2-char code itself
3 participants