1. Add a banner for users defined as "Project Manager" within a project. To reduce confusion, the MNGR tooltip has been changed from from "Manager" to "Team Manager".
2. Consolidate roles between backend and frontend:
* If a user as a role within the locale (translator, manager), we use that for the banner
* If a user is set as PM, we use that even if the user is an Admin
* The isAdmin flag is true if the user is a superuser, not PM
* Introduce isPM flag and use it where isAdmin was used before
* Rename: managerForLocales -> canManageLocale, translatorForLocales -> canTranslateLocales
* Introduce managerForLocales and translatorForLocales and use them in UserStatus instead of canManageLocales and canTranslateLocales
3. Other changes:
* Add CSS variables for users, instead of reusing the ones for translation status
* Ignore system users for banners
* Use status identifier as a class name
* The term role is already taken, let's settle for status consistently
---------
Co-authored-by: Matjaž Horvat <matjaz.horvat@gmail.com>
* Created test file
* Created initial test cases for SearchPanel component
* Added backend test cases, failing redux test case
* Linting fixes
* Seperated backend tests into different functions
* Removed print statements
* Formatted backend tests to use args and kwargs
---------
Co-authored-by: Harmit Goswami <hgoswami@harmits-mbp.home>
Co-authored-by: Harmit Goswami <hgoswami@Harmits-MacBook-Pro.local>
* Clicking outside of the search options will lose selected checkboxes
* Clicking on "APPLY SEARCH OPTIONS" will reload the page, but won't use the input field text to search
Translate view makes requests to Google Translate and Microsoft Translator backend code even if API keys are not set.
While the requests to external services are not made in this case, we should still prevent the redundant call to Pontoon backend.
We currently use a weird way of paginating entities - in each request we include a list of already loaded entities, which we exclude from the matching entities in Django and then return the first page of the remaining entities. This is a relic of the react-infinite-scroller library which we no longer use.
We should implement proper paging, i.e. drop exclude_entities and only return the relevant page.
That should also speed up loading of entities, because NOT IN DB queries tend to be slow and because less data will be transferred.
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.
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