Граф коммитов

6171 Коммитов

Автор SHA1 Сообщение Дата
Matjaž Horvat 696b32c541
Order lists of dicts in TM search API tests (#3547) 2025-01-27 09:41:30 +01:00
Matjaž Horvat 5755626a85
Add ability to search TM via API (#3540) 2025-01-24 15:54:24 +01:00
Harmit Goswami deb8d6ec34
Rename status banner to user banner in css (#3537) 2025-01-24 10:55:29 +01:00
Harmit Goswami 8b32aa0fcc
Sent notifications to managers for translation comments (#3541) 2025-01-24 10:43:03 +01:00
Eemeli Aro 948e6cf02b
Refactor stats, removing aggregate fields from project, projectlocale & locale (#3536)
Based on unscientific local testing, the rendering speed benefits from eagerly populating the aggregated stats into Project, ProjectLocale & Locale don't exist, compared to collating the data on the fly from TranslatedResource objects. Therefore, we should not be doing this complex extra work. This significantly simplifies the logic around stats updates, and makes the stats much easier to reason about.

The AggregatedStats class no longer extends Model, and it's mostly a crutch for reducing the risks in this change; hence its move from base/models/ to base/. With it, fields like total_strings and strings_with_errors will continue to work for the Django models from which the corresponding DB fields were removed.
2025-01-23 12:31:28 +01:00
Matjaž Horvat 0e4d906382
Add ability to search terminology via API (#3532)
Adds a GraphQL API call support for simple case-insensitive search of terms and their translations for a given locale.

Example:

```graphql
query {
  termSearch(search: "open", locale: "sl") {
    text
    partOfSpeech
    definition
    usage
    translationText
  }
}

```

Response:
```json
{
  "data": {
    "termSearch": [
      {
        "text": "open source",
        "partOfSpeech": "ADJECTIVE",
        "definition": "Refers to any program whose source code is made available for use or modification.",
        "usage": "These terms are not intended to limit any rights granted under open source licenses",
        "translationText": "odprtokoden"
      }
    ]
  }
}
```

Also enables GraphiQL everywhere.
2025-01-23 00:09:06 +01:00
Eemeli Aro 729cc71664
Refactor sync status logging (#3529)
Here, sync status logging is collapsed into a single table of events, which is written to only from sync_project_task(), with the following states:

* IN_PROGRESS
* DONE - sync complete, with some changes to DB or repo
* NO_CHANGES - sync complete, with no changed to DB or repo
* NO_COMMIT - sync complete, but commit=False was set while a repo write should've occurred
* PREV_BUSY - skipped due to previous sync still running
* FAIL - an exception was raised
* INCOMPLETE - sync never completed; set by a subsequent successful run

For FAIL, an error message is retained in the error field.

The logs are made available via the following views:

* /sync - latest sync status and start time for each project
* /sync/projects/<project> - sync events for each project
* /sync/errors - all anomalous sync events with a status other than DONE or NO_CHANGES

Old sync events are ported to the new format, setting the status as NO_CHANGES for all that were "skipped" and INCOMPLETE for ones with no end time set.

Also included:
* Do not clear ChangedEntityLocale during a sync with commit=False
* Add Sync Log menu entry to the Profile menu

Co-authored-by: Matjaž Horvat <matjaz.horvat@gmail.com>
2025-01-22 11:34:18 +01:00
Eemeli Aro e948db0d20
Account for missing resource from previous sync implementation (#3535) 2025-01-20 12:23:06 +01:00
Eemeli Aro 638ae4f0fc
Drop obsolete ProjectInsightsSnapshot (#3533) 2025-01-17 16:15:36 +01:00
Harmit Goswami 89f390a551
Award badges on file uploads (#3522) 2025-01-15 21:19:29 +01:00
Eemeli Aro 402bf74812
Drop SVN support (#3527)
Also:
* Drop heroku-buildpack-apt (incl. Aptfile)
2025-01-15 09:51:38 +01:00
Eemeli Aro 23dc10bcd0
Use Fluent BaseNode.equals() to match DB & repo translations (#3526) 2025-01-14 16:54:02 +01:00
Eemeli Aro a9611a91a8
Deduplicate counts for translations with multiple errors or warnings (#3525) 2025-01-14 14:13:51 +01:00
Dave a880d3de67
Pick up VCS source string changes and apply them to the DB (#3506)
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
2025-01-14 14:13:27 +01:00
Francesco Lodolo 158597c4be
Restore fix for Fluent references in advanced search options (#3520) 2025-01-10 15:03:42 +01:00
Matjaž Horvat e429fe5b46
Replace Discourse with GitHub Discussions (#3515) 2025-01-09 13:47:08 +01:00
Francesco Lodolo cf745540e7
Make advanced search options more discoverable (#3510) 2025-01-07 12:22:12 +01:00
Francesco Lodolo 5efb9349ad
Use 'fas' instead of 'fa' for Font Awesome (#3509)
Also: Fix unreviewed (lightbulb) icon alignment
2025-01-06 18:24:00 +01:00
Francesco Lodolo 6bab0c93c3
Fix advanced search options (missing Fluent strings, CSS) (#3508) 2025-01-06 14:59:13 +01:00
Francesco Lodolo 70c370baea
Update to Font Awesome 5.15.4 (#3504) 2025-01-06 13:07:53 +01:00
Harmit Goswami 72b7646dfb
Award badges on batch actions (#3499) 2025-01-06 13:07:19 +01:00
Eemeli Aro 42421cd6c1
Refactor sync (#3312) 2024-12-20 00:09:40 +02:00
Matjaž Horvat f369337355
Call send_manual_emails() task asynchronously (#3496) 2024-12-17 21:34:01 +01:00
Matjaž Horvat 79123c0097
Fix bad variable reference in inactive account emails (#3495)
Also: Improve CSS styling of lists in notifications
2024-12-17 18:28:04 +01:00
Matjaž Horvat 4fe4bcb2b8
Send emails from the Messaging Center as Celery tasks (#3493)
Sending a lot of emails could result in a request timeout when sent synchronously.

That's only really possible when emails sent from the Messaging Center, because the rest are sent to a small number of recipients (e.g. Welcome Email, Email Verification, Project Requests...) or on a dedicated worker via management commands (Notification Emails, Monthly Report, Inactive Accounts...).
2024-12-17 13:17:22 +01:00
Matjaž Horvat 87a1cb668e
Use Base email template for emails sent from the Messaging Center (#3491)
Also: Factor out `send_manual_emails()` and move it to `pontoon.messaging.emails`.
2024-12-16 23:25:09 +01:00
Matjaž Horvat a412d5fd2a
Onboarding and inactive account transactional emails (#3485)
Store transactional email content in the DB and make it editable in Django Admin. That allows us to keep the Mozilla-specific content outside the codebase and inside the DB.

Also included:
* Move contact email verification to pontoon.messaging and use HTML template
* Move more general styles to the base email template
* Add spaces around variables in curly braces
* Document new management commands
* Unify HTML editor experience between the Homepage and Email content
2024-12-16 18:07:21 +01:00
Matjaž Horvat 516b429af2
Bugfixes for the /settings page (#3490)
1. Only uncheck email check boxes

2. Read toggle button value from the value attribute. Currently, the value to send to the backend is read from the text node value of the button, which might be changed by machine translation, in which case the settings cannot be changed.
2024-12-16 18:05:20 +01:00
Francesco Lodolo 5e90a8ac1e
Update uv version for Docker, add comments to workflows (#3487) 2024-12-12 19:46:08 +01:00
Matjaž Horvat e05d6287b9
Update Transactional emails spec (#3479)
Minor copy updates and fixes in Onboarding and Inactive account emails.

Also included:
* Fix Firefox Add-On URL
* Add "Has not received inactive account reminder" as the condition for inactive Translator and Manager emails
* Email communications > News and updates
* Exclude system-project submissions from the Inactive contributor requirement
2024-12-12 10:13:26 +01:00
Francesco Lodolo e3e7168097
Update ruff (0.8.2) and uv (0.5.7) (#3483) 2024-12-11 22:17:58 +01:00
Harmit Goswami 1ea8f485f3
Add notifications when a badge is awarded (#3442)
Send notification and open a pop-up (feat. a confetti animation!) when badge gets awarded. 

Also included:
* New `ActionLog.is_implicit_action` field. Some action types (e.g. `TRANSLATION_CREATED`) may trigger other actions (e.g. `TRANSLATION_REJECTED`) without direct user intervention. The latter actions now have `is_implicit_action` set to `True`. That allows us to only include explicit actions in badge counts.
2024-12-11 17:51:37 +01:00
Matjaž Horvat eb65ceedae
Add ability to send Monthly activity summary (#3474)
The changeset also factors out the base HTML email template, which is currently shared with the notifications email template. In the future, we'll use it for all HTML emails we send.

In addition to the spec, a configurable Thank you note is added. The day of the month to send the summary emails on is also configurable.
2024-12-11 09:49:19 +01:00
Matjaž Horvat d3d5cf111f
Update to python 3.11.11 (#3478) 2024-12-09 12:29:36 +01:00
Matjaž Horvat f3603fd120
Fix sending new contributor notifications (#3477)
We broke sending new contributor notifications in #2677 by moving the is_new_contributor() check after the point when translation is saved, while keeping its logic (return True whether the user has not made any contributions yet). That way the function always returns False.

This changeset:
* Fixes the logic to detect that the submitted translation is the user's first contribution to the locale.
* Add an additional check that the new contributor notification is not sent to project managers.
* Adds a test case to checks whether the new contributor notification is sent and that it's only sent once.
2024-12-09 09:54:40 +01:00
Matjaž Horvat 3090235437
Configurable day to send weekly notification digest emails on (#3475) 2024-12-09 09:12:14 +01:00
Matjaž Horvat 44ab754666
Update to Django 4.2.17 (#3471) 2024-12-04 20:31:03 +01:00
Matjaž Horvat 9ff4f3c630
Remove unnecessary border from notification emails (#3470) 2024-12-04 19:54:51 +01:00
Matjaž Horvat 6273ecb07a
Use full URLs in notifications (#3468)
Some notification types (suggestions available for review, suggestions have been reviewed and new contributor has joined the team) use relative URLs. That means they won't work in emails. This patch fixes that.

It also:
* Moves notification content from multiline strings to HTML templates.
* Moves management commands for sending notifications to the messaging module.
* Moves notification template files to the messaging module.
2024-12-03 21:55:15 +01:00
Matjaž Horvat a6195e4fa6
Make NewContributorTooltip visible again (#3466) 2024-12-03 19:25:22 +01:00
Matjaž Horvat a025ed1843
Add ability to send notifications via email (#3456)
This PR implements all the changes to the user settings as per the spec:
https://github.com/mozilla/pontoon/blob/main/specs/0120-transactional-emails.md#settings-changes

It also introduces a management command to send daily or weekly email notifications.

Related changes:
* Add PNG logo, needed for the display in emails (SVG is not supported in Gmail)
* Store notification categories in the data model
- Use these categories to determine to which category the user is subscribed
- Add data migration to store categories for old notifications

Other changes, not directly related to the PR:
* Reorder sections in the Settings page by moving Email and Notifications sections next to another.
* The settings.html file has been reformatted. Please hide whitespace in the diff for easier overview of changes.
* Minor changes to the check-box widget markup and styling.
* Minor changes to the success messages when toggling checkboxes.
* Explicity set from: email address everywhere we send emails.
2024-12-03 15:05:13 +01:00
Matjaž Horvat 0d15df6dc0
Messaging css fixes (#3463)
* Use default font weight in <li> elements in the Messaging Center Preview / Inbox

* <li> elements in the notification message should have the same color on hover as the rest of the text
2024-12-02 12:04:23 +01:00
Matjaž Horvat 8ef541dfd1
Support variant keys of type NumberLiteral in Pretranslation of access keys (#3462) 2024-12-02 11:30:01 +01:00
Matjaž Horvat e5a5696006
Add an API endpoint to retrieve User action data (#3455) 2024-12-02 08:43:17 +01:00
Matjaž Horvat 8976927654
Remove Notifications tab (superseded by Messaging Center) (#3460) 2024-12-02 08:25:56 +01:00
Matjaž Horvat e23b7dbdf8
Show upload .TMX terms (#3459) 2024-11-28 18:53:05 +01:00
Matjaž Horvat 7935bcfb0c
De-hardcode "Mozilla" in the codebase (#3458)
1. De-hardcode non-transactionoal email footer text

2. De-hardcode .TBX header title and description
* Use multi-line f-strings
* Add unit tests
2024-11-28 12:07:49 +01:00
Matjaž Horvat f751a514d0
Add ability to upload personal translation memory (#3452)
This is the final step towards Translation Memory Management: ability for team managers and translators to upload .TMX files to their locale's TM. 

Details:
- The maximum file upload size is 20 MB.
- Supported srclang values (read from <header> and <tu> elements) are en, en-US and en_US (in all cases).
- In <tuv> elements, lang or xml:lang value must match the locale code.
- Source-target combinations that already exist in the DB are not imported.

Also included:
* Cancel button that appears while editing or deleting a TM entry is now positioned left to the main button.
* Error messages are now presented as errors (red color), rather than regular messages (green).
2024-11-27 11:03:47 +01:00
Eemeli Aro 90eaebf44f
Include media/ in pytest norecursedirs (#3457) 2024-11-26 16:14:34 +02:00
Bryan Olsson bc2f3642a9
Merge pull request #3454 from mozilla/spec-0120-transactional-emails
Formatting updates for the Transaction Emails spec
2024-11-21 22:17:27 -08:00