Problem:
When updating the Term.text, the associated entity was not correctly
updating to point to the newly created entity. This led to Term.entity
property still pointing to the previous, now obsolete entity.
Solution:
In the `create_entity()` method of the Term model, explicitly set the
term property of the associated entity to the current term instance
before saving it. This ensures that the entity is correctly associated
with the updated term instance.
Additionally, removed the `update_fields` argument from the
`entity.save()` call to ensure that all fields are properly saved,
including the `obsolete` flag if the entity is not newly created.
Changes:
- Added `entity.term = self` before updating the `entity_id` in the `create_entity()` method.
- Removed the `update_fields` argument from `entity.save()` call to ensure all fields are saved.
Problem:
In the search results list, highlighted parts of strings are currently
inherited from the search box, including its capitalisation, making
the source/translated string appear different from its actual state in
the search results list.
Solution:
Updated `<Highlight />` component to preserve the capitalization of the
source text in the search results list. The highlighted marks now
reflect the original capitalization of the source string.
String filters can be slow, especially because ordering entities by Resource.path is slow. It turns out that:
- Adding DB index to Resource.path doesn't bring performance gains.
- Sorting entities by any other Resource.field is fast.
The reason for slowness is probably that Resource.path can be a pretty long text field.
So we're now introducing Resource.order, which to represent the alphabetic order of resources in the project. We reorder resources when new resources are added to the project.
The functionality should remain identical, but the views should be significantly faster. In the case of Firefox Tag dashboards, the load times were in the 20-30 second range (or timing out), now these pages take max. 2-3 seconds to load.
The patch also:
* adds an extra DB index, which significantly impacts Tags tab performance
* drops the unused code (which represents the vast majority of changes in this patch)
* moves remaining files from tags/utils to tags/admin
After Fluent pretranslations are created, we need to parse and serialize them again in order to make sure they are stored in the canonical form (e.g. with spaces within curly braces).
Fix test:
- The following code only applies to non-FTL strings: "Empty strings and strings containing whitespace only do not need translation".
For locales that use the same locale code in Google Translate (e.g. es-AR and es-ES both use es),
we now use the correct locale code in Machinery Google Translate if AutoML is enabled.
* Fix positions of menus and overlays on narrow screens
* Always show target locale code in the navbar
* Implement a 2-column UI for middle screen widths between 600 and 800 pixels
Also:
* Expand Header navigation breakpoint to the middle screens
* Prevent jumping when moving between tabs
* useNarrowScreen() -> useWindowWidth()
Details:
* Only show one Helpers panel at the same time
* Use dot rather than count as the tab indicator
* Make visual distinction between the History panel and the Helpers.
* Add support for batch actions in the single-columm UI
Also included:
* Move OriginalString component and friends out of Metadata component
* Unify Term tab count behaviour with other Helper tabs: do not show 0
* Unify dark-theme.css and light-theme.css structure
* De-hardcode and fix color value in the FiltersPanel
* Move third column under the middle column
* Add Entities list toggle
* Animate switching between the editor and the string list
* When hovering over strings in the string list, show indicator to open the editor
* Hide main navigation
* For easier development, move all @media max-width to App.css temporarily
Also:
* Remove unused flex properties
* Drop 700px transition on the header
* Do not show success notification on theme change (unify behaviour with translate view)
* If theme change fails, show human-friendly error message in the UI
* If theme change fails, log error message on the server
* Migrate old visibility_email values to the new ones
Fixes#2302.
Updating a locale code (e.g., changing sat-Olck to sat) previously could lead to broken links and inaccessible /settings pages for users who had their homepage set to the old locale code. Here we are adding a redirection mechanism that ensures continuity even when locale codes are changed.
* In checks, escape straight apostrophes in strings.xml files
* In serializer, escape straight apostrophes in strings.xml files. In parser, unescape them.
* Drop special-casing of Android DTD quotes in checks
* Rename pontoon/sync/formats/compare_locales -> pontoon/sync/formats/xml
Fixes#2515Fixes#3006
Ports all the rules from react-content-marker into an inlined implementation. Results are cleaner, more efficient, and less buggy. Also, for placeholders we now match the rules used in the editor highlighting.
In a few places the rules are relaxed a bit and/or made more sane, but these are unlikely to actually effect real-world messages noticably. Except where they fix current bugs. Also, the placeholder rules now match the editor.
* Fix#2980: Prevent bots from checking the /insights page
* Optimize ProjectLocaleInsightsSnapshot Admin view/editing page
* Refactor data gathering for the /insights page
1. Fix#2979: Optimize /insights page.
To render the charts on the Insights pages, we use periodically gathered ProjectLocaleInsightsSnapshot data. That works fine on Project, Locale and
ProjectLocale pages, but not on the /insights page which shows data across the entire app. The amount of data requested from the DB quickly becomes big and the request starts timing out.
In this patch, we gather data directly from the ActionLog as hinted at in #2938.
2. Fix#2999: Show insights for all months.
3. Calculate monthly averages rather than averages of averages.