88 Commits

Author SHA1 Message Date
e49c73533b I18n: Allow pseudo-locale to be enabled in production builds (#106738)
* I18n: Allow pseudo-locale to be enabled in production builds

* fix tests now that pseudo is around

* remove psuedo locale from i18n package

* load en-us from plugin resources for pseudo

* fix tests + remove 'hidden' option

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-06-17 10:55:15 +01:00
09e8484bac i18n: rename locale to regionalFormat (#106585)
* locale -> regionalFormat, mirroring #102233

* set up regionalFormat to replace locale entirely

* replace locale with regionalFormat

* update reportInteraction arguments
2025-06-16 21:53:55 +02:00
2b8c74de2e i18n: removes useTranslate hook (#106556)
* i18n: removes useTranslate hook

* chore: fix duplicate imports

* chore: fix import sorting and hook dependencies
2025-06-12 11:03:52 +02:00
98c9bc5028 Preferences: Disable the save button whilst saving preferences (#105605)
* disable the save button whilst saving preferences

* use .finally to always reset state of submit button

* fix unit tests
2025-05-19 12:42:44 +01:00
119d5897ea i18n: imports use @grafana/i18n (#105177)
* i18n: everything should target @grafana/i18n

* wip

* chore: updates after PR feedback

* Trigger build

* Trigger build

* Trigger build

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: revert all flaky tests

* chore: some incorrect usages of useTranslate
2025-05-15 09:17:14 +02:00
8a2af6166c i18n: adds @grafana/i18n package (#104603)
* i18n: adds grafana/i18n

* Trigger build

* chore: fix frontend lint

* chore: refactor

* chore: refactor

* chore: expose getI18nInstance in shared deps

* chore: refactors away second init

* Trigger build

* chore: updates after PR feedback

* chore: sync with enterprise

* chore: adds shouldUnescape

* Trigger build

* chore: makes functions internal

* Trigger build

* chore: fix for Pseudo locale

* chore: bumps package version

* chore: fix the version of i18n package
2025-05-09 05:45:20 +02:00
4849f87e82 i18n: Add locale to SharedPreferences (#103133) 2025-04-09 17:15:44 +02:00
ae0bcbd006 Themes: Put experimental themes in an Experimental group (#102989)
put experimental themes in an Experimental group
2025-03-31 09:38:19 +01:00
9e9eb7a4f8 Chore: add new theme event, modify preference type in drawer (#102523)
* add new theme event, modify preference type in drawer

* update to theme_drawer
2025-03-24 11:57:37 +00:00
df0df68f30 Theme drawer tweaks (#102013)
tweaks for theme drawer
2025-03-12 11:42:07 +00:00
b4366db1f1 ThemeDrawer: Change theme from anywhere and preview them (#100405)
* ThemeDrawer: Change theme from anywhere and preview them

* Update

* added subtitle

* Use new component

* Fixes

* Fix runtime ony wrong prop

* Fixed saving issue

* update lang file

* Fixed circular dep

* fix import
2025-03-11 12:03:10 +01:00
01b57f412f Dashboards: WeekStart is now of type WeekStart | undefined instead of string (#101123)
* change weektype from string to WeekStart | undefined

* Change to WeekStart in more places, fix lint

* change in more places

* More weekstart changes

* fix snapshot, update betterer

* keep weekstart as '' in test dashboards to make sure it doesn't break old dashboards
2025-02-24 11:35:55 +01:00
60fa83ea53 Theme: ensure feedback link is gated behind config option (#100815)
ensure feedback link is behind config option
2025-02-17 16:15:03 +02:00
9d7a4a53e4 Themes: Adds 1 more GrafanaCon theme (wip) (#100228)
* Themes: Gloom theme wip

* Themes: Gloom theme wip

* refactor

* A bit brown maybe?

* Update secondary to also be a bit brownish orangy

* Not super happy

* down a bit

* Progress

* Update

* Update

* orange primary again
2025-02-07 15:27:56 +01:00
7d3a77a45c Themes: Add new theme definitions behind feature toggle (#100129)
* create new toggle

* add survey link behind feature toggle

* fix translations

* better theme structure

* add all the themes back

* update matrix

* fix mars contrast

* fix color contrast probs with tron

* fix a11y issues with synthwave/victorian themes

* fix aubergine/zen

* rename green + gold

* rename to space

* rename, only enable 4 for grafanacon

* add survey link

* fix info color in sapphiredusk

* handle extra themes in storybook
2025-02-06 11:08:04 +00:00
6e8e320ace Chore: emit event whenever the theme changes (#99672)
emit event whenever the theme changes
2025-01-28 16:00:54 +00:00
b662879c98 Internationalisation: Add basic e2e test to ensure languages load correctly (#96556)
* fix pseudo locale and add simple e2e test

* add comment

* update test and add comments

* fix unit test

* try 5 instead of 6?

* clear input

* only check pseudo in dev mode

* don't check pseudo in CI

* don't test pseudo locale

* isolate language changes

* move waits around

* only wait for preferences on first visit

* add proper loading state

* bit of tidy up

* hook up ids correctly

* use disabled/isLoading instead of skeleton

* set props on Field
2024-11-19 15:07:14 +00:00
ed31457c00 Combobox: Support undefined, null value and improve typing (#96523)
* Support undefined value

* Check truthiness of value instead

* check falsy

* Conditional typing for clearing value

* Less restrictive default typing

* simplify props

* Add tests for autosizing

* Write failing test case

* Add list of falsy values

* Check if nullish

* Check nullish in itemToString

* Nvm, it doesn't matter here

* Add support for autoFocus

* Pick from InputProps

* Move docstring

* Solve type issues in Storybook

* Fix failing story
2024-11-19 11:52:52 +01:00
55bcbcef83 GrafanaUI: Export Combobox from @grafana/ui (#95622) 2024-10-30 16:59:28 +00:00
096105fed6 New Select: Try it out with some core components (#92826)
* Export Combobox and add portalling

* Use floatingui fixed strategy and fix z-index

* Check non null

* Make value string type only

* Try with fiscal year setting

* Use combobox for WeekStartPicker

* Improve screen reader handling

* Fix faulty import

* Fix type issue

* Fix failing tests and export unstable

* Rename option and remove export

* Use comboboxMockSetup function

* Add support for number type

* menuClosed styles to emotion
2024-09-10 17:28:00 +03:00
85d0e17dc4 Bookmarks: Store URLs instead of ids (#91121) 2024-07-31 13:56:39 +01:00
57323e1104 Preferences: Keep navbar preferences when saving from Preferences screen (#91197) 2024-07-31 11:07:08 +01:00
47f8717149 React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
b525de07cd I18n: Add Brazilian Portuguese (#84461)
* Add pt-br as supported language

* docs

* update pt-br path:

* docs
2024-03-21 13:51:30 +02:00
1749ec9d5e Chore: Remove Form usage from SharedPreferences.tsx (#81468)
* Chore: Remove Form usage from SharedPreferences.tsx

* Update betterer

* Update betterer
2024-01-31 19:33:17 +02:00
5e4a900abe Forms: Remove gf-form appearances in admin, profile and team settings (#74360)
* Accessibility: Added label prop to RadioButtonGroup

* Update packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Update RadioButtonGroup.tsx

* Update RadioButtonGroup.tsx

* corrected ariaLabel

* fix accessibility

* Forms: Remove gf-form appearances in Grafana

* remove wrong commit

* Remove gf-form from User Profile Edit Form

* AlertRuleList

* to not change anything under AlertRuleList

* removed gf-form-button-row

---------

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2023-09-20 12:04:56 +02:00
5a98348faf Chore: remove i18n toggle (#69389)
* remove i18n toggle

* remove beta badge on language picker

* remove toggle from go code

* Revert "remove beta badge on language picker"

This reverts commit 3b76300aa75ad0ab2a7e12da9ee5e02ddb43af18.
2023-06-02 09:24:40 +01:00
2ceed6a169 Preferences: Can reset timezone preference back to default correctly (#68881)
* user essentials mob! 🔱

lastFile:public/app/core/components/SharedPreferences/SharedPreferences.tsx

* invert menuShouldPortal logic on TimeZonePicker and fix unit test

Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com>
Co-authored-by: joshhunt <josh@trtr.co>

---------

Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com>
Co-authored-by: joshhunt <josh@trtr.co>
2023-05-24 09:28:14 +01:00
f8cf67347f Themes: Adds support for extraThemes (behind feature toggle) (#67981)
* Foundations to support more themes

* Fixes

* add another test theme

* Refactorings

* more refactoring

* Update

* Fixing tests

* Fix

* Update
2023-05-10 15:37:04 +02:00
d51e7ec7ef Preferences: Add theme preference to match system theme (#61986)
* user essentials mob! 🔱

lastFile:pkg/api/preferences.go

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:packages/grafana-data/src/types/config.ts

* user essentials mob! 🔱

lastFile:public/app/core/services/echo/utils.test.ts

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/views/index-template.html

* user essentials mob! 🔱

* Restore currentUser.lightTheme for backwards compat

* fix types

* Apply suggestions from code review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* cleanup

* cleanup

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-01-30 10:51:51 +01:00
a0405912a8 Preferences: Add preferences kind and remove unused navbar settings (#59621) 2023-01-25 11:00:32 -08:00
b0e886840d Internationalization: Add language preference analytics (#59230)
* Report change languange

* clean defaults.ini

* Add language to rudderstand user identify call

* undo changes not intended
2022-11-28 07:11:55 -05:00
ba0ac08465 Internationalization: Enable internationalization by default (#59204)
* Enable internationalization feature flag by default

* Change i18n feature to beta

* Set i18n feature flag to stable

* update features
2022-11-23 14:23:26 +00:00
f8dc333ee4 Preferences: Add confirmation modal when saving org preferences (#59119) 2022-11-22 16:47:42 +01:00
460be70261 Internationalization: Change locale preference to language (#58359)
* backend locale -> language

* frontend locale -> language

* sample.ini and tests

* fix few last locale -> language

* fix few last locale -> language
2022-11-22 12:18:34 +00:00
fc75076b72 I18n: Show languages in local names (#57367)
* I18n: Show languages in local names

* fixed test
2022-10-21 05:29:03 -04:00
b7d969baf1 I18n: Improve tooling (#56731)
* Delete en-US.json before extracting strings so it's always up to date

* Add 'comment' to message jsons

* Enable Pseudo-locale option only in dev mode

* don't load english messages

* fix package.json

* fix
2022-10-12 07:51:16 -04:00
719769ee7c I18n: Add Chinese (Simplified) (#56739)
* Prevent _old.json files from being created

* Add contrib docs for adding new locale

* add chinese (simplified)
2022-10-12 06:12:46 -04:00
5361efc225 I18n: Migrate to I18next (#55845)
* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
2022-10-06 16:34:04 +01:00
2db6a199b8 Preferences: Support setting any dashboard as home, not just the starred ones (#54258) 2022-08-26 12:40:40 -04:00
c332bf885c Migrate to UID: Stop using search result ID (#54099)
* DashList: Stop using IDs

* DashLinks: Stop using IDs

* BackendSrv: Do not use ID for search endpoint

* DashboardDataDTO: Remove ID

* Remove unused properties from DashboardSearchItem
2022-08-26 09:42:46 +02:00
6423485061 Preferences: Use search endpoint to get missing dashboard (#53540) 2022-08-11 10:34:01 +02:00
9f81b3dcc6 I18n: Change locale format to IETF language tag (#52596)
* I18n: Change locale format to our agreed format

* fix test

* Build lingui messages files before ci tests
2022-07-22 10:50:00 -04:00
2ec01c8d08 Preferences: Use dashboardUID to set the home dashboard (#51919) 2022-07-22 10:44:22 +02:00
496c2e26f4 I18n: User and Org Preferences allow change of Language (#51175)
* add locale selection settings under preferences; Alpha feature toggle;

* extract components' ids for internationalisation references

* migrate OrgDetailsPage tests from Enzyme to RTL

* test locale selection in shared preferences

* fix OrgDetailsPage needing a fetch polyfill; "Real fetch shouldn't be being hit." - Josh

* remove snapshot

* remove snapshot
2022-06-23 11:20:31 +03:00
16a948fc88 Query History: Implement RemoteStorage methods: settings (#49320)
* Implement methods to get an update user preferences

* Update integration test

* Update label

* Remove unused type

* Simplify async code
2022-05-23 13:42:12 +02:00
6e530d45bc grafana/ui: Add default type="button" to <Button> (#48183) 2022-05-04 18:36:14 +02:00
06d3c27bc1 Select: Portal menu by default (#48176)
* Remove menuShouldPortal from all <Select /> components

* fix unit tests

* leave menuShouldPortal as an escape hatch

* Fix import order
2022-05-04 15:12:59 +01:00
3c6e0e8ef8 Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
36983d8d3b Chore: Mark up User Profile page for translation (#43874)
* Mark up User profile page for translation

* Extract new messages

* updated selectors

* update selectors

* wip TestProvider

* update tests

* fix field labels

* extract new messages

* don't store date objects in redux state

* don't store date objects in redux state
2022-01-17 16:58:49 +00:00