Files
graylog2-server/graylog2-web-interface/test/DefaultProviders.tsx
Dennis Oelkers 163cdfdff3 Updating to Mantine 8. (#23522)
* Bump the mantine group in /graylog2-web-interface with 4 updates

Bumps the mantine group in /graylog2-web-interface with 4 updates: [@mantine/core](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/core), [@mantine/dropzone](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/dropzone), [@mantine/hooks](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/hooks) and [@mantine/notifications](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/notifications).


Updates `@mantine/core` from 7.17.7 to 8.0.0
- [Release notes](https://github.com/mantinedev/mantine/releases)
- [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mantinedev/mantine/commits/8.0.0/packages/@mantine/core)

Updates `@mantine/dropzone` from 7.17.7 to 8.0.0
- [Release notes](https://github.com/mantinedev/mantine/releases)
- [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mantinedev/mantine/commits/8.0.0/packages/@mantine/dropzone)

Updates `@mantine/hooks` from 7.17.7 to 8.0.0
- [Release notes](https://github.com/mantinedev/mantine/releases)
- [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mantinedev/mantine/commits/8.0.0/packages/@mantine/hooks)

Updates `@mantine/notifications` from 7.17.7 to 8.0.0
- [Release notes](https://github.com/mantinedev/mantine/releases)
- [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mantinedev/mantine/commits/8.0.0/packages/@mantine/notifications)

---
updated-dependencies:
- dependency-name: "@mantine/core"
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: mantine
- dependency-name: "@mantine/dropzone"
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: mantine
- dependency-name: "@mantine/hooks"
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: mantine
- dependency-name: "@mantine/notifications"
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: mantine
...

Signed-off-by: dependabot[bot] <support@github.com>

* Passing test environment to Mantine theme provider.

* Correcting assertion in test.

* Making sure that `div` is not ancestor of `tr`.

* Suppressing nested element warnings for now.

* Suppressing nested `form` error until usage of `NestedForms` is fixed.

* Improving tests.

* Fixing type.

* Use `:hover` pseudo-class to fix hover color for menu items.

* Updating yarn lockfile.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Linus Pahl <linus.pahl@graylog.com>
2025-09-03 08:51:33 +02:00

47 lines
1.7 KiB
TypeScript

/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/
import * as React from 'react';
import { ThemeProvider } from 'styled-components';
import { defaultTimezone, defaultUser } from 'defaultMockValues';
import { COLOR_SCHEME_LIGHT } from '@graylog/sawmill';
import SawmillSC from '@graylog/sawmill/styled-components';
import SawmillMantine from '@graylog/sawmill/mantine';
import { MantineProvider } from '@mantine/core';
import CurrentUserContext from 'contexts/CurrentUserContext';
import UserDateTimeProvider from 'contexts/UserDateTimeProvider';
const mantineTheme = SawmillMantine({ colorScheme: COLOR_SCHEME_LIGHT });
const scTheme = SawmillSC(mantineTheme);
type Props = {
children: React.ReactNode;
env?: 'default' | 'test';
};
const DefaultProviders = ({ children, env = undefined }: Props) => (
<CurrentUserContext.Provider value={defaultUser}>
<MantineProvider theme={mantineTheme} env={env}>
<ThemeProvider theme={{ ...scTheme, changeMode: () => {} }}>
<UserDateTimeProvider tz={defaultTimezone}>{children}</UserDateTimeProvider>
</ThemeProvider>
</MantineProvider>
</CurrentUserContext.Provider>
);
export default DefaultProviders;