Skip to content

Commit

Permalink
[Fleet] Use theme service to display in Dark Mode when set on User Pr…
Browse files Browse the repository at this point in the history
…ofile (elastic#161819)

Closes elastic#161135

## What does this PR do?
* Fixes the darkMode theme in fleet page.

## Issue References
* elastic#161135

## Video/Screenshot Demo 
##### Before

![250689182-c9c4fe55-c007-424a-aedc-b863f1fd0c88-2](https://github.com/elastic/kibana/assets/1501599/71dd9889-3e2d-4b5b-8825-5f7f18206903)

![250689299-34149e80-40b8-493d-a8fc-3079c8cb199c](https://github.com/elastic/kibana/assets/1501599/fdd1b8af-6a5f-4e6c-892e-73baf58d1aab)

###### FIX:

![250690628-2774dc86-487e-489e-b0a2-a1c06539172d](https://github.com/elastic/kibana/assets/1501599/4525bbfa-7771-4611-a099-751c7be54ec6)

![250691578-74d860fa-1db5-47c4-a3b7-425e86720e06](https://github.com/elastic/kibana/assets/1501599/0b03267a-dfb7-48dd-adc3-e9fc3ad5013b)

---
This code was written and reviewed by GitStart Community. Growing future
engineers, one PR at a time.

---------

Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev>
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
Co-authored-by: Klinger Matheus <50892465+KlingerMatheus@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
6 people authored Jul 19, 2023
1 parent 4540b38 commit 3980791
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion x-pack/plugins/fleet/public/applications/fleet/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ export const FleetAppContext: React.FC<{
theme$,
fleetStatus,
}) => {
const isDarkMode = useObservable<boolean>(startServices.uiSettings.get$('theme:darkMode'));
const darkModeObservable = useObservable(startServices.theme.theme$);
const isDarkMode = darkModeObservable && darkModeObservable.darkMode;

return (
<RedirectAppLinks application={startServices.application}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('step select agent policy', () => {
});

test('should not select agent policy by default if multiple exists', async () => {
useGetAgentPoliciesMock.mockReturnValueOnce({
useGetAgentPoliciesMock.mockReturnValue({
data: {
items: [
{ id: 'policy-1', name: 'Policy 1' },
Expand Down

0 comments on commit 3980791

Please sign in to comment.